SA-MP Forums Archive
/admins PlayerName Doesnt show - 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)
+--- Thread: /admins PlayerName Doesnt show (/showthread.php?tid=432174)



/admins PlayerName Doesnt show - AmsterdamCopsAndRobbers - 21.04.2013

Код:
YCMD:admins(playerid, params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;

    SendClientMessage(playerid, 0x1FFFFFF, "Administrators online:");
    foreach(Player, i)
    {
        new level[128], string[128];

        if(PlayerInfo[i][Admin] > 0)
        {
            switch(PlayerInfo[i][Admin])
            {
                case 1: level = ""adminlevel1" (1)";
                case 2: level = ""adminlevel2" (2)";
                case 3: level = ""adminlevel3" (3)";
                case 4: level = ""adminlevel4" (4)";
                case 5: level = ""adminlevel5" (5)";
            }
            format(string, sizeof(string), "%s %s", level, PlayerName(i));
            SendClientMessage(playerid, 0xFFF84FFFF, string);
        }
    }
    return 1;
}
Its says PlayerName not defined how i will gonna define it
#define PlayerName with codes to it?


Re: /admins PlayerName Doesnt show - Jstylezzz - 21.04.2013

pawn Код:
stock PlayerName(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    return pName;
}
Place this in your script, outside any callback. The best thing is, at the total bottom of your script, outside any { } braces.