SA-MP Forums Archive
VIP CHAT - 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 (/showthread.php?tid=636909)



VIP CHAT - SeifGeny - 05.07.2017

Hey guys i want to create a vip chat i use luxadmin

Code
Код:
if(!IsPlayerVipType(playerid, 1))
I want it in zcmd i tried alot but it doesn't work


Re: VIP CHAT - Dayrion - 05.07.2017

Show what you already did


Re: VIP CHAT - SeifGeny - 05.07.2017

Nothing actually i tried but it doesn't work


Re: VIP CHAT - Sew_Sumi - 05.07.2017

Quote:
Originally Posted by SeifGeny
Посмотреть сообщение
Nothing actually i tried but it doesn't work
Show what doesn't work... That's what this section is for... Posting code that doesn't work so others can help you with it.


Re: VIP CHAT - SeifGeny - 05.07.2017

Код:
forward SendVIPMessage(color, string[]);
public SendVIPMessage(color, string[])
{
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i))
                {
                    if(IsPlayerVipMember(i))
                    {
                                SendClientMessage(i, color, string);
                        }
                }
        }
}

CMD:vc(playerid, params[])
{
        if(!IsPlayerVipType(playerid, 1))
    {
        new Nam[MAX_PLAYERS],message[128],str[256];
        if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /vc(vip Chat) [Text]");
        GetPlayerName(playerid,Nam,sizeof(Nam));
        format(str,sizeof(str),"{9900CC}VIP Chat %s: {FFFFFF}%s",Nam,message);
        if(!IsPlayerVipType(playerid, 1))
                {
                        SendVIPMessage(COLOR_PURPLE, str);
                        return 1;
                }
        }
        else  return  SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
        return 1;
}



Re: VIP CHAT - Sew_Sumi - 05.07.2017

Why
Код:
if(!IsPlayerVipType(playerid, 1))
twice?

You are also checking VIP type in the command, rather than VIP Member...


Re: VIP CHAT - SeifGeny - 05.07.2017

So how i can fix it?


Re: VIP CHAT - RxErT - 05.07.2017

PHP код:
forward SendVIPMessage(colorstring[]);
public 
SendVIPMessage(colorstring[])
{
        for(new 
0MAX_PLAYERSi++)
        {
                if(
IsPlayerConnected(i))
                {
                    if(
IsPlayerVipMember(i))
                    {
                                
SendClientMessage(icolorstring);
                        }
                }
        }
}
CMD:vc(playeridparams[])
{
        if(
IsPlayerVipType(playerid1))
    {
        new 
Nam[MAX_PLAYERS],message[128],str[256];
        if(
sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /vc(vip Chat) [Text]");
        
GetPlayerName(playerid,Nam,sizeof(Nam));
        
format(str,sizeof(str),"{9900CC}VIP Chat %s: {FFFFFF}%s",Nam,message);
        
SendVIPMessage(COLOR_PURPLEstr);
    }
        else  return  
SendClientMessage(playerid0xFF0000AA"You are not VIP member.");
        return 
1;




Re: VIP CHAT - SeifGeny - 05.07.2017

thank you so much +rep