17.02.2012, 08:32
Hey all!
I've made this jail-cmd, so when the timer passed, the player should spawn normally again:
and:
But, when I jail myself 1 minute, after one minute, I do spawn, but around me isn't everything normal, that means, everything's grey around me!:O Look at the picture I've attached!
I've made this jail-cmd, so when the timer passed, the player should spawn normally again:
PHP код:
CMD:jail(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new targetid, minutes, reason[64];
if(sscanf(params, "riS(No Reason)[64]", targetid, minutes, reason))
if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, COLOR_RED, "Minutes can't be less than 0 or more than 60!");
//if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "You can't jail yourself!");
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_RED, "You can't jail higher level admins!");
else
{
new str[128];
format(str, sizeof(str), "Administrator %s has jailed %s(%d) for %d minutes! Reason: %s", Name(playerid), Name(targetid), minutes, reason);
JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false);
SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391);
SetPlayerInterior(playerid, 6);
inJail[targetid] = true;
}
}
else return SendClientMessage(playerid, COLOR_RED, "You have to be level 4 to use this command!");
return 1;
}
PHP код:
forward Unjail(playerid);
public Unjail(playerid)
{
SpawnPlayer(playerid);
inJail[playerid] = false;
KillTimer(JailTimer[playerid]);
}