Problem...
#1

Hello, I want to make a VIP chat but the problem is Its not showing it I dont know why...
Its showing [VIP] PlayerName [ID]: @ Something

Код:
public OnPlayerText(playerid, text[])
{
        if(text[0] == '@' && pInfo[playerid][VIPlevel] == 1)
        {
		new pName[MAX_PLAYER_NAME], string[128];
		GetPlayerName(playerid, pName, sizeof(pName));
		format(string, sizeof(string), "[VIP Chat] | %s: %s", pName, text[1]);
		SendMessageToVIP(string);
		return 0;
        }
        return 1;
}
Код:
stock SendMessageToVIP(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && pInfo[i][VIPlevel] == 1) SendClientMessage(i, -1, text);
    }
}
Any help? Thanks.
Reply
#2

Try this and check if you're VIPLevel 1

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '@' && pInfo[playerid][VIPlevel] == 1)
    {
        new pName[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pName, sizeof(pName));
        strdel(text, 0, 1);
        format(string, sizeof(string), "[VIP Chat] | %s: %s", pName, text);
        SendMessageToVIP(string);
        return 0;
    }
    return 1;
}

stock SendMessageToVIP(text[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && pInfo[i][VIPlevel] == 1) SendClientMessage(i, -1, text);
    }
}
Reply
#3

Not working m8, and I am VIP I removed and added it again.
Reply
#4

Your system has only 1 vip level or more than 1? I suppose other players have vip level of 2 or 3 and this code sends a message to vip level 1 only.
Reply
#5

Level 1 Only (For now..)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)