Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2010
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.99 KB | None | 0 0
  1. // top that on your GM/FS TOP (depending what you're using)
  2. #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
  3.  
  4. // on OnPlayerCommandText you put this: dcmd(command_name,number_of_characters,cmdtext);
  5. public OnPlayerCommandText(playerid, cmdtext[])
  6. {
  7.    dcmd(heal,4,cmdtext); // the word 'heal' has 4 characters, so 4 there
  8.    // any other stuff
  9.    return 0;
  10. }
  11.  
  12. After all callbacks of your GM/FS, put the command:
  13.  
  14. dcmd_heal(playerid,params[])
  15. {
  16.    new id; // id which will be healed
  17.    id = strval(params); // params1 = id which will be healed
  18.    if(!IsPlayerConnected(id)) return false; // if the id isn't connected, nothing happens
  19.    if(id == playerid || playerid == id) return false; // if the id is the player which used the command, nothing happens
  20.    else // Otherwise..
  21.    {
  22.       SetPlayerHealth(id, 100.0);
  23.    }
  24.    return 1;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement