just an example code
#1

Removed
Reply
#2

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

Reply
#3

Код:
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
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)