[Tutorial] How to make Admin Chat
#2

Copy paste rather than tutorial

pawn Код:
stock MessageToAdmins(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) == 1) if(pInfo[i][Adminlevel] >= 1) SendClientMessage(i, color, string);//if player is connected and he's admin level higher then 1 he will get this message
    return 1;
}
Nobody can even see the explanation, the explanation is at the end
Also, you used pInfo[pid][Adminlevel]
This is a custom variable, what if I have PlayerInfo instead of pInfo?

A more suitable explanation would be

pawn Код:
stock MessageToAdmins(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++) // Loops through all players
    {
          if(IsPlayerConnected(i) == 1) // Checks if the player is connected
          {
                if(IsPlayerAdmin(playerid)) SendClientMessage(i, color, string);//if player is connected and he's admin level higher then 1 he will get this message
          }
    }
    return 1;
}
Same for second part, you haven't even explained.
And that code wouldn't even compile
You used SendMessageToAdmins in the second code while your original stock is MessageToAdmins
You also didn't define LIGHTBLUE color
And you didn't explain why we use text[1] and not just text.

Incomplete tutorial.
Reply


Messages In This Thread
How to make Admin Chat - by RuthlessThuG - 19.02.2013, 15:22
Re: How to make Admin Chat - by CreativityLacker - 19.02.2013, 16:01
Re: How to make Admin Chat - by RuthlessThuG - 19.02.2013, 16:16
Re: How to make Admin Chat - by CreativityLacker - 19.02.2013, 16:43
Re: How to make Admin Chat - by RuthlessThuG - 19.02.2013, 17:32

Forum Jump:


Users browsing this thread: 3 Guest(s)