17.05.2012, 07:02
Xi guys i have errors for two commands.. Here are the errors:
Line 1228:
Line 1289:
And the commands:
Код:
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.
Код:
else if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, COLOR, #RED"Usage: /kick [id/name][reason]");
Код:
format(string, sizeof(string), #GREEN"You have set %s's health to %d.", GetPlayerName(playa), (health);
Код:
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; }