14.01.2015, 11:21
pawn Код:
//OnPlayerText
//==============================================================================
// Vip Chat
//==============================================================================
if(text[0] == '!' && PlayerInfo[playerid][VIP])
{
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])
{
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)) continue;
if(PlayerInfo[i][Admin]) SendClientMessage(i, color, string);
}
return 1;
}
public MessageToPlayerVIP(color, const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerInfo[i][VIP]) SendClientMessage(i, color, string);
}
return 1;
}