forward MessageToPlayerAdmin(color,const string[]);
forward MessageToPlayerVIP(color,const string[]);
//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;
}
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;
}
//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;
}
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;
}
public MessageToPlayerAdmin(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(PlayerInfo[i][Admin] >= 2) // Look here, level 2 only, while level 1 can send it but they don't see it.
SendClientMessage(i, color, string);
}
return 1;
}
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;
}
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;
}
then do this:
pawn Код:
|