#1

I have made 2 jail commands witch seams not want 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;
}
This one does not crash the server, but do nothing
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;
}
Cant understand why they don't work.
Reply


Messages In This Thread
jail - by cruising - 05.04.2011, 00:51
Re: jail - by Calgon - 05.04.2011, 03:46
Re: jail - by cruising - 05.04.2011, 04:40
Re: jail - by Gamer_Z - 05.04.2011, 09:27

Forum Jump:


Users browsing this thread: 1 Guest(s)