Quote:
Originally Posted by blackwave
TOP:
Код:
#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
cmdtext
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(heal,4,cmdtext); // Comand name before the amount of characters return 0; }
After all callbacks:
pawn Код:
dcmd_heal(playerid,params[]) { new id; // ID which will be healed id = strval(params); SetPlayerHealth(id, 100.0); SetPlayerArmour(id, 100.0); return 1; }
I just use dcmd, at all.
|
Sorry, I don't use dcmd :/ Anyone got a code for strcmp ? With descriptions ?Thank you. btw thank you for your answer Blackwave