30.11.2013, 20:27
My code:
My errors:
Код:
CMD:setlevel(playerid, params[]) { new giveid, level; PlayerInfo[giveid][pAdmin] = level; if(PlayerInfo[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)); { SendClientMessage(playerid, COL_RED, "ERROR: You don't have access to this command."); } else if(sscanf(params, "ri", giveid, level)); { SendClientMessage(playerid, COL_RED, "SYNTAX: /setlevel <name/id> <level>"); } else if(!PlayerInfo[playerid][LoggedIn] == 1 || giveid == INVALID_PLAYER_ID); { SendClientMessage(playerid, COL_RED, "ERROR: That player isn't online or isn't logged in!"); } else if(level > 5 || level < 0); { SendClientMessage(playerid, COL_RED, "ERROR: The level must be between 0 and 5."); } else { new name[24],level[128],level1[128],pname[24]; GetPlayerName(giveid, name, sizeof(name)); GetPlayerName(playerid, pname, sizeof(pname)); format(str,sizeof(str),"You have been set to level %d by %s!",level,name); SendClientMessage(giveid,COL_GREEN,level); format(level1,sizeof(level1),"You have successfully set %s to level %d!",pname,level); SendClientMessage(playerid,COL_GREEN,level1); } return 1; }
Код:
C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(367) : error 036: empty statement C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(369) : error 035: argument type mismatch (argument 2) C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(371) : error 029: invalid expression, assumed zero C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(371) : warning 215: expression has no effect C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(371) : error 001: expected token: ";", but found "if" C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(371) : error 036: empty statement C:\Users\Lauris.Lauris-PC\Desktop\Samp\samp03x_svr_R2_win32\Admin.pwn(371) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.