SA-MP Forums Archive
Buy drugs - 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: Buy drugs (/showthread.php?tid=434004)



Buy drugs - [..MonTaNa..] - 30.04.2013

....


Re: Buy drugs - [..MonTaNa..] - 30.04.2013

Removed.


Re : Buy drugs - DaTa[X] - 30.04.2013

somthing like this
change the var PlayerInfo to yours
this cmd with sscanf
pawn Код:
CMD:buydrugs(playerid,params[])
{
    new amount,string[100];
    if(sscanf(params,"d",amount)) return SendClientMessage(playerid,-1,"usage: /buydrugs [amount]");
    if(PlayerInfo[playerid][Drugs] > 450) return
    format(string,sizeof(string),"you already have %d gram of drugs, you cannot purchase more",PlayerInfo[playerid][Drugs]) && SendClientMessage(playerid,-1,string);
    PlayerInfo[playerid][Drugs]+=amount;
    return 1;
 }