Help with errors
#1

Xi guys i have errors for two commands.. Here are the errors:

Код:
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1228) : error 029: invalid expression, assumed zero
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1228) : warning 215: expression has no effect
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1228) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1289) : warning 202: number of arguments does not match definition
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1289) : warning 202: number of arguments does not match definition
C:\Documents and Settings\^Taco_Khalifa^\Desktop\server samp\gamemodes\testserver.pwn(1289) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Line 1228:

Код:
else if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, COLOR, #RED"Usage: /kick [id/name][reason]");
Line 1289:

Код:
format(string, sizeof(string), #GREEN"You have set %s's health to %d.", GetPlayerName(playa), (health);
And the commands:

Код:
CMD:kick(playerid, params[])
{
	new id, reason[128];
	if(PlayerInfo[playerid][pAdmin] >= 4)
	else if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, COLOR, #RED"Usage: /kick [id/name][reason]");
	if(PlayerInfo[playerid][pAdmin] >= 4) return SendClientMessage(playerid, COLOR, #RED"[Warning]:You are not an Admin level 4!");
	else if(id==playerid)SendClientMessage(playerid, COLOR, #RED"Error: You can not kick yourself!");
    else if(id==IsPlayerAdmin(id))SendClientMessage(playerid, COLOR, #RED"Error: You can not kick another admin!");
    else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid, COLOR, #RED"Error: Player is not connected!");
    else
	{
        new Name[MAX_PLAYER_NAME], KickMessage[128];
        new Name2[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof(Name));
        GetPlayerName(id, Name2, sizeof(Name2));
        format(KickMessage, sizeof(KickMessage), "%s(%d) has kicked player %s(%d). Reason: %s", Name, playerid, Name2, id);
        SendClientMessageToAll(COLOR_RED, KickMessage);
        Kick(id);
    }
    return 1;
}
Код:
CMD:sethp(playerid, params[])
{
    new string[128], playa, health;
    if(sscanf(params, "ud", playa, health))
	{
        SendClientMessage(playerid, COLOR, #RED"USAGE: /sethp [playerid] [health]");
        return 1;
    }
    if (PlayerInfo[playerid][pAdmin] >= 4)
	{
        if(IsPlayerConnected(playa))
		{
           if(playa != INVALID_PLAYER_ID)
 	       {
               SetPlayerHealth(playa, health);
               format(string, sizeof(string), #GREEN"You have set %s's health to %d.", GetPlayerName(playa), (health);
               SendClientMessage(playerid, COLOR, string);
           }
        }
        else SendClientMessage(playerid, COLOR, #RED"Invalid player specified.");
    }
    else
	{
        SendClientMessage(playerid, COLOR, #RED"You are not authorized to use that command!");
    }
    return 1;
}
Reply


Messages In This Thread
Help with errors - by IvancheBG - 17.05.2012, 07:02
Re: Help with errors - by iRage - 17.05.2012, 07:29
Re: Help with errors - by IvancheBG - 17.05.2012, 07:39
Re: Help with errors - by iRage - 17.05.2012, 07:42
Re: Help with errors - by IvancheBG - 17.05.2012, 07:57
Re: Help with errors - by MichaelProPlayer - 17.05.2012, 08:30
Re: Help with errors - by Kitten - 17.05.2012, 08:33
Re: Help with errors - by IvancheBG - 17.05.2012, 15:59
Re: Help with errors - by IvancheBG - 17.05.2012, 16:38

Forum Jump:


Users browsing this thread: 1 Guest(s)