26.11.2014, 12:19
I have problйm in MessageToAdmins and MessageToPlayerVIP
Hope help me
pawn Код:
public OnPlayerText(playerid, text[])
if(text[0] == '*' && P_Data[playerid][VIP] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"VIP Chat: %s: %s",string,text[1]);
MessageToPlayerVIP(0xDC686BAA,string);
return 0;
}
//==============================================================================
// Administration Chat
//==============================================================================
else if(text[0] == '#' && P_Data[playerid][pAdmin] >= 1)
{
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
MessageToAdmins(COLOR_GREEN,string);
return 0;
}
return 1;
}
forward MessageToAdmins(color,const string[]);
forward MessageToPlayerVIP(color,const string[]);
public MessageToAdmins(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(P_Data[i][pAdmin] >= 1)
SendClientMessage(i, color, string);
}
return 1;
}
stock SendCommandToAdmins(playerid,command[])
{
new string[128];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"'%s' (Level: %d) | Command: %s",string,P_Data[playerid][pAdmin],command);
return MessageToAdmins(COLOR_BLUE,string);
}
public MessageToPlayerVIP(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1)
if(P_Data[i][VIP] >= 1)
SendClientMessage(i, color, string);
}
return 1;
}