/jail not working correctly
#1

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
Reply
#2

This happened to me. Just redownloaded sscanf2, and recomplie ALL YOUR SCRIPTS.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)