[HELP]Jail CMD - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Jail CMD (
/showthread.php?tid=450482)
[HELP]Jail CMD -
Philip01 - 13.07.2013
Right here is the Jail cmd and now would be asking me who agree that when an administrator posts / jail [playerid] [reason] that then the player who is in prison, that it had only 5 minutes!
Код:
dcmd_jail(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new tmp[256], idx;
tmp = strtok(params,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GREY,"|| Usage: /jail (playerid) (reason) ||");
SendClientMessage(playerid,COLOR_GREY,"|| Function: Jails the given player until unjail ||");
return true;
}
new pid = strval(tmp);
if(!IsPlayerConnected(pid))
{
SendClientMessage(playerid,COLOR_GREY,"[!] Incorrect ID.");
return true;
}
tmp = strrest(params,idx);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME], string[256];
GetPlayerName(pid, pname, sizeof(pname));
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string, sizeof(string), "|| Administrator %s jailed %s. Reason: %s ||", pname2, pname, tmp);
SendClientMessageToAll(COLOR_RED, string);
SetPlayerInterior(pid, 6);
SetPlayerPos(pid,264.6288,77.5742,1001.0391);
ResetPlayerWeapons(pid);
Jailed[playerid] = 1;
return true;
}
else return SendClientMessage(playerid, COLOR_RED, "[!] You are not logged into RCON.");
}
Re: [HELP]Jail CMD -
Philip01 - 13.07.2013
HELP HELP pls.
Respuesta: [HELP]Jail CMD -
PHudson - 13.07.2013
I don't understand your explanation at all. Do you want the player to be kept in prison until someone uses /unjail but the player is released automatically after 5 minutes?
Check for a timer being set somewhere in your script. I can't see any timers in that command, so it must be somewhere else. If you know the callback that releases players from jails, check when is it called.
Re: [HELP]Jail CMD -
Philip01 - 13.07.2013
player is released automatically after 5 minutes
Respuesta: [HELP]Jail CMD -
PHudson - 13.07.2013
Alright, so check what I told you before. I'm pretty sure everything is correct in the command.
Re: [HELP]Jail CMD -
Philip01 - 13.07.2013
I want to take some harmony to the player released automatically after 5 minutes
Re: [HELP]Jail CMD -
Philip01 - 14.07.2013
can I ask you who do you cast an admin to jail to automatically come out of him!