hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.15. 16:47



Jelenlévő felhasználók

Jelenleg 735 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 734 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: hacking az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Hook
HozzászólásElküldve: 2012.10.27. 22:31 
Offline
Veterán
Avatar

Csatlakozott: 2012.09.01. 22:19
Hozzászólások: 1697
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 302 alkalommal
Valaki tud csinálni olyan hook-ot ami a kz szervereken van? Arra gondolok, hogy ami közben hookolsz változtatja a színét, és nincs semmilyen hangja..
Aki megcsinálja, vagy kiveszi belőle annak nagyon köszönöm! :D

_________________
Valami új kezdete...
Kép
Egyedi pluginok készítése pénzért (Banki átutalás, PayPal) -> Privát üzenet


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Hook
HozzászólásElküldve: 2012.10.28. 00:15 
Offline
Őskövület
Avatar

Csatlakozott: 2012.03.22. 18:22
Hozzászólások: 2978
Megköszönt másnak: 115 alkalommal
Megköszönték neki: 368 alkalommal
Csak adminoknak?

_________________
Blasenkampfwagen

https://discord.gg/uBYnNnZP
GTA:PURSUIT MTA


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Hook
HozzászólásElküldve: 2012.10.28. 08:38 
Offline
Veterán
Avatar

Csatlakozott: 2012.09.01. 22:19
Hozzászólások: 1697
Megköszönt másnak: 26 alkalommal
Megköszönték neki: 302 alkalommal
Csak adminoknak, igen

_________________
Valami új kezdete...
Kép
Egyedi pluginok készítése pénzért (Banki átutalás, PayPal) -> Privát üzenet


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Hook
HozzászólásElküldve: 2012.10.28. 14:22 
Offline
Őskövület
Avatar

Csatlakozott: 2012.03.22. 18:22
Hozzászólások: 2978
Megköszönt másnak: 115 alkalommal
Megköszönték neki: 368 alkalommal
Bocsi a késésért.Azt hittem valaki majd megcsinálja :D
próba nem volt:

