[Help] Basic Question
#4

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.
Reply


Messages In This Thread
[Help] Basic Question - by rubygta - 09.12.2010, 19:52
Re: [Help] Basic Question - by CyNiC - 09.12.2010, 19:54
Re: [Help] Basic Question - by rubygta - 09.12.2010, 19:58
Re: [Help] Basic Question - by blackwave - 09.12.2010, 20:12
Re: [Help] Basic Question - by rubygta - 09.12.2010, 20:20
Re: [Help] Basic Question - by Hal - 09.12.2010, 20:24
Re: [Help] Basic Question - by Retardedwolf - 09.12.2010, 20:27

Forum Jump:


Users browsing this thread: 2 Guest(s)