admin chat code has a bug
#3

Do not use [256]. Use maximal [128].
And sscanf is called when there are NO params in a string. Here's an example:

pawn Код:
dcmd_a(playerid, params[])
{
    new str[128], input[75], pName[MAX_PLAYER_NAME];
    if(sscanf(params, "s", input)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /a [text]");
    if(IsPlayerAdmin(playerid) || Spieler[playerid][AdminLevel] > 0){
        format(str, 128, "[ADMIN] %s(%d): %s", pName, playerid, input);
        for(new i = 0; i < MAX_PLAYERS; i++)
            if(IsPlayerAdmin(i) || Spieler[playerid][AdminLevel] > 0)
                SendClientMessage(i, 0x00FFFFAA, str);
    }
    return 1;
}
Reply


Messages In This Thread
admin chat code has a bug - by BlackWolf120 - 12.03.2011, 01:59
Re: admin chat code has a bug - by omer5198 - 12.03.2011, 04:45
Re: admin chat code has a bug - by Kwarde - 12.03.2011, 05:48
Re: admin chat code has a bug - by BlackWolf120 - 12.03.2011, 14:05
Re: admin chat code has a bug - by Kwarde - 12.03.2011, 14:09
Re: admin chat code has a bug - by HyperZ - 12.03.2011, 14:14
Re: admin chat code has a bug - by Kwarde - 12.03.2011, 14:22
Re: admin chat code has a bug - by HyperZ - 12.03.2011, 14:25
Re: admin chat code has a bug - by Kwarde - 12.03.2011, 14:27
Re: admin chat code has a bug - by HyperZ - 12.03.2011, 14:30

Forum Jump:


Users browsing this thread: 1 Guest(s)