19.03.2011, 11:44
But how do you use the params if it's not defined? Or is it defined somewhere else in the callbakc OnPlayerCommand?
Well, anyway, let's try this code then:
You used too many unnecessarily brackets, and you used else for no reason, and pName should be MAX_PLAYER_NAME, which will make the small chance of lag even more small.
Well, anyway, let's try this code then:
pawn Код:
if(!strcmp(cmd, "/asay2"))
{
new text[128], string[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFFF,"You are not an admin !");
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /asay2 [text]");
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "~b~%s:~r~%s",pName, text);
GameTextForAll(string, 3000, 4);
return 1;
}