22.12.2013, 12:55
use "else if" and also the callback must return 1 for normal chat.
that'll work:
that'll work:
PHP код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '*' && PInfo[playerid][Admin] >= 1)
{
new str[256]; GetPlayerName(playerid,str,sizeof(str));
format(str,sizeof(str),"Admin Chat: {B4B5B7}%s: %s",str,text[1]);
AdminPrivateChat(COLOR_RED,str);
SaveLogs("AdminChat",str);
return 0;
}
else if(text[0] == '@' && PInfo[playerid][VIP] == 1)
{
new str[256]; GetPlayerName(playerid,str,sizeof(str));
format(str,sizeof(str),"VIP Chat: {B4B5B7}%s: %s",str,text[1]);
VIPPrivateChat(COLOR_YELLOW,str);
SaveLogs("VIPChat",str);
return 0;
}
else if(PInfo[playerid][pMute] == 1)
{
SendClientMessage(playerid, COLOR_RED, "You are muted, no one can hear you!");
return 0;
}
return 1;
}
Quote:
Originally Posted by SA-MP Wiki
Returning 0 in this callback will stop the text from being sent
|