SMA Forráskód: [ Mindet kijelol ]
  1. #define USING_AMX 0 // 1 = Using AMX \ 0 = Useing AMXX
  2.  
  3. #if USING_AMX
  4. #include <amxmod>
  5. #include <amxmisc>
  6. #include <VexdUM>
  7. #include <fun>
  8. new gModName[32] = "AMX"
  9. #else
  10. #include <amxmodx>
  11. #include <amxmisc>
  12. #include <fun>
  13. #include <engine>
  14. new gModName[32] = "AMXX"
  15. #endif
  16.  
  17. #define TE_BEAMENTPOINT 1
  18. #define TE_KILLBEAM 99
  19. #define DELTA_T 0.1 // seconds
  20. #define BEAMLIFE 100 // deciseconds
  21. #define MOVEACCELERATION 150 // units per second^2
  22. #define REELSPEED 300 // units per second
  23.  
  24. new gHookLocation[33][3]
  25. new gHookLenght[33]
  26. new bool:gIsHooked[33]
  27. new gAllowedHook[33]
  28. new Float:gBeamIsCreated[33]
  29. new global_gravity
  30. new beam
  31.  
  32. public plugin_init() //Called on plugin start
  33. {
  34. register_plugin("Admin Hook","1.0","AssKicR")
  35. register_cvar("sv_adminhook", "1" )
  36.  
  37. register_concmd("amx_granthook","AdminGrantHook",ADMIN_LEVEL_A,"<authid, nick, @team, @all or #userid> <on/off>")
  38.  
  39. register_clcmd("+rope", "hook_on",ADMIN_LEVEL_E)
  40. register_clcmd("-rope", "hook_off",ADMIN_LEVEL_E)
  41. register_clcmd("+hook", "hook_on",ADMIN_LEVEL_E)
  42. register_clcmd("-hook", "hook_off",ADMIN_LEVEL_E)
  43.  
  44. register_event("ResetHUD", "ResetHUD", "b")
  45. }
  46. public plugin_precache()
  47. {
  48. beam = precache_model("sprites/zbeam4.spr")
  49. precache_sound("weapons/xbow_hit2.wav")
  50. }
  51. public ResetHUD(id) {
  52. if (gIsHooked[id]) RopeRelease(id)
  53. }
  54. stock kz_velocity_set(id,vel[3]) {
  55. new Float:Ivel[3]
  56. Ivel[0]=float(vel[0])
  57. Ivel[1]=float(vel[1])
  58. Ivel[2]=float(vel[2])
  59. entity_set_vector(id, EV_VEC_velocity, Ivel)
  60. }
  61.  
  62. stock kz_velocity_get(id,vel[3]) {
  63. new Float:Ivel[3]
  64.  
  65. entity_get_vector(id, EV_VEC_velocity, Ivel)
  66. vel[0]=floatround(Ivel[0])
  67. vel[1]=floatround(Ivel[1])
  68. vel[2]=floatround(Ivel[2])
  69. }
  70. public AdminGrantHook(id,level,cid)
  71. {
  72. if ( !cmd_access(id,level,cid,1) )
  73. return PLUGIN_HANDLED
  74.  
  75. new arg1[32],arg2[32]
  76. read_argv(1,arg1,31)
  77. read_argv(2,arg2,31)
  78. new onoff = str_to_num(arg2)
  79.  
  80. if ( equali(arg1,"@all") )
  81. {
  82. new plist[32],pnum
  83. get_players(plist,pnum,"a")
  84. if (pnum==0)
  85. {
  86. console_print(id,"[%s] There are no clients",gModName)
  87. return PLUGIN_HANDLED
  88. }
  89. for (new i=0; i<pnum; i++) {
  90. gAllowedHook[plist[i]]=onoff
  91. if (gIsHooked[plist[i]]==true && onoff==0)
  92. {
  93. RopeRelease(plist[i])
  94. }
  95. }
  96.  
  97. console_print(id,"[%s] %s all players access to hook/rope",gModName,onoff ? "Gave":"Removed")
  98. }
  99. else if ( arg1[0]=='@' )
  100. {
  101. new plist[32],pnum
  102. get_players(plist,pnum,"ae",arg1[1])
  103. if ( pnum==0 )
  104. {
  105. console_print(id,"[%s] No clients in such team",gModName)
  106. return PLUGIN_HANDLED
  107. }
  108. for (new i=0; i<pnum; i++) {
  109. gAllowedHook[plist[i]]=onoff
  110. if (gIsHooked[plist[i]]==true && onoff==0)
  111. {
  112. RopeRelease(plist[i])
  113. }
  114. }
  115. console_print(id,"[%s] %s all %ss access to hook/rope",onoff ? "Gave":"Removed",arg1[1])
  116. }
  117. else
  118. {
  119. new pName[32]
  120. new player = cmd_target(id,arg1,6)
  121. if (!player) return PLUGIN_HANDLED
  122.  
  123. gAllowedHook[player]=onoff
  124. if (gAllowedHook[player]==0 && onoff==0)
  125. {
  126. RopeRelease(player)
  127. }
  128.  
  129.  
  130. get_user_name(player,pName,31)
  131. console_print(id,"[%s] %s ^"%s^" access to hook/rope",onoff ? "Gave":"Removed",pName)
  132. }
  133.  
  134. return PLUGIN_HANDLED
  135. }
  136. public ropetask(parm[])
  137. {
  138. new id = parm[0]
  139. new user_origin[3], user_look[3], user_direction[3], move_direction[3]
  140. new A[3], D[3], buttonadjust[3]
  141. new acceleration, velocity_towards_A, desired_velocity_towards_A
  142. new velocity[3], null[3]
  143.  
  144. if (!is_user_alive(id))
  145. {
  146. RopeRelease(id)
  147. return
  148. }
  149.  
  150. if (gBeamIsCreated[id] + BEAMLIFE/10 <= get_gametime())
  151. {
  152. beamentpoint(id)
  153. }
  154.  
  155. null[0] = 0
  156. null[1] = 0
  157. null[2] = 0
  158.  
  159. get_user_origin(id, user_origin)
  160. get_user_origin(id, user_look,2)
  161. kz_velocity_get(id, velocity)
  162.  
  163. buttonadjust[0]=0
  164. buttonadjust[1]=0
  165.  
  166. if (get_user_button(id)&IN_FORWARD) buttonadjust[0]+=1
  167. if (get_user_button(id)&IN_BACK) buttonadjust[0]-=1
  168. if (get_user_button(id)&IN_MOVERIGHT) buttonadjust[1]+=1
  169. if (get_user_button(id)&IN_MOVELEFT) buttonadjust[1]-=1
  170. if (get_user_button(id)&IN_JUMP) buttonadjust[2]+=1
  171. if (get_user_button(id)&IN_DUCK) buttonadjust[2]-=1
  172.  
  173. if (buttonadjust[0] || buttonadjust[1])
  174. {
  175. user_direction[0] = user_look[0] - user_origin[0]
  176. user_direction[1] = user_look[1] - user_origin[1]
  177.  
  178. move_direction[0] = buttonadjust[0]*user_direction[0] + user_direction[1]*buttonadjust[1]
  179. move_direction[1] = buttonadjust[0]*user_direction[1] - user_direction[0]*buttonadjust[1]
  180. move_direction[2] = 0
  181.  
  182. velocity[0] += floatround(move_direction[0] * MOVEACCELERATION * DELTA_T / get_distance(null,move_direction))
  183. velocity[1] += floatround(move_direction[1] * MOVEACCELERATION * DELTA_T / get_distance(null,move_direction))
  184. }
  185.  
  186. if (buttonadjust[2]) gHookLenght[id] -= floatround(buttonadjust[2] * REELSPEED * DELTA_T)
  187. if (gHookLenght[id] < 100) gHookLenght[id] = 100
  188.  
  189. A[0] = gHookLocation[id][0] - user_origin[0]
  190. A[1] = gHookLocation[id][1] - user_origin[1]
  191. A[2] = gHookLocation[id][2] - user_origin[2]
  192.  
  193. D[0] = A[0]*A[2] / get_distance(null,A)
  194. D[1] = A[1]*A[2] / get_distance(null,A)
  195. D[2] = -(A[1]*A[1] + A[0]*A[0]) / get_distance(null,A)
  196.  
  197. acceleration = - global_gravity * D[2] / get_distance(null,D)
  198.  
  199. velocity_towards_A = (velocity[0] * A[0] + velocity[1] * A[1] + velocity[2] * A[2]) / get_distance(null,A)
  200. desired_velocity_towards_A = (get_distance(user_origin,gHookLocation[id]) - gHookLenght[id] /*- 10*/) * 4
  201.  
  202. if (get_distance(null,D)>10)
  203. {
  204. velocity[0] += floatround((acceleration * DELTA_T * D[0]) / get_distance(null,D))
  205. velocity[1] += floatround((acceleration * DELTA_T * D[1]) / get_distance(null,D))
  206. velocity[2] += floatround((acceleration * DELTA_T * D[2]) / get_distance(null,D))
  207. }
  208.  
  209. velocity[0] += ((desired_velocity_towards_A - velocity_towards_A) * A[0]) / get_distance(null,A)
  210. velocity[1] += ((desired_velocity_towards_A - velocity_towards_A) * A[1]) / get_distance(null,A)
  211. velocity[2] += ((desired_velocity_towards_A - velocity_towards_A) * A[2]) / get_distance(null,A)
  212.  
  213. kz_velocity_set(id, velocity)
  214. }
  215.  
  216. public hooktask(parm[])
  217. {
  218. new id = parm[0]
  219. new velocity[3]
  220.  
  221. if ( !gIsHooked[id] ) return
  222.  
  223. new user_origin[3],oldvelocity[3]
  224. parm[0] = id
  225.  
  226. if (!is_user_alive(id))
  227. {
  228. RopeRelease(id)
  229. return
  230. }
  231.  
  232. if (gBeamIsCreated[id] + BEAMLIFE/10 <= get_gametime())
  233. {
  234. beamentpoint(id)
  235. }
  236.  
  237. get_user_origin(id, user_origin)
  238. kz_velocity_get(id, oldvelocity)
  239. new distance=get_distance( gHookLocation[id], user_origin )
  240. if ( distance > 10 )
  241. {
  242. velocity[0] = floatround( (gHookLocation[id][0] - user_origin[0]) * ( 2.0 * REELSPEED / distance ) )
  243. velocity[1] = floatround( (gHookLocation[id][1] - user_origin[1]) * ( 2.0 * REELSPEED / distance ) )
  244. velocity[2] = floatround( (gHookLocation[id][2] - user_origin[2]) * ( 2.0 * REELSPEED / distance ) )
  245. }
  246. else
  247. {
  248. velocity[0]=0
  249. velocity[1]=0
  250. velocity[2]=0
  251. }
  252.  
  253. kz_velocity_set(id, velocity)
  254.  
  255. }
  256.  
  257. public hook_on(id)
  258. {
  259. if (get_cvar_num("sv_adminhook")==1)
  260. {
  261. if (gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E)) {
  262. if (!gIsHooked[id] && is_user_alive(id))
  263. {
  264. new cmd[32]
  265. read_argv(0,cmd,31)
  266. if(equal(cmd,"+rope")) RopeAttach(id,0)
  267. if(equal(cmd,"+hook")) RopeAttach(id,1)
  268. }
  269. }else{
  270. client_print(id,print_chat,"[%s] Nincs elerhetoseged hozza",gModName)
  271. return PLUGIN_HANDLED
  272. }
  273. }else{
  274. client_print(id,print_chat,"[%s] Ez a parancs ki van kapcsolva",gModName)
  275. }
  276. return PLUGIN_HANDLED
  277. }
  278.  
  279. public hook_off(id)
  280. {
  281. if (gAllowedHook[id] || (get_user_flags(id)&ADMIN_LEVEL_E)) {
  282. if (gIsHooked[id])
  283. {
  284. RopeRelease(id)
  285. }
  286. }else{
  287. client_print(id,print_chat,"[%s] Nincs elerhetoseged hozza",gModName)
  288. return PLUGIN_HANDLED
  289. }
  290. return PLUGIN_HANDLED
  291. }
  292.  
  293. public RopeAttach(id,hook)
  294. {
  295. new parm[1], user_origin[3]
  296. parm[0] = id
  297. gIsHooked[id] = true
  298. get_user_origin(id,user_origin)
  299. get_user_origin(id,gHookLocation[id], 3)
  300. gHookLenght[id] = get_distance(gHookLocation[id],user_origin)
  301. global_gravity = get_cvar_num("sv_gravity")
  302. set_user_gravity(id,0.001)
  303. beamentpoint(id)
  304. if (hook) set_task(DELTA_T, "hooktask", 200+id, parm, 1, "b")
  305. else set_task(DELTA_T, "ropetask", 200+id, parm, 1, "b")
  306. }
  307.  
  308. public RopeRelease(id)
  309. {
  310. gIsHooked[id] = false
  311. killbeam(id)
  312. set_user_gravity(id)
  313. remove_task(200+id)
  314. }
  315.  
  316. public beamentpoint(id)
  317. {
  318. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  319. write_byte( TE_BEAMENTPOINT )
  320. write_short( id )
  321. write_coord( gHookLocation[id][0] )
  322. write_coord( gHookLocation[id][1] )
  323. write_coord( gHookLocation[id][2] )
  324. write_short( beam ) // sprite index
  325. write_byte( 0 ) // start frame
  326. write_byte( 0 ) // framerate
  327. write_byte( BEAMLIFE ) // life
  328. write_byte( 10 ) // width
  329. write_byte( 0 ) // noise
  330. if (get_user_team(id)==1) // Terrorist
  331. {
  332. new r = random(256)
  333. new g = random(256)
  334. new b = random(256)
  335.  
  336. write_byte( r ) // r, g, b
  337. write_byte( g ) // r, g, b
  338. write_byte( b ) // r, g, b
  339. }
  340. else // Counter-Terrorist
  341. {
  342. new r = random(256)
  343. new g = random(256)
  344. new b = random(256)
  345.  
  346. write_byte( r ) // r, g, b
  347. write_byte( g ) // r, g, b
  348. write_byte( b ) // r, g, b
  349. }
  350. write_byte( 150 ) // brightness
  351. write_byte( 0 ) // speed
  352. message_end( )
  353. gBeamIsCreated[id] = get_gametime()
  354. }
  355.  
  356. public killbeam(id)
  357. {
  358. message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
  359. write_byte( TE_KILLBEAM )
  360. write_short( id )
  361. message_end()
  362. }
  363. public client_disconnect(id) {
  364. gAllowedHook[id]=0
  365. }
  366. #if USING_AMX
  367. stock get_user_button(id) return entity_get_int(id, EV_INT_button)
  368. #endif

_________________
Blasenkampfwagen

https://discord.gg/uBYnNnZP
GTA:PURSUIT MTA


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 13 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole