SA-MP Forums Archive
just an example code - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: just an example code (/showthread.php?tid=407444)



just an example code - Fernado Samuel - 13.01.2013

Removed


AW: just an example code - BiosMarcel - 13.01.2013

PHP код:
Command:buy(playerid,params[])
{
if(
choclate >= 1)//if he have 1 or more
{
GivePlayerMoney(playerid,5);
choclate --;//subtract 1
}




Re: just an example code - Kontrol - 13.01.2013

Код:
new choclate[MAX_PLAYERS]; // TOP OF SCRIPT

Command:buy(playerid,params[]) 
{ 
if(choclate[playerid] >= 1)//if he have 1 or more 
{ 
    GivePlayerMoney(playerid,5); 
    choclate[playerid] --;//subtract 1 
    } 
}
Need to use global vars


Re: just an example code - Mr.Anonymous - 13.01.2013

pawn Код:
if(chocolate >= 1)
{
   GivePlayerWeapon(playerid, 26, 5);
   chocolate--;
}
else SendClientMessage(playerid, -1, "You dont have enough chocolate");
PS: I would love to know a place where you can buy shotguns by giving chocolates.