05.04.2011, 00:51
I have made 2 jail commands witch seams not want work
First one, this do nothing but crash the server
This one does not crash the server, but do nothing
Cant understand why they don't work.
First one, this do nothing but crash the server
pawn Код:
*COMMAND:jail(playerid, params[])
{
new id;
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [id] Reason.");
GetPlayerName(playerid, Name, sizeof(Name));
if(PlayerInfo[playerid][Admin] >= 1)
{
format(String, sizeof(String), "%s jailed you, Reason %s .",Name);
SendClientMessage(id,0xFF0000FF, String);
SetPlayerColor(id,COLOR_RED);
SetPlayerPos(id, 412.99816894531,2543.0656738281,26.244613647461);
SetPlayerHealth(id, 99999999999999999999999);
SetPlayerSkin(id, 62);
format(String, sizeof(String), "You have jailed %s, Reason %s",Name);
SendClientMessage(playerid,0xFF0000FF, String);
TogglePlayerControllable(id,true);
}
return 1;
}
pawn Код:
COMMAND:jail(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [id]");
//if(Jail[id] == 1) return SendClientMessage(playerid,red,"This user is already in jail!");
if(PlayerInfo[playerid][Admin] >= 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "%s has jailed you",Name);
SendClientMessage(id,green, String);
//Jail[id] = 1;
SetPlayerSkin(id, 62);
SetPlayerPos(id, 412.99816894531,2543.0656738281,26.244613647461);
SetPlayerColor(id,COLOR_GREEN);
format(String, sizeof(String), "You have jailed %s",Name);
SendClientMessage(playerid,green, String);
}
return 1;
}