SA-MP Forums Archive
Problem... - 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: Problem... (/showthread.php?tid=588772)



Problem... - BladeFire - 12.09.2015

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.


AW: Problem... - Skimmer - 12.09.2015

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);
    }
}



Re: Problem... - BladeFire - 12.09.2015

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


Re: Problem... - Sjn - 12.09.2015

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.


Re: Problem... - BladeFire - 12.09.2015

Level 1 Only (For now..)