06.05.2015, 18:50
Hi all i have try to make an Admin Chat, on pawno i don't have errors but, if i try it on server i doesn't work.
public OnPlayerText(playerid, text[])
{
new string[128];
if(text[0] == '#' && PlayerInfo[playerid][Admin] >= 1)
{
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
MessageToAdmins(COLORE_VERDE,string);
}
return 0;
}
forward MessageToAdmins(colore,const string[]);
public MessageToAdmins(colore,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Admin] >= 1)
SendClientMessage(i, colore, string);
}
return 1;
}
What i must change?
public OnPlayerText(playerid, text[])
{
new string[128];
if(text[0] == '#' && PlayerInfo[playerid][Admin] >= 1)
{
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
MessageToAdmins(COLORE_VERDE,string);
}
return 0;
}
forward MessageToAdmins(colore,const string[]);
public MessageToAdmins(colore,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Admin] >= 1)
SendClientMessage(i, colore, string);
}
return 1;
}
What i must change?