Some Commands doesnt show player's name
#1

Solved
Reply
#2

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

Solved
Reply
#4

Show PlayerName(playerid) function...
Reply
#5

Solved
Reply
#6

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

Solved
Reply
#8

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.
Reply
#9

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

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)