MessageToAdmins and VIP bug
#6

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <foreach>

#define COLOR_GREEN 0xFFFFFFF

enum something
{
    pAdmin,
    VIP
};

new P_Data[MAX_PLAYERS][something];

public OnPlayerText(playerid, text[])
{
    new i_chat_tex[144];
    if(text[0] == '#' && P_Data[playerid][pAdmin] >= 1)
    {
        format(i_chat_tex,sizeof(i_chat_tex),"Admin Chat: %s: %s", Name(playerid), text[1]); // First va chat admin
        MessageToAdmins(COLOR_GREEN, i_chat_tex);
        return false;
    }
    if(text[0] == '*' && P_Data[playerid][VIP] >= 1)
    {
        format(i_chat_tex, sizeof(i_chat_tex), "VIP Chat: %s: %s", Name(playerid), text[1]); // After you are vip chat
        MessageToPlayerVIP(0xDC686BAA, i_chat_tex);
        return false;
    }
    if(IsPlayerConnected(playerid))
    {
        format(i_chat_tex, sizeof(i_chat_tex), "%s: %s", Name(playerid), text); // Finally the chat by default
        SendClientMessageToAll(-1, i_chat_tex);
        return false;
    }
    return true;
}

stock MessageToPlayerVIP(color, const string[])
{
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(P_Data[i][VIP] >= 1)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return true;
}

stock MessageToAdmins(color, const string[])
{
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(P_Data[i][pAdmin] >= 1)
            {
                SendClientMessage(i, color, string);
            }
        }
    }
    return true;
}

stock Name(playerid)
{
    new i_name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, i_name, MAX_PLAYER_NAME);
    return i_name;
}
Reply


Messages In This Thread
MessageToAdmins and VIP bug - by AYOUYOU - 26.11.2014, 12:19
Re: MessageToAdmins and VIP bug - by Jonesy96 - 26.11.2014, 12:31
Re : MessageToAdmins and VIP bug - by AYOUYOU - 26.11.2014, 14:04
Re: MessageToAdmins and VIP bug - by sammp - 26.11.2014, 14:35
Re : MessageToAdmins and VIP bug - by AYOUYOU - 26.11.2014, 15:45
Re: MessageToAdmins and VIP bug - by JuanStone - 26.11.2014, 16:01
Re : MessageToAdmins and VIP bug - by AYOUYOU - 26.11.2014, 16:07
Re: MessageToAdmins and VIP bug - by amirab - 26.11.2014, 16:13
Re: MessageToAdmins and VIP bug - by AnthonyTimmers - 26.11.2014, 16:30
Re: MessageToAdmins and VIP bug - by AnthonyTimmers - 26.11.2014, 16:34

Forum Jump:


Users browsing this thread: 1 Guest(s)