Fail Command!
#3

Do what the above says. Also return 0 on OnPlayerCommandText so the code is like this.

pawn Код:
#include <a_samp>

//DCMD Commands
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_RED 0xFF0000FF

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(fail, 4, cmdtext);
    return 0;
}

dcmd_fail(playerid, params[])
{
    #pragma unused params
    new playername[24];
    new string[56];
    GetPlayerName(playerid, playername, sizeof (playername));
    format(string, sizeof(string), "%s failed!", playername);
    SendClientMessageToAll (COLOR_RED, string);
    return 1;
}
Reply


Messages In This Thread
Fail Command! - by Luis_Leone - 03.08.2010, 01:40
Re: Fail Command! - by marharth - 03.08.2010, 01:43
Re: Fail Command! - by BP13 - 03.08.2010, 01:44
Re: Fail Command! - by Luis_Leone - 03.08.2010, 02:08

Forum Jump:


Users browsing this thread: 1 Guest(s)