Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Dimmon ACC 7.6 SMS SHOP


kysu123

Rekomendowane odpowiedzi

Opublikowano
Witam.
 
Mam problem z kodem SMS Shopu, a mianowicie chodzi o to, że na rooku można sobie kupić itemy z maina, ponieważ jest tam depot. Potrzebuję pomocy jak to ogarnąć aby dawał tylko itemy tylko postaciom, które mają profesję. Coś na zasadzie if vocation > 1 then. Wtedy i tylko wtedy daje itemy, inaczej wyświetla się komunikat, że nie możesz kupić przedmiotów na rookgardzie, czy coś w ten deseń. Poniżej skrypt. Jestem w stanie zapłacić za ogarnięcie tego.
 
<h2><div class="cufon_t_h2">Sms Shop</div></h2> 
<div id="topnews" class="pad1"> 
 
    <div class="mi-t"> 
        <div> 
            <div><img src="images/0.gif" alt=""/></div> 
        </div> 
    </div> 
    <div class="mi-m"> 
        <div class="mi-m1"> 
            <div class="mi-m2"> 
                <div class="news"> 
<center>

<!--
Biznes-Host Shop API
By Baabuseek
-->
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	var first_imageSource = $("select[name=offer] option:first").val();
      window.name = first_imageSource;

	$('select[name=offer]').keyup(function() {
	var imageSource = $("select[name=offer]").val();
      $cos = "#" + window.name;
      $($cos).fadeOut(10);
	$name = "#" + $('#offer').val();
       $($name).fadeIn();
        window.name = imageSource;
	});

    $("select[name=offer]").change(function() {
        var imageSource = $("select[name=offer]").val();
      $cos = "#" + window.name;
      $($cos).fadeOut(10);
	$name = "#" + $('#offer').val();
       $($name).fadeIn();
        window.name = imageSource;
    });
});
</script>


<?php
include("config.php");
/**
 * Shop Script Configuration
 */

$offer = array(array());
 
$shop['id'] = 49699; //ID klienta dotpay

