Could u give us the whole command? Otherwise we can't help you.
PS. To bad for Kostas i'm first. |
forward AdminSendClientMessage(color,const string[],level);
public AdminSendClientMessage(color,const string[],level)
{
//foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
CMD:ask(playerid, params[])
{
new string[128], playername[MAX_PLAYER_NAME], result[70];
if(sscanf(params, "s", result)) return SendClientMessage(playerid, YOUR_COLOR, "[USAGE]: /ask [question here]");
else
{
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "* [%d] %s: %s", playerid, playername, result);
AdminSendClientMessage(YOUR_COLOR, string, 1);
}
return 1;
}
CMD:apm(playerid, params[])
{
new string[96], playername[MAX_PLAYER_NAME],giveplayerid, giveplayername[MAX_PLAYER_NAME], result[96];
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "us", giveplayerid, result)) return SendClientMessage(playerid, YOUR_COLOR, "[USAGE]: /apm [playerid]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, YOUR_COLOR, " Player is not connected!");
else
{
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
format(string, sizeof(string), "PM from admin %s: %s", playername, result);
SendClientMessage(giveplayerid, YOUR_COLOR, string);
format(string, sizeof(string), "PM to [%d]%s: %s", giveplayerid, giveplayername, result);
SendClientMessage(playerid, YOUR_COLOR, string);
}
}
else
{
SendClientMessage(playerid, YOUR_COLOR, " You are not an admin!");
}
return 1;
}
pawn Код:
|