16.09.2010, 20:15
Quote:
You must return '0' in order for the text not to be send (Via standard build-in chat), so you'd be most likely want to do it just after "print(admin_string);"
|
pawn Код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '@')
{
new Message[128];
if(sscanf(text, "s[128]", Message))
{
if(PlayerStatistics[playerid][pAdminLevel] >= 1)
{
SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /(a)dmin [message]");
}
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i))
{
if(PlayerStatistics[i][pAdminLevel] >= 1)
{
new admtext[128], name[MAX_PLAYER_NAME], string[128];
name = GetName(playerid);
if(PlayerStatistics[i][pAdminLevel] == 5) { admtext = "Server Owner"; }
else if(PlayerStatistics[i][pAdminLevel] == 4) { admtext = "Server Developer"; }
else if(PlayerStatistics[i][pAdminLevel] == 3) { admtext = "Lead Admin"; }
else if(PlayerStatistics[i][pAdminLevel] == 2) { admtext = "Game Admin"; }
else if(PlayerStatistics[i][pAdminLevel] == 1) { admtext = "Moderator"; }
format(string, sizeof(string), "[%s] %s(%d): %s", admtext, name, playerid, Message );
SendAdminMessage(COLOR_LIGHTBLUE, string, 1);
print(string);
return 0;
}
}
}
}
}
else
{
return 1;
}
return 1;
}