PDA

View Full Version : VIP CHAT


SeifGeny
05/07/2017, 05:21 PM
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

Dayrion
05/07/2017, 05:37 PM
Show what you already did

SeifGeny
05/07/2017, 05:40 PM
Nothing actually i tried but it doesn't work

Sew_Sumi
05/07/2017, 06:07 PM
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.

SeifGeny
05/07/2017, 06:09 PM
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;
}

Sew_Sumi
05/07/2017, 06:11 PM
Why if(!IsPlayerVipType(playerid, 1)) twice?

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

SeifGeny
05/07/2017, 06:15 PM
So how i can fix it?

RxErT
05/07/2017, 07:20 PM
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);
SendVIPMessage(COLOR_PURPLE, str);
}
else return SendClientMessage(playerid, 0xFF0000AA, "You are not VIP member.");
return 1;
}

SeifGeny
05/07/2017, 08:39 PM
thank you so much +rep