Admin say problem
#4

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:
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;
}
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.
Reply


Messages In This Thread
Admin say problem - by Soumi - 19.03.2011, 11:05
Re: Admin say problem - by Biesmen - 19.03.2011, 11:13
Re : Re: Admin say problem - by Soumi - 19.03.2011, 11:20
Re: Admin say problem - by Biesmen - 19.03.2011, 11:44
Re : Admin say problem - by Soumi - 19.03.2011, 12:00

Forum Jump:


Users browsing this thread: 1 Guest(s)