/jail not working correctly - 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: /jail not working correctly (
/showthread.php?tid=372733)
/jail not working correctly -
[p3]pr0t0typ3 - 28.08.2012
Ok so...
Code:
CMD:jail(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new ID;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_GREY, "[pr0adm]USAGE: /jail [playerid]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, COLOR_GREY, "[pr0adm]Player is not connected!");
if(playerid == ID) return SendClientMessage(playerid, COLOR_GREY, "[pr0adm]You can't jail yourself!");
else
{
SetPlayerInterior(ID,10);
SetPlayerPos(ID,227.14,111.26,999.02);//jail coords
TogglePlayerControllable(ID,0);//Makes the player unable to move,easily evadeable with airbreak
PlayerInfo[ID][pJailed] = 1;
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "[pr0adm]%s has jailed %s.", pName, ID);
return SendClientMessageToAll(COLOR_RED, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[pr0adm]You must be level 2 pr0admin to use this command!");
}
return 1;
}
Isnt working correctly,yes it does teleport player but it jails id 0,even if i type /jail 3 it still jails only id 0,me and my friend looked through it and couldnt find the flaw o.O so i thought maybe the samp community could help
Respuesta: /jail not working correctly -
HydraX - 28.08.2012
This happened to me. Just redownloaded sscanf2, and recomplie ALL YOUR SCRIPTS.