13.08.2014, 23:43
Hi guys, well, I have this code /jail
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.
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.