Advertisement
Guest User

Furien WallHang

a guest
Jun 16th, 2014
1,686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <fakemeta>
  5. #include <fakemeta_util>
  6. #include <hamsandwich>
  7.  
  8. new const PLUGIN[] = "Furien WallHang";
  9. new const VERSION[] = "1.0";
  10.  
  11. #pragma semicolon 1
  12.  
  13. // Float
  14. new Float: Wallorigin[33][3];
  15.  
  16. public plugin_init()
  17. {
  18. register_plugin(PLUGIN, VERSION, "Aragon*");
  19.  
  20. // Ham Forwrads
  21. RegisterHam(Ham_Touch, "player", "fw_PlayerTouch", 1);
  22.  
  23. // FM Forwards
  24. register_forward(FM_PlayerPostThink, "fw_PlayerPostThink");
  25.  
  26. // CVARs
  27. register_cvar("furien_wallahng", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
  28. }
  29.  
  30. public fw_PlayerTouch(id, world)
  31. {
  32. if(is_user_alive(id) && get_user_team(id) == 1)
  33. {
  34. new ClassName[32];
  35. pev(world, pev_classname, ClassName,(32-1));
  36.  
  37. if(equal(ClassName, "worldspawn") || equal(ClassName, "func_wall") || equal(ClassName, "func_breakable"))
  38. pev(id, pev_origin, Wallorigin[id]);
  39. }
  40.  
  41. return HAM_SUPERCEDE;
  42. }
  43.  
  44. public fw_PlayerPostThink(id)
  45. {
  46. if(is_user_alive(id) && get_user_team(id) == 1)
  47. {
  48. static Float:Origin[3];
  49. pev(id, pev_origin, Origin);
  50.  
  51. static Button;
  52. Button = pev(id, pev_button);
  53.  
  54. if(Button & IN_USE && get_distance_f(Origin, Wallorigin[id]) <= 5.0 && !(pev(id, pev_flags) & FL_ONGROUND))
  55. {
  56. new Float:Velocity[3];
  57. new ClimbSpeed = floatround(pev(id, pev_maxspeed) / 2.0);
  58.  
  59. if(Button & IN_FORWARD)
  60. {
  61. velocity_by_aim(id, ClimbSpeed, Velocity);
  62. fm_set_user_velocity(id, Velocity);
  63. }
  64.  
  65. else if(Button & IN_BACK)
  66. {
  67. velocity_by_aim(id, - ClimbSpeed, Velocity);
  68. fm_set_user_velocity(id, Velocity);
  69. }
  70.  
  71. else
  72. {
  73. set_pev(id, pev_origin, Wallorigin[id]);
  74. velocity_by_aim(id, 0, Velocity);
  75. fm_set_user_velocity(id, Velocity);
  76. }
  77. }
  78. }
  79. }
  80.  
  81. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  82. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  83. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement