SA-MP Forums Archive
/gift command problem - 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: /gift command problem (/showthread.php?tid=438033)



/gift command problem - JohnYoti - 18.05.2013

Hello all.I have a little problem.I have made a command /gift (when you type it, you get 100.000$). The problem is when I type /gift multiple times, it gives me 100.000$ all the time.I wanted to make something like...when you type /gift once, it gives you 100.000$ but when you type /gift again a message appears "You got money once.You can't get money again".How can I do it?


Re: /gift command problem - DeMoX - 18.05.2013

When players left and come again they will use it.

pawn Код:
new gift[MAX_PLAYERS]              = 1;//on the top of your gamemode.

public OnPlayerConnect(playerid)
{
    gift[playerid] = 1;
}

CMD:gift(playerid,params[])
{
    if(gift[playerid] == 1)
    {
      GivePlayerMoney(playerid,100000);
      gift[playerid] = 0;
     }
     else return SendClientMessage(playerid, -1, "You got money once.You can't get money again");
}

//if you want him to be able to use it after death
public OnPlayerDeath(playerid, killerid, reason)
{
    gift[playerid] = 1;
}



Re: /gift command problem - JohnYoti - 18.05.2013

Worked! Thank you so much man


Re: /gift command problem - DeMoX - 18.05.2013

Quote:
Originally Posted by JohnYoti
Посмотреть сообщение
Worked! Thank you so much man
No problem dude, You're Welcome