30.11.2011, 21:45
Howdy Folks, I came here with a question about my Jail command that i am Completely Stumped about.
Here is the /jail Command.
Heres the Unjail part of the Timer.
Here is the /jail Command.
pawn Код:
CMD:jail(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >=5)
{
new id,reason[128],time,on[MAX_PLAYER_NAME],n[MAX_PLAYER_NAME],string[128];
if(sscanf(params,"uds[128]",id,time,reason)) return SendClientMessage(playerid,COLOR_RED,"Usage:/Jail [ID] [Time] [Reason]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "System: Invalid ID");
else
{
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
SetPlayerPos(id,227.69999694824,109,999.09997558594);
PlayerInfo[id][pJailTime] = time;
PlayerInfo[id][pJail] = 1;
SetPlayerInterior(id,10);
SetPlayerVirtualWorld(id, 2);
JailTime[id] = SetTimer("JailTime", time, false);
format(string, sizeof(string), "AdminCMD: %s has Jailed %s because: %s",n,on,reason);
SendClientMessageToAll(COLOR_ORANGE,string);
}
}
return 1;
}
pawn Код:
new JailTime[MAX_PLAYERS];
pawn Код:
forward Jailtime(playerid);
public Jailtime(playerid)
{
SetPlayerPos(playerid,1552.4500,-1674.9900,16.1953);
PlayerInfo[playerid][pJail] = 0;
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid,COLOR_RED,"You Were Released From Admin Jail");
return 1;
}