28.08.2012, 00:18
Ok so...
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
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;
}

