29.02.2016, 14:37
Код:
CMD:jetpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, "error!"); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK); return 1; }
CMD:jetpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, "error!"); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK); return 1; }
CMD:jetpack(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid, -1, "error!");
if(GetTickCount() - GetPVarInt(playerid, "LastJetpackCMD") < 100000) return SCM(playerid, -1, "Error, you can only use this command every 10 minutes.");
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
SetPVarInt(playerid, "LastJetpackCMD", GetTickCount());
return 1;
}
Try this:
PHP код:
|
You use settimerex https://sampwiki.blast.hk/wiki/SetTimerEx
|
Try this:
PHP код:
|
new LastJetpackCMD[MAX_PLAYERS];
CMD:jetpack(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1)
return SCM(playerid, -1, "error!");
if(GetTickCount() - LastJetpackCMD[playerid] < 600000)
return SCM(playerid, -1, "Error, you can only use this command every 10 minutes.");
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
LastJetpackCMD[playerid] = GetTickCount();
return 1;
}