CMD:setadmin(playerid,params[]) { new id,level; if(IsPlayerAdmin(playerid)) { if(sscanf(params,"ud",id,level) return SendClientMessage(playerid, COL_RED, "Usage: /setadmin [id] [level] "); else { if(level > 5) return SendClientMessage(playerid, COL_RED, "Usage: /setadmin id 1-5"); else { new INI:File = INI_Open(UserPath(id)); INI_WriteInt(File,"Admin",level); INI_Close(File); } } } else { SendClientMessage(playerid, COL_RED, "That id is not connected"); } }
C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(330) : error 001: expected token: ")", but found "return" C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(330) : error 035: argument type mismatch (argument 2) C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(333) : error 035: argument type mismatch (argument 2) C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(344) : error 035: argument type mismatch (argument 2) C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(346) : warning 209: function "cmd_setadmin" should return a value Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
if(sscanf(params,"ud",id,level)) return // blabla..
CMD:setadmin(playerid,params[]) { new id,level; if(IsPlayerAdmin(playerid)) { if(sscanf(params,"ud",id,level)) { return SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash <playerid/name> <amount>"); } else { if(level > 5)) return test(playerid); } else { new INI:File = INI_Open(UserPath(id)); INI_WriteInt(File,"Admin",level); INI_Close(File); } } } else { SendClientMessage(playerid, COL_RED, "That id is not connected"); } }
if(level > 5)) return test(playerid);
pawn Код:
|
CMD:setadmin(playerid,params[]) { new id,level; if(IsPlayerAdmin(playerid)) { if(sscanf(params,"ud",id,level)) { return SendClientMessage(playerid, 0xFF0000AA, "Usage: /givecash <playerid/name> <amount>"); } else { if(level > 5) return error } else { new INI:File = INI_Open(UserPath(id)); INI_WriteInt(File,"Admin",level); INI_Close(File); } } } else { SendClientMessage(playerid, COL_RED, "That id is not connected"); } }
C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(337) : error 017: undefined symbol "error" C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(339) : warning 217: loose indentation C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(339) : error 029: invalid expression, assumed zero C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(346) : warning 209: function "cmd_setadmin" should return a value C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(347) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
CMD:setadmin(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
new id,level;
if(sscanf(params,"ud",id,level)) return SendClientMessage(playerid, COL_RED, "Usage: /setadmin [id] [level] ");
if(level > 5) return SendClientMessage(playerid, COL_RED, "Usage: /setadmin id 1-5");
new INI:File = INI_Open(UserPath(id));
INI_WriteInt(File,"Admin",level);
INI_Close(File);
}
else SendClientMessage(playerid, COL_RED, "That id is not connected");
return 1;
}
pawn Код:
|
C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(331) : error 035: argument type mismatch (argument 2) C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(334) : error 035: argument type mismatch (argument 2) C:\Users\score_000\Desktop\Server\gamemodes\Unoffical.pwn(345) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.