06.06.2012, 17:01
you cannot use SendClientMessage to format a string
and im not sure why you would use SendClientMessageEx at all in this case
you must format a string first then use it in sendclientmessage
kinda like this
and im not sure why you would use SendClientMessageEx at all in this case
you must format a string first then use it in sendclientmessage
kinda like this
pawn Код:
CMD:a(playerid, params[])
{
if(PlayerData[playerid][AdminLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"You need to be an administrator to use this command!");
new text[128],strOut[128];
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,COLOR_RED,"-USAGE- /a [text]");
for(new i = 0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(PlayerData[playerid][AdminLevel] < 1) continue;
format(strOut,sizeof(strOut),"%s%s%s%s","Adminchat: ",PlayerInfo[playerid][Username],": {FFFFFF}",text);
SendClientMessage(i,color_yellow,strOut);
}
return 1;
}