SA-MP Forums Archive
Vip Chat![Help] [+ Rep] - 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: Vip Chat![Help] [+ Rep] (/showthread.php?tid=380906)



Vip Chat![Help] [+ Rep] - Nirzor - 27.09.2012

i use
Код:
 if(PlayerInfo[playerid][dRank] >= blabla)
how to make a vip chat with it i need codes so i can

learn and second time i can do it by my own if you can +rep give me codes with if(PlayerInfo[playerid][dRank] >= balba)

system


Re: Vip Chat![Help] [+ Rep] - kbalor - 27.09.2012

Quote:
Originally Posted by Nirzor
Посмотреть сообщение
i use
Код:
 if(PlayerInfo[playerid][dRank] >= blabla)
how to make a vip chat with it i need codes so i can

learn and second time i can do it by my own if you can +rep give me codes with if(PlayerInfo[playerid][dRank] >= balba)

system
pawn Код:
COMMAND:vchat(playerid,params[])
{
    if(PlayerInfo[playerid][dRank] >= 1) // Level 1 VIP
    {
        new text[128];
        if(sscanf(params, "s[128]", text))
        {
            SendClientMessage(playerid,  -1,"Usage: /vsay [Message]");
            return 1;
        }
        new string[128];
        format(string, sizeof(string), "[VIP]%s: %s", GetName(playerid), text);
        SendClientMessageToAll(0xDCDCDCFF,string);
    }
    else
    {
          SendClientMessage(playerid, -1,"You are not a VIP member");
    }
    return 1;
}



Re: Vip Chat![Help] [+ Rep] - SmithyComp - 27.09.2012

This will help.

pawn Код:
CMD:v(playerid, params[])
{
    if(PlayerInfo[playerid][pDonateRank] > 0 || PlayerInfo[playerid][pAdmin] >= 1337)
    {
        new string[128];
        if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /v(ip chat) [message]");

        if(VIPTimer[playerid] > 0)
        {
            format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", VIPTimer[playerid]);
            SendClientMessageEx(playerid, COLOR_GREY, string);
            return 1;
        }
        if(PlayerInfo[playerid][pToggedVIPChat] == 0)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /togvip to re-enable!");
            return 1;
        }
        if(PlayerInfo[playerid][pVMuted] > 0)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the VIP chat channel.");
            return 1;
        }
        if(PlayerInfo[playerid][pDonateRank] == 1)
        {
            format(string, sizeof(string), "** Bronze VIP %s: %s", GetPlayerNameEx(playerid), params);
            VIPTimer[playerid] = 5;
        }
        else if(PlayerInfo[playerid][pDonateRank] == 2)
        {
            format(string, sizeof(string), "** Silver VIP %s: %s", GetPlayerNameEx(playerid), params);
            VIPTimer[playerid] = 5;
        }
        else if(PlayerInfo[playerid][pDonateRank] == 3)
        {
            format(string, sizeof(string), "** Gold VIP %s: %s", GetPlayerNameEx(playerid), params);
            VIPTimer[playerid] = 5;
        }
        else if(PlayerInfo[playerid][pDonateRank] == 4)
        {
            format(string, sizeof(string), "** Platinum VIP %s: %s", GetPlayerNameEx(playerid), params);
            VIPTimer[playerid] = 5;
        }
        else if(PlayerInfo[playerid][pDonateRank] == 5)
        {
            format(string, sizeof(string), "** Diamond VIP %s: %s", GetPlayerNameEx(playerid), params);
        }
        if(PlayerInfo[playerid][pAdmin] == 2)
        {
            format(string, sizeof(string), "** Junior Admin %s: %s", GetPlayerNameEx(playerid), params);
        }
        if(PlayerInfo[playerid][pAdmin] == 3)
        {
            format(string, sizeof(string), "** General Admin %s: %s", GetPlayerNameEx(playerid), params);
        }
        if(PlayerInfo[playerid][pAdmin] == 4)
        {
            format(string, sizeof(string), "** Senior Admin %s: %s", GetPlayerNameEx(playerid), params);
        }
        if(PlayerInfo[playerid][pAdmin] == 1337)
        {
            format(string, sizeof(string), "** Head Admin %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 1338)
        {
            format(string, sizeof(string), "** Server Manager %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 9999)
        {
            format(string, sizeof(string), "** Elite Admin %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 99998)
        {
            format(string, sizeof(string), "** Co-Executive Director %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 99999)
        {
            format(string, sizeof(string), "** Executive Director %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 999995)
        {
            format(string, sizeof(string), "** Community Manager %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 999998)
        {
            format(string, sizeof(string), "** Co-Community Director %s: %s", GetPlayerNameEx(playerid), params);
        }
        else if(PlayerInfo[playerid][pAdmin] == 999999)
        {
            format(string, sizeof(string), "** Community Director %s: %s", GetPlayerNameEx(playerid), params);
        }
        if (PlayerInfo[playerid][pDonateRank] >= 1 || PlayerInfo[playerid][pAdmin] >= 2)
        {
            SendVIPMessage(COLOR_VIP, string);
        }

        Log("logs/vipchat.log", string);
    }
    return 1;
}



Re: Vip Chat![Help] [+ Rep] - Nirzor - 27.09.2012

i need help that only vips can see the chat and also admins other than that no one else


Re: Vip Chat![Help] [+ Rep] - .v - 27.09.2012

On top of your script
pawn Код:
forward VIPMSG(color,const string[]);
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!' && PlayerInfo[playerid][dRank] >= 1)
    {
        new string[128];
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"[VIP Chat]%s: %s",string,text[1]);
        VIPMSG(0x8FBC8FFF,string);
        return 0;
    }
     return 1;
}

pawn Код:
public VIPMSG(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if((IsPlayerNPC(i)) || (!IsPlayerConnected(i))) continue;
        if((PlayerInfo[i][dRank] >= 1)) SendClientMessage(i, color, string);
    }
    return 1;
}



Re: Vip Chat![Help] [+ Rep] - Jarnu - 27.09.2012

pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '.' && PlayerInfo[playerid][pLevel] >= 1 || PlayerInfo[playerid][dRank] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"VIP.Chat: %s: %s",string,text[1]);
MessageToVips(COLOR_PINK,string);
return 0;
}
return 1;
}
MessageToVips
pawn Код:
forward MessageToVips(color,const string[]);
public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][dRank] >= 1) SendClientMessage(i, color, string);
    }
    return 1;
}
DONE
EDIT: a sec late from v.


Re: Vip Chat![Help] [+ Rep] - .v - 27.09.2012

@Nirzor Use Jarnu's code if mine does not work. He is a good scripter.


Re: Vip Chat![Help] [+ Rep] - Nirzor - 27.09.2012

Thanks guys i added rep to you both thanks for the real hlep xD jarnu is my best buddy xD