Problem whit /jail
#1

Hi guys, well, I have this code /jail

pawn Код:
dcmd_jail(playerid, params[])
    {
        new
            pName[ MAX_PLAYER_NAME ];

        if ( IsPlayerAdmin( playerid ) || pData[ playerid ][ P_LEVEL ] >= _:P_LEVEL_MOD )
        {
            new targetid, minutes;
            if(sscanf(params, "ri", targetid, minutes)) return SendClientMessage(playerid, COLOR_RED,"USO: /jail [id] [minutos]");
            if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, COLOR_RED, "Minutos validos: {FFFFFF}3, 4, 5");
            if(targetid == playerid) return SendClientMessage(playerid, COLOR_RED, "ERROR: No te puedes encarcelar a ti mismo.");
            else
            {
                new str[128];
                format(str, sizeof(str), ">> %s ha sido encarcelado %d minutos", pName, minutes);
                SendClientMessageToAll(COLOR_ORANGE,str);
                JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false);
                SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391);
                SetPlayerInterior(playerid, 6);
                inJail[targetid] = true;
                GameTextForPlayer(playerid, "~p~HAS SIDO ENCARCELADO", 10000, 6);
                PlayerPlaySound(targetid,1057,0.0,0.0,0.0);
            }
        }
        return 1;
}

But when I put: example "/jail 4 5" ... I get the message saying that the number of minutes is invalid, but I'm putting the right amount. could tell me what is the problem?


Translated by: ******.
The original text it's on spanish.
Reply
#2

according to the code, you only punish Allows May for 3 to 4 minutes
check here
Quote:

if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, COLOR_RED, "Minutos validos: {FFFFFF}3, 4, 5");

Greetings.
Reply
#3

Toolkit, pudiste escribir en espaсol... bueno, ya se lo que es obvio, se supone que el comando debe aceptar minutos iguial o mayores a 3 o igual o menores a 5. entonces no se que pasa. en el codigo sale 0 - 60 pero en el gm esta 3 - 5

well, it is obvious, it is assumed that the command should accept iguial to 3 minutes or greater or equal to or less than 5 then it does not happen. in the code goes 0-60 gm but in this 3-5
Reply
#4

Wrong section you might get help if you post this in scripting help section.
Reply
#5

Sorry ._.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)