07.04.2011, 20:36
Im getting tired of try over and over again, i need some one to look at this cmd and help me to fix it before i rips off me my hair!
The thing is that when someone dies, that has not been jailed, he spawns in the jail and not in his proper place, cant figure out why :S maybe the whole code is scripted total wrong, i don't know.
And the jailer gets "you have jailed "urself"" and not the players name, the jailed one gets the right message.
And i can only jail ID 0 and 1, if i jail ID 2 nothing happens and no message appears, if i try ID 3 who is not online, you got a message who tells "SERVER: Unknown command" as it should do!
Im stranded and making a distress call, and hoping some one will help me finish this problem once for all.
The thing is that when someone dies, that has not been jailed, he spawns in the jail and not in his proper place, cant figure out why :S maybe the whole code is scripted total wrong, i don't know.
And the jailer gets "you have jailed "urself"" and not the players name, the jailed one gets the right message.
And i can only jail ID 0 and 1, if i jail ID 2 nothing happens and no message appears, if i try ID 3 who is not online, you got a message who tells "SERVER: Unknown command" as it should do!
Im stranded and making a distress call, and hoping some one will help me finish this problem once for all.
pawn Код:
COMMAND:jail(playerid, params[])
{
new id;
if(PlayerInfo[playerid][Admin] == 0)return SendClientMessage(playerid, 0xFF0000FF, "Only admin 1 can use this command!!");
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0x33CCFFAA, "Usage: /jail [id]");
if(IsPlayerConnected(id))
if(Jail[id] == 1) return SendClientMessage(playerid,red,"That Player is already in jail!");
if(PlayerInfo[id][Admin] >= 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has jailed you",Name);
SendClientMessage(id,green, String);
Jail[id] = 1;
ResetPlayerWeapons(id);
SetPlayerPos(id, 412.99816894531,2543.0656738281,26.244613647461);
format(String, sizeof(String), "You have jailed %s",Name);
SendClientMessage(playerid,green, String);
}
return 1;
}