13.01.2012, 18:26
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:
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; }