14.01.2015, 11:14
Guys Help plz i've add admin chat But I Don't Know why Vip chat work and Admin chat Don't
pawn Код:
forward MessageToPlayerAdmin(color,const string[]);
forward MessageToPlayerVIP(color,const string[]);
pawn Код:
//OnPlayerText
//==============================================================================
// Vip Chat
//==============================================================================
if(text[0] == '!' && PlayerInfo[playerid][VIP] == 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[DONATOR] %s: %s",string,text[1]);
MessageToPlayerVIP(green,string);
return 0;
}
//==============================================================================
// Administration Chat
//==============================================================================
if(text[0] == '#' && PlayerInfo[playerid][Admin] == 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[ADMIN] %s: %s",string,text[1]);
MessageToPlayerAdmin(grey,string);
return 0;
}
pawn Код:
public MessageToPlayerAdmin(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][Admin] >= 2)
SendClientMessage(i, color, string);
}
return 1;
}
public MessageToPlayerVIP(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][VIP] >= 1)
SendClientMessage(i, color, string);
}
return 1;
}