03.02.2012, 13:43
(
Последний раз редактировалось vassilis; 03.02.2012 в 14:28.
)
SOLVED.
public OnPlayerText(playerid, text[])
{
if(text[0] == '#' && PInfo[playerid][Level] > 0) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[ADMIN]%s: %s",string,text[1]); SendAdminMessage(red,string);
return 0;
}
return 1;
}
stock SendAdminMessage(color,const msg[])
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i) && PInfo[i][Level] > 0) SendClientMessage(i,color,msg);
}
}
public OnPlayerText(playerid, text[])
{
if(text[0] == '#' && PInfo[playerid][Level] <= 1) {
new string[128]; GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"[ADMIN]%s: %s",string,text[1]);
SendAdminMessage(red,string);
return 0; // this will stop the callback, and wont show the message in the public chat
}
return 1;
}
pawn Код:
|
<= means for Admins Level 1 and Less.
Change it to >= 1 OR > 0 And return 0; as Wesley said, because it will send to non Admins. |