25.01.2014, 18:54
Quote:
When player uses this cmd he should get a white hockey mask and should be able to use it every 5mins
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/SH", cmdtext, true, 10) == 0) { GivePlayerWeapon(playerid, 30, 320); GivePlayerWeapon(playerid, 29, 350); GivePlayerWeapon(playerid, 34, 10); SetPlayerSkin(playerid, 122); return 1; } return 0; } |
pawn Код:
//Above code, local
new
bool: CanUseSH[ MAX_PLAYERS char ]
;
//OnPlayerConnect
CanUseSH{ playerid } = false;
SetTimerEx("CanUseSHH", 300000, false, "i", playerid);
//Timer
forward CanUseSHH(playerid);
public CanUseSHH(playerid)
{
CanUseSH{ playerid } = true;
SendClientMessage(playerid, -1, "You can use /sh again!");
return 1;
}
//command:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/SH", cmdtext, true, 10) == 0)
{
if(!CanUseSH{ playerid } )
{
SendClientMessage(playerid, -1, "[ERROR] - You need to wait 5 minutes before using this command!");
}
else
{
GivePlayerWeapon(playerid, 30, 320);
GivePlayerWeapon(playerid, 29, 350);
GivePlayerWeapon(playerid, 34, 10);
SetPlayerSkin(playerid, 122);
}
return 1;
}
return 0;
}