Advertisement
Guest User

asd

a guest
Feb 7th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.67 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <reapi>
  4.  
  5. #define ADMIN_FLAG "a"
  6.  
  7. public plugin_init()
  8. {
  9.     register_plugin("amxx_health", "1.0", "mi0")
  10.     register_concmd("amx_health", "CMD_HEALTH", read_flags(ADMIN_FLAG))
  11. }
  12.  
  13. public CMD_HEALTH(id, level, cid)
  14. {
  15.     if(!cmd_access(id, level, cid, 3))
  16.         return PLUGIN_HANDLED
  17.  
  18.     new szArg[32], szArg2[16]
  19.  
  20.     read_argv(1, szArg, charsmax(szArg))
  21.     new iPlayer = cmd_target(id, szArg, 6)
  22.  
  23.     if(!iPlayer)
  24.         return PLUGIN_HANDLED
  25.  
  26.     read_argv(2, szArg2, charsmax(szArg2))
  27.     new iAmount = str_to_num(szArg2)
  28.  
  29.     if(iAmount <= 0)
  30.         return PLUGIN_HANDLED
  31.  
  32.     set_entvar(iPlayer, var_health, iAmount*1.0)
  33.    
  34.     return PLUGIN_HANDLED
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement