Whats wrong with this command?
#1

I cant see whats is messing this code. Can someone give me a hand here please?

Command:
pawn Код:
CMD:jail(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 4)
{
new targetid, minutes; //define the player's name and the minutes of jailing
if(sscanf(params, "ri", targetid, minutes)) return SendClientMessage(playerid, -1,"Usage: /jail <playerid> <minutes>"); //detects the wrong params and show the usage
if(minutes <= 0 || minutes > 60) return SendClientMessage(playerid, -1, "Minutes can't be less than 0 or more than 60!"); //we won't let a player suffer more than 1 hour, and not less than 1 minute
if(targetid == playerid) return SendClientMessage(playerid, -1, "You can't jail yourself!"); //comment this line out, if you wanna test this command on yourself!
else
{

new str; //create a new string
format(str, sizeof(str), "Administrator %s has jailed %s for %d minutes!", Name(playerid), Name(targetid), minutes); //get the admin's name, the player's and show the minutes
SendClientMessageToAll(-1,str); //let everybody know what you did, this will send the message to everyone
JailTimer[targetid] = SetTimer("Unjail", minutes*60*1000, false); //now HERE we're setting the jailtimer from the variable created, it will calculate the milliseconds to seconds, multiplicated with the amount of minutes we gave
SetPlayerPos(targetid, 264.4176, 77.8930, 1001.0391); //Sets the player's position to the jail in LS
SetPlayerInterior(targetid, 6); //this will set the player's interior to an jail-interior
inJail[targetid] = true; //now, here we'll check, if the player's in jail, we'll set the value to "true", means that he IS in jail
GameTextForPlayer(targetid, "~p~JAILED", 10000, 6); //this is for decorating and writing a big "JAILED" for the player
PlayerPlaySound(targetid,1057,0.0,0.0,0.0); //that's also a small sound, for decoration
}
}
else return SendClientMessage(playerid, -1, "You have to be level 4 to use this command!"); //if he isn't allowed to use this command, send him this message
return 1;
}
Errors:
Код:
.pwn(1925) : error 035: argument type mismatch (argument 1)
.pwn(1925) : error 035: argument type mismatch (argument 1)
.pwn(1925) : warning 215: expression has no effect
.pwn(1925) : error 001: expected token: ";", but found ")"
.pwn(1925) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 Copyright © 1997-2006, ITB CompuPhase

4 Errors.
Error Line:
Код:
format(str, sizeof(str), "Administrator %s has jailed %s for %d minutes!", Name(playerid), Name(targetid), minutes); //get the admin's name, the player's and show the minutes
*I didn't make this.
Reply


Messages In This Thread
Whats wrong with this command? - by iDuckling - 11.11.2013, 19:10
Re: Whats wrong with this command? - by Konstantinos - 11.11.2013, 19:12
Re: Whats wrong with this command? - by iDuckling - 11.11.2013, 19:28
Re: Whats wrong with this command? - by Konstantinos - 11.11.2013, 19:39
Re: Whats wrong with this command? - by Elie1996 - 11.11.2013, 19:43
Re: Whats wrong with this command? - by Evocator - 11.11.2013, 19:44
Re: Whats wrong with this command? - by Konstantinos - 11.11.2013, 20:01

Forum Jump:


Users browsing this thread: 1 Guest(s)