public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/m", true))
{
if(!IstSpielerInFraktion(playerid, 1)) return SendClientMessage(playerid, COLOR_RED, "Du bist kein Polizist!");
new text[126],string[126];
if(sscanf(params,"s"text)) return SendClientMessage(playerid, COLOR_YELLOW, "Benutze: /m [Forderung] (Megaphone)");
new Name[MAX_PLAYER_NAME];
new Float:X,Float:Y,Float:Z;
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerPos (playerid,X,Y,Z);
OnPlayerCommandText(playerid,"/me holt sein Megaphone heraus.");
for(new i=0;i<max_players;i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInRangeOfPoint(i, 10.0, X, Y, Z))
{
format(string, sizeof(string), "%s(Megaphone): %s", Name, text);
SendClientMessage(i, COLOR_YELLOW, string);
}
}
}
return 1;
}
So Sollte es gehen
Ist aber Ungetestet