12.06.2018, 16:06
How do I make a command to only be used once?
new bool:testvar;
CMD:testcmd(cmd)
{
if(testvar) return 0;
testvar = true;
//cmd stuff here
return 1;
}
new UsedCommand[MAX_PLAYERS]; //on top of the script
OnPlayerConnect(playerid)
{
UsedCommand[playerid] = 0;
return 1;
}
CMD:yourcommand(playerid, params[])
{
if(UsedCommand[playerid]==1) return SendClientMessage(playerid, -1, "You can only use this command once!");
// rest of the command