PDA

View Full Version : Problem whit /jail


FlavioCesar
13/08/2014, 11:43 PM
Hi guys, well, I have this code /jail

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.

Toolkit
13/08/2014, 11:59 PM
according to the code, you only punish Allows May for 3 to 4 minutes
check here if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, COLOR_RED, "Minutos validos: {FFFFFF}3, 4, 5");

Greetings.

FlavioCesar
14/08/2014, 12:36 AM
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

1FreeHost
14/08/2014, 10:01 AM
Wrong section you might get help if you post this in scripting help section.

FlavioCesar
14/08/2014, 05:07 PM
Sorry ._.