SA-MP Forums Archive
Any command not work! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Any command not work! (/showthread.php?tid=310744)



Any command not work! - aqu - 13.01.2012

Hello,I am using dcmd in my server.I don't know where is the problem,when I type any command like /kill ,I get nothink.

Commands from fileterscript works,but not from gamemode.I don't understand,where is the problem?

Here is my code:
Код:
#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

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!IsPlayerConnected(playerid)) return 0; // Check for undisconnected bug.
    new
        i,
        c;
    while ((c = cmdtext[i++])) if (c < 0x20 || c > 0x7E) return 0; // Check for illegal characters.

    dcmd(kill, 4, cmdtext);

    return 0;
}

dcmd_kill(playerid, cmdtext[]) {
    #pragma unused cmdtext
    SetPlayerHealth( playerid, 0 );
    return 1;
}