if($_GET['buy'] == "thing"){ // konfiguracja dla przedmiotow

$offer[1]['offer_type'] = "item"; 
$offer[1]['item_id'] = 2640;
$offer[1]['item_name'] = "Soft Boots";
$offer[1]['desc'] = "Regeneruje 300000 many i hp. <br>Zwiekszają szybkość chodzenia.";
$offer[1]['number'] = 74068; //numer na ktory trzeba wyslac sms
$offer[1]['code'] = "WMK1"; //tresc smsa(bez AP.)
$offer[1]['price'] = "4,92"; //koszt smsa

$offer[2]['offer_type'] = "item"; 
$offer[2]['item_id'] = 2159;
$offer[2]['count'] = "100";
$offer[2]['item_name'] = "100 ScarabCoins";
$offer[2]['desc'] = "Najwieksza waluta na serwerze.";
$offer[2]['number'] = 71068; //numer na ktory trzeba wyslac sms
$offer[2]['code'] = "GRE7"; //tresc smsa(bez AP.)
$offer[2]['price'] = "1,22"; //koszt smsa

$offer[3]['offer_type'] = "item"; 
$offer[3]['item_id'] = 2453;
$offer[3]['item_name'] = "Sprite Wand";
$offer[3]['desc'] = "You see a sprite wand (Atk:250 Def:250).";
$offer[3]['number'] = 72068; //numer na ktory trzeba wyslac sms
$offer[3]['code'] = "CRV4"; //tresc smsa(bez AP.)
$offer[3]['price'] = "2,46"; //koszt smsa

$offer[4]['offer_type'] = "item"; 
$offer[4]['item_id'] = 2663;
$offer[4]['item_name'] = "Mystic Turban";
$offer[4]['desc'] = "Zwieksza szybkość chodzenia. <br>Zmniejsza otrzymywane obrażenia o 25% <br>Zwiększa o 70 magic level.";
$offer[4]['number'] = 74068; //numer na ktory trzeba wyslac sms
$offer[4]['code'] = "WMK1"; //tresc smsa(bez AP.)
$offer[4]['price'] = "4,92"; //koszt smsa

$offer[5]['offer_type'] = "item"; 
$offer[5]['item_id'] = 2361;
$offer[5]['item_name'] = "Frozen Starlight";
$offer[5]['desc'] = "Zmniejsza otrzymywane obrażenia o 50%. <br> Przy uzyciu dodaje mane oraz hp.";
$offer[5]['number'] = 71068; //numer na ktory trzeba wyslac sms
$offer[5]['code'] = "GRE7"; //tresc smsa(bez AP.)
$offer[5]['price'] = "1,22"; //koszt smsa

$offer[6]['offer_type'] = "item"; 
$offer[6]['item_id'] = 2433;
$offer[6]['item_name'] = "Magic Staff";
$offer[6]['desc'] = "You see a magic staff (Atk:100 Def:50).";
$offer[6]['number'] = 72068; //numer na ktory trzeba wyslac sms
$offer[6]['code'] = "CRV4"; //tresc smsa(bez AP.)
$offer[6]['price'] = "2,46"; //koszt smsa

$offer[7]['offer_type'] = "item"; 
$offer[7]['item_id'] = 2656;
$offer[7]['item_name'] = "Joes Jersey";
$offer[7]['desc'] = "Daje 50% szansy respawnu/odrodzenia zabitego potwora.";
$offer[7]['number'] = 72068; //numer na ktory trzeba wyslac sms
$offer[7]['code'] = "CRV4"; //tresc smsa(bez AP.)
$offer[7]['price'] = "2,46"; //koszt smsa

$offer[8]['offer_type'] = "item"; 
$offer[8]['item_id'] = 2196;
$offer[8]['item_name'] = "Amulet Of Life";
$offer[8]['desc'] = "Zabezpiecza przed stratą ekwipunku, doświadczenia i umiejętności w przypadku śmierci. <br>Zwiększa zadawane obrażenia o 25%.<br>Dodaje 10000 maxhealth oraz maxmana.<br>Zwiększa o 50 magic level.";
$offer[8]['number'] = 74068; //numer na ktory trzeba wyslac sms
$offer[8]['code'] = "WMK1"; //tresc smsa(bez AP.)
$offer[8]['price'] = "4,92"; //koszt smsa

} if($_GET['buy'] == "premium"){ // konfiguracja dla premium

$offer[1]['offer_type'] = 'unban';
$offer[1]['item_name'] = "Unban";
$offer[1]['desc'] = "Usunięcie bana z postaci.";
$offer[1]['number'] = 73068; //numer na ktory trzeba wyslac sms
$offer[1]['code'] = "JTL8"; //tresc smsa(bez AP.)
$offer[1]['price'] = "3,60"; //koszt smsa

$offer[2]['offer_type'] = 'skull';
$offer[2]['item_name'] = "Usunięcie skull";
$offer[2]['desc'] = "Usunięcie skull'a (Red, White) oraz fragów z postaci.";
$offer[2]['number'] = 72068; //numer na ktory trzeba wyslac sms
$offer[2]['code'] = "CRV4"; //tresc smsa(bez AP.)
$offer[2]['price'] = "2,46"; //koszt smsa

}


/**
 * Shop main Script
 */

$erno = 0;
$offer[0]['offer_type'] = 'error';

if($_GET['buy'] == "premium")
    $offer[0]['item_name'] = "Wybierz z listy..";
else
    $offer[0]['item_name'] = "Wybierz przedmiot..";

$offerId = $_POST['offer'];
$players_folder = $todata.'/players/';
$acc_folder = $todata.'/accounts/';

