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=509650)
VIP Chat -
biker122 - 27.04.2014
This is my VIP Chat - OnPlayerText
pawn Код:
if(text[0] == '@' && PlayerInfo[playerid][pAdminLevel] >= 1 || PlayerInfo[playerid][pVIPLevel] >= 1)
{
if(PlayerInfo[playerid][pAdminLevel] >= 1 && PlayerInfo[playerid][pVIPLevel] >= 1)
{
format(string,sizeof(string),"- VIP Chat - "LBLUE"%s(%d): %s",GetName(playerid),playerid,text[1]);
SendAdminMessage(COLOR_ORANGE,string);
return 0;
}
format(string,sizeof(string),"- VIP Chat - "LBLUE"%s(%d): %s",GetName(playerid),playerid,text[1]);
SendVIPMessage(COLOR_ORANGE,string);
format(string,sizeof(string),"0- VIP Chat - %s(%d): %s",GetName(playerid),playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ACHANNEL,string);
return 0;
}
SendVIPMessage function:
pawn Код:
function SendVIPMessage(mcolor,const str[])
{
foreach(Player,i)
{
if(PlayerInfo[i][pVIPLevel] >= 1)
{
SendClientMessage(i,mcolor,str);
}
}
return 1;
}
I want it to be used by admins too. But, When I have VIP level 1 or more, It removes my first word and sends everything to VIP chat. Like when I type Hi. It automatically sends i without the prefix. This is getting weird.
Re: VIP Chat -
biker122 - 27.04.2014
Ofc, I did.
When I changed it here:
pawn Код:
if(text[0] == '@' && PlayerInfo[playerid][pAdminLevel] >= 1 || PlayerInfo[playerid][pVIPLevel] >= 1)
It worked only when I had both VIP and admin level at 1. I want admins to be able to use VIP chat. (<--)
AW: VIP Chat -
Macronix - 27.04.2014
Try this:
pawn Код:
if(PlayerInfo[playerid][pAdminLevel] >= 1 || PlayerInfo[playerid][pVIPLevel] >= 1)
{
if(text[0] == '@')
{
if(PlayerInfo[playerid][pAdminLevel] >= 1)
{
format(string,sizeof(string),"- VIP Chat - "LBLUE"%s(%d): %s",GetName(playerid),playerid,text[1]);
SendAdminMessage(COLOR_ORANGE,string);
return 0;
}
if(PlayerInfo[playerid][pVIPLevel] >= 1)
{
format(string,sizeof(string),"- VIP Chat - "LBLUE"%s(%d): %s",GetName(playerid),playerid,text[1]);
SendVIPMessage(COLOR_ORANGE,string);
format(string,sizeof(string),"0- VIP Chat - %s(%d): %s",GetName(playerid),playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ACHANNEL,string);
return 0;
}
}
}
Re: VIP Chat -
biker122 - 27.04.2014
It worked! Thanks!