cmd(admins, playerid, params[]) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_ADMIN, "Online Staff Members:"); new count; new ID; new admtext[64]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new sendername[MAX_PLAYER_NAME]; switch(Player_LoadInt("AdminLevel"); case 1: format(admtext, 64, "{10F441}Beta Tester"); case 2: format(admtext, 64, "{10F441}Moderator"); case 3: format(admtext, 64, "{33AA33}Administrator"); case 4: format(admtext, 64, "{FF0000}Senior Administrator"); case 1337: format(admtext, 64, "{FF0000}Head Administrator"); default: continue; } GetPlayerName(i, sendername, sizeof(sendername)); new tstr[128]; format(tstr, 128, "%s(%d) - %s", sendername, ID, admtext); SendClientMessage(playerid, -1, tstr); format(admtext, 64, ""); count++; } if(count == 0) { SendClientMessage(playerid, COLOR_ERROR, "No online administrators found."); return 1; } } } return 1; }
C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(363) : error 017: undefined symbol "Player_LoadInt" C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(363) : error 001: expected token: ")", but found ";" C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(364) : error 014: invalid statement; not in switch C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(364) : warning 215: expression has no effect C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(364) : error 001: expected token: ";", but found ":" C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(364) : error 029: invalid expression, assumed zero C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(364) : fatal error 107: too many error messages on one line
cmd(admins playerid, params[]) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_ADMIN, "Online Staff Members:"); new count; new ID; new admtext[64]; for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new sendername[MAX_PLAYER_NAME]; switch(PlayerInfo[i][pAdminLevel]) case 1: format(admtext, 64, "{10F441}Beta Tester"); case 2: format(admtext, 64, "{10F441}Moderator"); case 3: format(admtext, 64, "{33AA33}Administrator"); case 4: format(admtext, 64, "{FF0000}Senior Administrator"); case 1337: format(admtext, 64, "{FF0000}Head Administrator"); default: continue; } GetPlayerName(i, sendername, sizeof(sendername)); new tstr[128]; format(tstr, 128, "%s(%d) - %s", sendername, ID, admtext); SendClientMessage(playerid, -1, tstr); format(admtext, 64, ""); count++; } if(count == 0) { SendClientMessage(playerid, COLOR_ERROR, "No online administrators found."); return 1; } } } return 1; }
C:\Users\Tom\Desktop\SAMP Server\gamemodes\newgm.pwn(373) : error 001: expected token: "{", but found "case" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
if(IsPlayerConnected(i)) { new sendername[MAX_PLAYER_NAME]; switch(PlayerInfo[i][pAdminLevel]) case 1: format(admtext, 64, "{10F441}Beta Tester"); case 2: format(admtext, 64, "{10F441}Moderator"); case 3: format(admtext, 64, "{33AA33}Administrator"); case 4: format(admtext, 64, "{FF0000}Senior Administrator"); case 1337: format(admtext, 64, "{FF0000}Head Administrator"); default: continue; }
if(IsPlayerConnected(i))
{
new sendername[MAX_PLAYER_NAME];
switch(PlayerInfo[i][pAdminLevel])
{ //Just add this.
case 1: format(admtext, 64, "{10F441}Beta Tester");
case 2: format(admtext, 64, "{10F441}Moderator");
case 3: format(admtext, 64, "{33AA33}Administrator");
case 4: format(admtext, 64, "{FF0000}Senior Administrator");
case 1337: format(admtext, 64, "{FF0000}Head Administrator");
default: continue;
}
You forgot a bracket at the beginning of the switch statement.
pawn Код:
|
cmd(admins playerid, params[]) { SendClientMessage(playerid, COLOR_ADMIN, "Online Staff Members:"); new count, string[62], aname[24]; for(new i = 0; i < MAX_PLAYERS; i++) { if(!IsPlayerConnected(i)) continue; string[0] = EOS; switch(PlayerInfo[i][pAdminLevel]) { case 1: strcat(string, "{10F441}Beta Tester"); case 2: strcat(string, "{10F441}Moderator"); case 3: strcat(string, "{33AA33}Administrator"); case 4: strcat(string, "{FF0000}Senior Administrator"); case 1337: strcat(string, "{FF0000}Head Administrator"); default: continue; } GetPlayerName(i, aname, 24); format(string, sizeof (string), "%s(%d) - %s", aname, i, string); SendClientMessage(playerid, -1, string); count++; } if(count == 0) return SendClientMessage(playerid, COLOR_ERROR, "No online administrators found."); return 1; }
This should work.
- Snip If it doesn't, then there's probably something wrong with PlayerInfo[i][pAdminLevel]. |