if( $offer[$offerId]['offer_type'] == 'unban' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Entered code is not valid.";
        else if( $status == 0 )
            $message = "Entered code is not valid.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml['banned'] = 0;
	    $xml->ban['banned'] = 0;
	    $xml->ban['banstart'] = 0;
	    $xml->ban['banend'] = 0;
	    $xml->ban['reason'] = "";
	    $xml->ban['action'] = "";
	    $xml->ban['deleted'] = 0;
	    $xml->ban['finalwarning'] = 0;
	    $xml->ban['namelock'] = 0;
            $xml->asXML($file);
	    $message = "You have been unbanned.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'access' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Entered code is not valid.";
        else if( $status == 0 )
            $message = "Entered code is not valid.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml['access'] = 3;
            $xml->asXML($file);
	    $message = "Dostałeś pozycję GM.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'skull' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
	
    if( file_exists($file) )
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Entered code is not valid.";
        else if( $status == 0 )
            $message = "Entered code is not valid.";
        else
        {
            $xml = simplexml_load_file($file);
	    $xml->skull['type'] = 0;
	    $xml->skull['kills'] = 0;
	    $xml->skull['ticks'] = 0;
	    $xml->skull['absolve'] = 0;
            $xml->asXML($file);
	    $message = "Skull'e oraz fragi zostały usunięte.";
        }
    }
    else
	$message = "<font color='red'><b>This character do not exists!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'item' )
{
    $nick = $_POST['nick'];
    $check = $_POST['check'];
    $file = $players_folder.$nick.'.xml';
    $item_id = $offer[$offerId]['item_id'];
	
    if( file_exists($file) ) 
    {
        //Sprawdzacz kodu
	$id   = $shop['id'];
	$code = $offer[$offerId]['code'];
        $handle = fopen("http://dotpay.pl/check_code.php?id=".$id."&code=".$code."&check=".$check."&type=sms&del=1", "r");
        $status = fgets($handle, 8);
       	fclose($handle);

	if( empty($check) || empty($nick) )
            $message = "Please fill all fields.";
        else if( preg_match('/[^0-9A-Za-z]/', $check) )
            $message = "Entered code is not valid.";
        else if( $status == 0 )
            $message = "Entered code is not valid.";
        else
        {
			$xml = simplexml_load_file($file);
			$character = $xml->depots->depot->item->inside->addChild('item');
			$character->addAttribute('id', $item_id);
			if(isset($offer[$offerId]['count'])){
			    $character->addAttribute('count', $count); //fix
			}
			$newplayerFile = $xml->asXML();
			$open_file = fopen($file, 'w');
			fwrite($open_file, $newplayerFile);
			fclose($open_file);
			
			$message = "Wybrany przedmiot został dodany do Twojego depo.";
        }
    }
    else
	$message = "<font color='red'><b>Taka postać nie istnieje!</b></font>";
}

else if( $offer[$offerId]['offer_type'] == 'error' )
    $message = "Błąd! Prawdopodobnie nie wybrałeś żadnej rzeczy!<br>";

if( isset($message) )
{
    echo "<center>".$message."</center>";
    $erno = 1;
}

