Admin Script help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin Script help (
/showthread.php?tid=246901)
Admin Script help -
jonnyboy - 06.04.2011
Heya!
Does someone know how to make a admin list?
because i got stuck on this line
pawn Код:
if(!strcmp(cmdtext, "/admins"))
{
if(playerinfo[playerid][AdminLevel] = 1);
return 1;
}
if someone can help me i would be very happy
Re: Admin Script help -
Biesmen - 06.04.2011
pawn Код:
if(!strcmp(cmdtext, "/admins"))
{
new string[128], playername[MAX_PLAYER_NAME], text[40];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerName(i, playername, sizeof(playername));
if(playerinfo[i][AdminLevel] == 1) { text = "Level 1" }
if(playerinfo[i][AdminLevel] == 2) { text = "Level 2" }
if(playerinfo[i][AdminLevel] == 3) { text = "Level 3" } // Etc. Add more if you have more levels.
}
format(string, sizeof(string), "%s: %s", text, playername);
SendClientMessage(playerid, 0xFFFFFF, string);
return 1;
}
Re: Admin Script help -
jonnyboy - 06.04.2011
Код:
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(234) : error 017: undefined symbol "playerinfo"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(234) : warning 215: expression has no effect
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(234) : error 001: expected token: ";", but found "]"
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(234) : error 029: invalid expression, assumed zero
D:\Rockstar Games\SAMP SERVER\gamemodes\gm.pwn(234) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
i tryed to compile it but i got 4 errors.
pawn Код:
if(!strcmp(cmdtext, "/admins"))
{
new string[128], playername[MAX_PLAYER_NAME], text[40];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerName(i, playername, sizeof(playername));
if(playerinfo[i][AdminLevel] == 1) { text = "Level 1" }
if(playerinfo[i][AdminLevel] == 2) { text = "Level 2" }
if(playerinfo[i][AdminLevel] == 3) { text = "Level 3" }
if(playerinfo[i][AdminLevel] == 4) { text = "Level 4" }
if(playerinfo[i][AdminLevel] == 5) { text = "Level 5" }
if(playerinfo[i][AdminLevel] == 6) { text = "Level 6" }
if(playerinfo[i][AdminLevel] == 7) { text = "Level 7" }
if(playerinfo[i][AdminLevel] == 8) { text = "Level 8" }
if(playerinfo[i][AdminLevel] == 9) { text = "Level 9" }
if(playerinfo[i][AdminLevel] == 10) { text = "Level 10" }
}
format(string, sizeof(string), "%s: %s", text, playername);
SendClientMessage(playerid, 0x00FF00FF, string);
return 1;
}
do i have to re-write the code?
Re: Admin Script help -
Biesmen - 06.04.2011
Try "PlayerInfo". I was using your code example to make this.