SA-MP Forums Archive
Some Commands doesnt show player's name - 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: Some Commands doesnt show player's name (/showthread.php?tid=616654)



Some Commands doesnt show player's name - ThatFag - 08.09.2016

Solved


Re: Some Commands doesnt show player's name - F1N4L - 08.09.2016

Really?
Код:
PlayerName(playerid)
Change to
Код:
PlayerName(i)



Re: Some Commands doesnt show player's name - ThatFag - 08.09.2016

Solved


Re: Some Commands doesnt show player's name - F1N4L - 08.09.2016

Show PlayerName(playerid) function...


Re: Some Commands doesnt show player's name - ThatFag - 08.09.2016

Solved


Re: Some Commands doesnt show player's name - thefirestate - 08.09.2016

Why don't you use foreach or GetPlayerPoolSize? Also, can we see SendClientMSG and AdminLevelName?


Re: Some Commands doesnt show player's name - ThatFag - 08.09.2016

Solved


Re: Some Commands doesnt show player's name - thefirestate - 08.09.2016

Can you try this command: http://pastebin.com/1Ax94UNg
And tell me the results.

Edit: Also, considering the way your functions are done, you might want to read this: https://sampforum.blast.hk/showthread.php?tid=570635 just in case.


Re: Some Commands doesnt show player's name - ThatFag - 08.09.2016

The Problem coming from SendClientMSG - cuz if i use sendclinetmessage it works okay
someone can fix that pls ?


Re: Some Commands doesnt show player's name - Threshold - 08.09.2016

I dunno about ya'll, but I'd do it like this:
PHP код:
COMMAND:admins(playerid)
{
    new 
Staff[MAX_PLAYERS][2], admincount 0helpercount 0;
    for(new 
0GetPlayerPoolSize(); <= ji++)
    {
        if(!
IsPlayerConnected(i) || !PlayerTemp[i][loggedIn] || PlayerInfo[i][power] == 31337) continue;
        if(
PlayerInfo[i][power] > 0Staff[admincount++][0] = i;
        else if(
PlayerInfo[i][helper] > 0Staff[helpercount++][1] = i;
    }
    
SendClientMessage(playerid0x3776CCFF"[Server Staff] {ABCBF5}Administrators:");
    for(new 
0fstr[80]; admincounti++)
    {
        
format(fstrsizeof(fstr), "%s %s (ID: %d) %s %s",
            
AdminLevelName(Staff[i][0]), PlayerName(Staff[i][0]), Staff[i][0], (PlayerTemp[Staff[i][0]][adminduty] == 1) ? ("{1A661A}ON-DUTY") : (""), (IsPlayerAFK(Staff[i][0])) ? ("AFK") : (""));
        
SendClientMessage(playerid0xE1E3E6FFfstr);
    }
    
SendClientMessage(playerid0x3776CCFF"[Server Staff] {ABCBF5}Helpers:");
    for(new 
0fstr[60]; helpercounti++)
    {
        
format(fstrsizeof(fstr), "  %s (ID: %d) %s %s",
            
RPName(Staff[i][1]), Staff[i][1], (PlayerTemp[Staff[i][1]][helperduty] == 1) ? ("{1A661A}ON-DUTY") : (""), (IsPlayerAFK(Staff[i][1])) ? ("AFK") : (""));
        
SendClientMessage(playerid0xE1E3E6FFfstr);
    }
    return 
1;