27.04.2014, 13:14
This is my VIP Chat - OnPlayerText
SendVIPMessage function:
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.
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;
}