10.09.2013, 09:40
pawn Код:
CMD:am(playerid, params)
{
new string[128];
if(sacanf(params, "s[128]", string) return SCM(playerid, COLRED, "[Usage]{F0F0F0}: /am [message]");
format(string, sizeof(string), "[Message from %s (%d)]: %s", GetName(playerid), playerid, string);
foreach(new i : Player)
{
if(PlayerInfo[i] [pAdmin] >=1) SCM(i, COLPURPLE, string);
}
SCM(playerid, COLPURPLE, "Your message has been sent to online admins!");
return 1;
}
CMD:amsg(playerid, params)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new player1, string[128];
if(sacanf(params, "us[128]", player1, string) return SCM(playerid, COLRED, "[Usage]{F0F0F0}: /amsg [Player ID] [message]");
if(!IsPlayerConnected(player1)) return SCM(playerid, COLRED, "[Server]{F0F0F0}: This player is not connected!");
format(string, sizeof(string), "[Message from Admin %s (%d)]: %s", GetName(playerid), playerid, string);
SCM(player1, COLPURPLE, string);
SCM(playerid, COLPURPLE, "Your message has been sent to online admins!");
}
else SCM(playerid, COLPURPLE, "You are not authorized to use this command!");
return 1;
}