SA-MP Forums Archive
need help with command buy - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with command buy (/showthread.php?tid=160831)



need help with command buy - OmarEco - 17.07.2010

if player type command /buy
this code
GivePlayerMoney(playerid,-6000):
if player don't have money join in command to how i repair this and send message if he don't have money


Re: need help with command buy - [XST]O_x - 17.07.2010

pawn Код:
if(!strcmp(cmdtext, "/buy", true))
{
    if(GetPlayerMoney(playerid) >= 6000)
    {
        GivePlayerMoney(playerid,-6000);
        ///And all other things you want the command to do.
    }
    else return SendClientMessage(playerid,color,"You don't have enough money!");
    return 1;
}



Re: need help with command buy - OmarEco - 17.07.2010

error 001: expected token: ";", but found "}"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: need help with command buy - Agent Smith - 17.07.2010

pawn Код:
if(!strcmp(cmdtext, "/buy", true))
{
    if(GetPlayerMoney(playerid) >= 6000)
    {
        GivePlayerMoney(playerid,-6000);
        ///And all other things you want the command to do.
    }
    else return SendClientMessage(playerid,color,"You don't have enough money!");
    return 1;
}



Re: need help with command buy - OmarEco - 17.07.2010

thanks thanks


Re: need help with command buy - OmarEco - 17.07.2010

ok in 1 time used command i need repair and flip commands to use one time in 15 min


Re: need help with command buy - ViruZZzZ_ChiLLL - 17.07.2010

pawn Код:
if(strcmp("/example", cmdtext, true, 8) == 0)
{
 if(GetPVarInt(playerid,"CMDABUSE1")>GetTickCount())return SendClientMessage(playerid,Red,"ERROR : You must wait before using this command again!");
 SetPVarInt(playerid,"CMDABUSE1",GetTickCount()+60000*15);
 return 1;
}
Hope you get what I mean.


Re: need help with command buy - OmarEco - 17.07.2010

error 017: undefined symbol "GetPVarInt"
error 017: undefined symbol "SetPVarInt"


Re: need help with command buy - (.Aztec); - 17.07.2010

Quote:
Originally Posted by omarhassan
Посмотреть сообщение
error 017: undefined symbol "GetPVarInt"
error 017: undefined symbol "SetPVarInt"
Are you using the new 0.3 includes?


Re: need help with command buy - OmarEco - 18.07.2010

yes i use samp 0.3 and files of samp server 0.3