Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. //Agent Zero
  2.  
  3. /* CVARS - copy and paste to shconfig.cfg
  4.  
  5. //Agent Zero
  6. agentz_level 5
  7.  
  8. */
  9.  
  10. #include <amxmodx>
  11. #include <fakemeta>
  12. #include <superheromod>
  13.  
  14. new gHeroName[] = "Agent Zero"
  15. new bool:gHasAgent[SH_MAXSLOTS+1]
  16. new Float:gPunchAngle[3] = {0.0, 0.0, 0.0}
  17.  
  18. public plugin_init()
  19. {
  20. // Plugin Info
  21. register_plugin("SUPERHERO Agent Zero", "1.1", "Freecode")
  22.  
  23. // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
  24. register_cvar("agentz_level", "5")
  25.  
  26. // FIRE THE EVENT TO CREATE THIS SUPERHERO!
  27. shCreateHero(gHeroName, "No Recoil", "Get No Recoil when shooting.", false, "agentz_level")
  28.  
  29. // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
  30. // INIT
  31. register_srvcmd("agentz_init", "agentz_init")
  32. shRegHeroInit(gHeroName, "agentz_init")
  33.  
  34. }
  35.  
  36. public agentz_init()
  37. {
  38. // First Argument is an id
  39. new temp[6]
  40. read_argv(1, temp, 5)
  41. new id = str_to_num(temp)
  42.  
  43. // 2nd Argument is 0 or 1 depending on whether the id has the hero
  44. read_argv(2, temp, 5)
  45. new hasPowers = str_to_num(temp)
  46.  
  47. switch(hasPowers)
  48. {
  49. case true:
  50. gHasAgent[id] = true
  51.  
  52. case false:
  53. gHasAgent[id] = false
  54. }
  55. }
  56.  
  57. public server_frame()
  58. {
  59. for ( new id = 1; id <= SH_MAXSLOTS; id++ )
  60. {
  61. if ( shModActive() && gHasAgent[id] && is_user_alive(id) )
  62. set_pev(id, pev_punchangle, gPunchAngle);
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement