"i" error
#1

hi guys i need to fix my error would be nice if i get it fixed

Line:
Код:
format(string, sizeof(string), "%s %s", level, GetPlayerName(i));
error:
Код:
error 017: undefined symbol "i"
Thanks!
Reply
#2

Try
pawn Код:
format(string, sizeof(string), "%s %s", level, GetPlayerName(pName));
Reply
#3

SHow us the loop code.

EDIT:
GetPlayerName has 3 arguments,
playerid
str
sizeof str
so it should be
new str[32];
GetPlayerName(playerid, str, sizeof str);
Reply
#4

Код:
new pName[24];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s %s", level, pName);
GetPlayerName returns the length of the name, not the name itself.
https://sampwiki.blast.hk/wiki/GetPlayerName
Reply
#5

EDIT: Too late.
Reply
#6

i got it working but.... now im admin in there im sure of it as i can use my admin cmds but it dosent show the online administartion...

SS:http://imgur.com/a/BhXFX

Code:
Код:
    if(strcmp(cmdtext, "/admins", true) == 0)
	{
    
    SendClientMessage(playerid, 0x1FFFFFF, "Administrators online:");
    {
        new level[128], string[128];

        if(PlayerInfo[playerid][pAdminLevel] >= 0)
        {
            switch(PlayerInfo[playerid][pAdminLevel])
            {
            case 1: level = ""adminlevel1" (1)";
            case 2: level = ""adminlevel2" (2)";
            case 3: level = ""adminlevel3" (3)";
            case 4: level = ""adminlevel4" (4)";
            case 5: level = ""adminlevel1338" (1338)";
            case 6: level = ""adminlevel1999" (1999)";
            case 7: level = ""adminlevel2000" (2000)";
            case 8: level = ""adminlevel2013" (2013)";
            case 9: level = ""adminlevel2014" (2014)";
            }
            format(string, sizeof(string), "%s", level, GetPlayerName(pName) );
            SendClientMessage(playerid, 0xFFF84FFFF, string);
        }
    }
    return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)