09.12.2010, 20:12
TOP:
cmdtext
After all callbacks:
I just use dcmd, at all.
Код:
#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
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(heal,4,cmdtext); // Comand name before the amount of characters
return 0;
}
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;
}