CMD error
#1

Код:
CMD:jail(playerid,params[])
{
	if(!IsPlayerAdmin(playerid)) return 0;

	new id,time,reason[100];
	if(strval(params,"udS(No Reason)[100]",id,time,reason)) SendClientMessage(playerid, lb, "USAGE: /jail <playerid / Part of Name> <time> <reason>");// this is sscanf routine , d=integer and s= string
	else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) SendClientMessage(playerid, red, "ERROR: Player is not connected.");// now we are checking if the targetid is online ! = not and id= targetid and if the id isnt on will send the message etc
	else if(JailTimer[id] > -1) SendClientMessage(playerid, red, "ERROR: Player is already jailed.");// 1 jailed 0 is not jailed
	else{
		new szPlayerName[MAX_PLAYER_NAME + 1];
		GetPlayerName(id, szPlayerName, MAX_PLAYER_NAME);// the jailed person id
		SetPlayerInterior(id, 3);//sets player interior
		SetPlayerVirtualWorld(id, 10);//sets player vw
		SetPlayerPos(id, 197.5662, 175.4800, 1004.0);//player pos
		SetPlayerFacingAngle(id, 360.0);//player angle
		SetPlayerHealth(id, 9999999999.0);//player cannot be killed
		ResetPlayerWeapons(id);//resets his weapons
		JailTimer[id] = SetTimerEx("Unjail", time*60000, false, "i", id);//jail timer
		format(szString, sizeof(szString), "AdmSys-: %s (ID:%d) has been jailed for %d minutes. Reason: %s", PlayerName, id, time, reason);
		SendClientMessageToAll(color, szString);//%s = name . %d = number
	}
	return 1;
}

CMD:unjail(playerid,params[])
{
	if(!IsPlayerAdmin(playerid)) return 0;
	new id;
	if(sscanf(params,"u",id)) SendClientMessage(playerid, lb, "USAGE: /unjail <playerid / Part of Name>"); //sscanf routine
	else if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) SendClientMessage(playerid, red, "ERROR: Player is not connected."); //checks if the targetid is connected
	else if(JailTimer[id] < 0) SendClientMessage(playerid, red, "ERROR: Player is not jailed."); //checks if the id is jailed and if he isnt it will send an error.
	else{
		KillTimer(JailTimer[id]);//kills the timer
		JailTimer[id] = -1;
		SetPlayerInterior(id, 0);//normal int
		SetPlayerVirtualWorld(id, 0);//normal vw
		SetPlayerHealth(id, 100);//sets his health back as 100
		SpawnPlayer(id);//respawns player
    }
    return 1;
}
errors
Код:
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(266) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(267) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(268) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(466) : warning 204: symbol is assigned a value that is never used: "string"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(534) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(534) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(534) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(534) : warning 202: number of arguments does not match definition
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(534) : error 017: undefined symbol "lb"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(535) : error 017: undefined symbol "red"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(536) : error 017: undefined symbol "JailTimer"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(536) : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(536) : error 001: expected token: ";", but found "]"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(536) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\gamemodes\BARP.pwn(536) : fatal error 107: too many error messages on one line
help guys only help with errors
Reply
#2

Код:
new JailTimer[MAX_PLAYERS], lb, red;
And show other warning and the lines
Reply


Forum Jump:


Users browsing this thread: