#2

Your code hardly makes any sense. I'll point out the critical flaws for you to understand:

pawn Код:
COMMAND:jail(playerid, params[])
{
    new id; // <-- You're declaring the variable, which by default is 0
    if(IsPlayerConnected(id)) // <-- You're checking if ID 0 is connected, no matter what!
    if(sscanf(params,"u", id))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /jail [id]"); // <-- Now you're getting the ID after it's too late...
    //if(Jail[id] == 1) return SendClientMessage(playerid,red,"This user is already in jail!");
    if(PlayerInfo[playerid][Admin] >= 1) // <-- This part is fine
    {
        GetPlayerName(playerid, Name, sizeof(Name)); // <-- Where did you declare 'Name'?
        format(String, sizeof(String), "%s has jailed you",Name); // <-- Where did you declare 'String'?
        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;
}
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)