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



doubt command - Nahuel0707 - 31.03.2020

this is my command to receive money how can i set a limit for them to put the command and wait so many minutes to put it back? thanks




CMD:recibirpaga(playerid,params[])
{
if(PlayerInfo[playerid][jMiembro] == 3)
{
DarDinero(playerid, 14000);
PlayerPlaySound(playerid,1139,0,0,0);
}
return 1;
}


Re: doubt command - SiaReyes - 31.03.2020

Code:
new MoneyLock[MAX_PLAYERS];
CMD:recibirpaga(playerid,params[])
{
if(PlayerInfo[playerid][jMiembro] == 3)
{
    if(MoneyLock[playerid] >= gettime()) return SendClientMessage(playerid, -1, "Command in Cooldown");
     MoneyLock[playerid] = gettime()+120; // 2 mins
    DarDinero(playerid, 14000);
    PlayerPlaySound(playerid,1139,0,0,0);
}
return 1;
}