?>
<?php
if($_GET['buy'] != "" && $erno == 0){
?>
<center><b>
Pamiętaj, że twoja postać musi być wylogowana!
</b><br><br>
<?php if($_GET['buy'] == "premium"){ ?>
<form action="index.php?subtopic=shop&buy=premium" method="post">
<?php } else { ?>
<form action="index.php?subtopic=shop&buy=thing" method="post">
<?php } ?>
	<table cellspacing="0" cellpadding="5" border="0">
        <tr>
        	<td><?php if($_GET['buy'] == "premium"){ ?>Ilość dni:<?php } else {?>Przedmiot:<?php } ?></td>
            <td>
                <select class="input1" id="offer" name="offer" size="1">
<?php
$from = "0";
$to = count($offer);
while($from < $to){
echo '<option value="'.$from.'">'.$offer[$from]['item_name'].'</option>';
$from++;
}
?>

                </select>
            </td>
       	</tr>
    	<tr>
        	<td>Nick Postaci:</td>
            <td><input class="input1" type="text" name="nick" /></td>
        </tr>
		<tr>
        	<td>Kod który otrzymałeś:</td>
            <td><input class="input1" type="text" name="check" maxlenght="8" /></td>
        </tr>
        <tr>
        	<td colspan="2"><input class="input3" type="submit" onclick="return confirm('UWAGA! Jeśli jesteś pewien, że postac jest [Wylogowana] kliknij OK.')" value="Zamów!" /></td>
        </tr>
	</table>

</form>
<br><br>

<?php
$from = "1";
$to = count($offer);
while($from < $to){
?>
<div style="display:none;" id="<?=$from;?>">

<TABLE WIDTH="450" CELLSPACING="1" CELLPADDING="5" BORDER="0" bgcolor="#D2A96A"> 
<TR style="background: #AD7C34;" height="25"> 
<TD ROWSPAN="2" ALIGN="center" VALIGN="middle"><b><?php if($_GET['buy'] == "premium"){ ?>Premium<?php } else {?>Nazwa Przedmiotu<?php } ?></b></TD> 
<TD COLSPAN="3" ALIGN="center" VALIGN="middle"><b>Opis</b></TD> 
</TR> 
<TR style="background: #C89548;"> 
<TD ALIGN="center" VALIGN="middle"><b>Numer SMS</b></TD> 
<TD ALIGN="center" VALIGN="middle"><b>Treść SMS</b></TD> 
<TD ALIGN="center" VALIGN="middle"><b>Koszt (PLN)</b></TD> 
</TR> 
<TR style="background: #D2A96A;"> 
<TD ALIGN="center" VALIGN="middle">
<?php if($_GET['buy'] == "premium"){ ?>
<img src="images/premium.png" alt="" /><br><?=$offer[$from]['item_name'];?>
<?php }
 else if($_GET['buy'] == "outfit") { ?>
<img src="outfits/<?=$offer[$from]['outfit_id'];?>.gif" alt="" /><br><?=$offer[$from]['item_name'];?>
<?php }
 else {?>
<img src="img/<?=$offer[$from]['item_id'];?>.gif" alt="" /><br><?=$offer[$from]['item_name'];?>
<?php } ?>
</TD> 
<TD COLSPAN="3" ALIGN="center" VALIGN="middle"><small><br><?=$offer[$from]['desc'];?><br></small></TD> 
</TR> 
<TR style="background: #D0A564;"> 
<TD ALIGN="center" VALIGN="middle"></TD> 
<TD ALIGN="center" VALIGN="middle"><b><?=$offer[$from]['offer_number'];?></b></TD> 
<TD ALIGN="center" VALIGN="middle"><b>AP.<?=$offer[$from]['code'];?></b></TD> 
<TD ALIGN="center" VALIGN="middle"><b><?=$offer[$from]['offer_price'];?></b></TD> 
</TR> 
</TABLE>
<small><i>Aby otrzymać kod 
<?php if($_GET['buy'] == "premium"){ ?>
na wybraną ilość dni premium
<?php } else { ?>
do tego unikalnego przedmiotu 
<?php } ?>
wyślij sms o treści AP.<?=$offer[$from]['code'];?> na numer <?=$offer[$from]['number'];?></i></small><br> 
<br><br>
</div>
<?php
$from++;
}
?>
<br>
<p>Usługa dostępna jest w sieciach: T-Mobile, Plus GSM, Orange oraz Play.</p>
<p><strong>Usługi SMS dostarcza i obsługuje serwis Dotpay.pl</strong></p>
<?php
}
if($_GET['buy'] == "" && $erno == 0){
?>
<center> <!-- <img src='images/icon-shops.gif'> --> <br><br>
<b><a href="index.php?subtopic=shop&buy=premium"><font color="brown"><u>Unban, Usunięcie RS</font></u><font color="red"> [SMS]</font></b></a>
<br>
<br><font color="black">----------------------------------------------</font>
<br>
<br><b><a href="index.php?subtopic=shop&buy=thing"><font color="brown"><u>Kup Przedmioty</u></font><font color="red"> [SMS]</font></b></a>
<br>
<br><font color="black">----------------------------------------------</font>
</center></b>
<?php
}
?>
</center>
                </div> 
            </div> 
        </div> 
    </div> 
    <div class="mi-b"> 
        <div> 
            <div><img src="images/0.gif" alt=""/></div> 
        </div> 
    </div> 
 
</div>

 

Opublikowano

wyslij jeszcze plik z characters.php bo potrzeba nie wiem jak wyglada funkcja sprawdzajaca profesje

 

nad tym trzeba dac else sprawdzajacy voc:

        {
			$xml = simplexml_load_file($file);
			$character = $xml->depots->depot->item->inside->addChild('item');
			$character->addAttribute('id', $item_id);
			if(isset($offer[$offerId]['count'])){
			    $character->addAttribute('count', $count); //fix
			}
			$newplayerFile = $xml->asXML();
			$open_file = fopen($file, 'w');
			fwrite($open_file, $newplayerFile);
			fclose($open_file);
			
			$message = "Wybrany przedmiot został dodany do Twojego depo.";
        }

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...