hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.05.22. 17:49



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: nincs regisztrált felhasználó 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  [ 2 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: surf Rush kezdőre
HozzászólásElküldve: 2013.05.26. 17:26 
Offline
Őskövület
Avatar

Csatlakozott: 2011.12.28. 00:35
Hozzászólások: 2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Hali.

Ezt, hogy lehetne úgy megcsinálni, hogy:
A surf szerón a kezdőnél legyen a rush vonal?
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <fun>
  4. #include <engine>
  5. #include <colorchat>
  6.  
  7. //Used for create_middle functions
  8. #define tag_sprite_size_horizontal 4000
  9. #define tag_sprite_size_vertical 600
  10. #define tag_sprite_vertical_increments 15
  11.  
  12. #define MINNUM 2
  13.  
  14. new bool:stopplugin
  15.  
  16. new beamsprite
  17.  
  18. new CTspawn_loc[3]
  19. new Tspawn_loc[3]
  20.  
  21. new plugin_enabled, plugin_fence, plugin_2ppl, plugin_checktime, plugin_redrawtime, plugin_fencecolor, plugin_fencealpha, plugin_punishment
  22.  
  23. new Float:farthest_point1[3]
  24. new Float:farthest_point2[3]
  25. new alivenum, maxplayers
  26.  
  27. new Float:oldtime
  28.  
  29. new multiplier
  30.  
  31. public plugin_init()
  32. {
  33. register_plugin("No Rush","2.0","GHW_Chronic")
  34.  
  35. plugin_enabled = register_cvar("NR_enabled","1")
  36. plugin_fence = register_cvar("NR_fence","1")
  37. plugin_2ppl = register_cvar("NR_twopeople","1")
  38. plugin_punishment = register_cvar("NR_punishment","1")
  39. plugin_checktime = register_cvar("NR_checktime","2.0")
  40. plugin_redrawtime = register_cvar("NR_redrawtime","15.0")
  41. plugin_fencecolor = register_cvar("NR_fencecolor","green")
  42. plugin_fencealpha = register_cvar("NR_fencealpha","200")
  43.  
  44. stopplugin=true
  45. new mapname[32]
  46. get_mapname(mapname,31)
  47. new configfile[200]
  48. get_configsdir(configfile,199)
  49. format(configfile,199,"%s/no_rush_maps.ini",configfile)
  50. if(file_exists(configfile))
  51. {
  52. new read[32], trash
  53. for(new i=0;i<file_size(configfile,1);i++)
  54. {
  55. read_file(configfile,i,read,31,trash)
  56. if(equali(mapname,read))
  57. {
  58. set_task(0.1,"spawn_locs")
  59. set_task(0.2,"create_middle1")
  60. oldtime = get_pcvar_float(plugin_redrawtime)
  61. stopplugin=false
  62. break;
  63. }
  64. }
  65. }
  66.  
  67. register_event("DeathMsg","checknum","a")
  68. register_event("ResetHUD","checknum","b")
  69.  
  70. maxplayers = get_maxplayers()
  71. }
  72.  
  73. public plugin_precache()
  74. {
  75. beamsprite = precache_model("sprites/dot.spr")
  76. }
  77.  
  78. public client_putinserver(id)
  79. {
  80. if(!stopplugin)
  81. {
  82. set_task(get_pcvar_float(plugin_checktime),"prethink",id,"",0,"b")
  83. }
  84. }
  85.  
  86. public client_disconnect(id)
  87. {
  88. remove_task(id)
  89. }
  90.  
  91. public checknum()
  92. {
  93. if(get_pcvar_num(plugin_enabled) && !stopplugin)
  94. {
  95. new newnum
  96. for(new i=0;i<=maxplayers;i++)
  97. {
  98. if(is_user_alive(i)) newnum++
  99. }
  100. if(alivenum>MINNUM && newnum<=MINNUM && get_pcvar_num(plugin_2ppl))
  101. {
  102. ColorChat(0, GREEN, "[Surf Rush] ^1Te most már át tudsz menni a másik oldalra, mivel csak^4 2 ember ^1maradt!")
  103. }
  104. alivenum=newnum
  105. }
  106. }
  107.  
  108. public prethink(id)
  109. {
  110. if(is_user_alive(id) && !stopplugin && get_pcvar_num(plugin_enabled) && !(alivenum<=MINNUM && get_pcvar_num(plugin_2ppl)) )
  111. {
  112. new origin[3]
  113. get_user_origin(id,origin)
  114. new team[32]
  115. get_user_team(id,team,31)
  116. new teamnum=1
  117. if(containi(team,"CT")!=-1 || containi(team,"Counter")!=-1)
  118. {
  119. teamnum=2
  120. }
  121. if( (get_distance(origin,CTspawn_loc)<get_distance(origin,Tspawn_loc) && teamnum==1) || (get_distance(origin,Tspawn_loc)<get_distance(origin,CTspawn_loc) && teamnum==2) )
  122. {
  123. if(get_pcvar_num(plugin_punishment)==1) user_kill(id)
  124. else
  125. {
  126. new origin[3]
  127. get_user_origin(id,origin)
  128. new Float:vector1[3]
  129. if(teamnum==2)
  130. {
  131. vector1[0] = float(CTspawn_loc[0]) - origin[0]
  132. vector1[1] = float(CTspawn_loc[1]) - origin[1]
  133. vector1[2] = float(CTspawn_loc[2]) - origin[2]
  134. }
  135. else
  136. {
  137. vector1[0] = float(Tspawn_loc[0]) - origin[0]
  138. vector1[1] = float(Tspawn_loc[1]) - origin[1]
  139. vector1[2] = float(Tspawn_loc[2]) - origin[2]
  140. }
  141. new Float:num = floatsqroot(250*250 / vector1[0]*vector1[0] + vector1[1]*vector1[1] + vector1[2]*vector1[2])
  142. vector1[0] *= num
  143. vector1[1] *= num
  144. vector1[2] *= num
  145. set_user_velocity(id,vector1)
  146. }
  147. ColorChat(id, GREEN, "[Surf Rush] ^1Ne ^4menj át ^1a másik oldalra!")
  148. }
  149. }
  150. }
  151.  
  152. public spawn_locs()
  153. {
  154. new ent1 = find_ent_by_class(0,"info_player_start")
  155. new ent2 = find_ent_by_class(0,"info_player_deathmatch")
  156. if(!ent1)
  157. {
  158. log_amx("No info_player_start found")
  159. stopplugin=true
  160. }
  161. if(!ent2)
  162. {
  163. log_amx("No info_player_deathmatch found")
  164. stopplugin=true
  165. }
  166. new Float:CTspawn_loc_F[3]
  167. new Float:Tspawn_loc_F[3]
  168. entity_get_vector(ent1,EV_VEC_origin,CTspawn_loc_F)
  169. entity_get_vector(ent2,EV_VEC_origin,Tspawn_loc_F)
  170. CTspawn_loc[0] = floatround(CTspawn_loc_F[0])
  171. CTspawn_loc[1] = floatround(CTspawn_loc_F[1])
  172. CTspawn_loc[2] = floatround(CTspawn_loc_F[2])
  173. Tspawn_loc[0] = floatround(Tspawn_loc_F[0])
  174. Tspawn_loc[1] = floatround(Tspawn_loc_F[1])
  175. Tspawn_loc[2] = floatround(Tspawn_loc_F[2])
  176. }
  177.  
  178. public create_middle1()
  179. {
  180. //***
  181. //Simple Algebra to calculate the location of the middle line(s).
  182. //***
  183.  
  184. new Float:CTspawn_loc_F[3]
  185. new Float:Tspawn_loc_F[3]
  186. IVecFVec(CTspawn_loc,CTspawn_loc_F)
  187. IVecFVec(Tspawn_loc,Tspawn_loc_F)
  188.  
  189. new Float:line1_slope = (CTspawn_loc_F[1] - Tspawn_loc_F[1]) / (CTspawn_loc_F[0] - Tspawn_loc_F[0])
  190. new Float:line2_slope = -1.0 * (1.0 / line1_slope)
  191.  
  192. new Float:midpoint[3]
  193. midpoint[0] = (CTspawn_loc_F[0] + Tspawn_loc_F[0]) / 2
  194. midpoint[1] = (CTspawn_loc_F[1] + Tspawn_loc_F[1]) / 2
  195. midpoint[2] = (CTspawn_loc_F[2] + Tspawn_loc_F[2]) / 2
  196.  
  197. if(floatabs(line2_slope)>1.0)
  198. {
  199. farthest_point1[1] = midpoint[1] + (tag_sprite_size_horizontal / 2)
  200. farthest_point2[1] = midpoint[1] - (tag_sprite_size_horizontal / 2)
  201.  
  202. farthest_point1[0] = (farthest_point1[1] - midpoint[1] + (line2_slope * midpoint[0])) / line2_slope
  203. farthest_point2[0] = (farthest_point2[1] - midpoint[1] + (line2_slope * midpoint[0])) / line2_slope
  204. }
  205.  
  206. if(floatabs(line2_slope)<=1.0)
  207. {
  208. farthest_point1[0] = midpoint[0] + (tag_sprite_size_horizontal / 2)
  209. farthest_point2[0] = midpoint[0] - (tag_sprite_size_horizontal / 2)
  210.  
  211. farthest_point1[1] = line2_slope*(farthest_point1[0]-midpoint[0]) + midpoint[1]
  212. farthest_point2[1] = line2_slope*(farthest_point2[0]-midpoint[0]) + midpoint[1]
  213. }
  214.  
  215. farthest_point1[2] = midpoint[2] - (tag_sprite_size_vertical / 2)
  216.  
  217. set_task(get_pcvar_float(plugin_redrawtime),"create_middle2",1337,"",0,"b")
  218. }
  219.  
  220. public create_middle2()
  221. {
  222. if(!stopplugin && get_pcvar_num(plugin_fence) && get_pcvar_num(plugin_enabled) && !(alivenum<=MINNUM && get_pcvar_num(plugin_2ppl)))
  223. {
  224. set_task(0.1,"create_middle3",0,"",0,"a",(tag_sprite_size_vertical / tag_sprite_vertical_increments))
  225. multiplier=1
  226. }
  227. if(oldtime!=get_pcvar_float(plugin_redrawtime))
  228. {
  229. remove_task(1337)
  230. set_task(get_pcvar_float(plugin_redrawtime),"create_middle1",1337,"",0,"b")
  231. oldtime=get_pcvar_float(plugin_redrawtime)
  232. }
  233. }
  234.  
  235. public create_middle3()
  236. {
  237. new zpoint = floatround(farthest_point1[2]) + (multiplier * tag_sprite_vertical_increments)
  238. multiplier++
  239. new color[32], red, green, blue
  240. get_pcvar_string(plugin_fencecolor,color,31)
  241. if(equali(color,"red"))
  242. {
  243. red=255
  244. green=0
  245. blue=0
  246. }
  247. else if(equali(color,"blue"))
  248. {
  249. red=0
  250. green=0
  251. blue=255
  252. }
  253. else if(equali(color,"white"))
  254. {
  255. red=255
  256. green=255
  257. blue=255
  258. }
  259. else if(equali(color,"random"))
  260. {
  261. red=random_num(0,255)
  262. green=random_num(0,255)
  263. blue=random_num(0,255)
  264. }
  265. else if(equali(color,"Yellow"))
  266. {
  267. red = 255
  268. green = 255
  269. blue = 0
  270. }
  271. else if(equali(color,"Orange"))
  272. {
  273. red = 255
  274. green = 128
  275. blue = 64
  276. }
  277. else if(equali(color,"Pink"))
  278. {
  279. red = 255
  280. green = 0
  281. blue = 128
  282. }
  283. else if(equali(color,"Indigo"))
  284. {
  285. red = 0
  286. green = 255
  287. blue = 255
  288. }
  289. else
  290. {
  291. red=0
  292. green=255
  293. blue=0
  294. }
  295.  
  296. message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  297. write_byte(0) //TE_BEAMPOINTS
  298. write_coord(floatround(farthest_point1[0]))
  299. write_coord(floatround(farthest_point1[1]))
  300. write_coord(zpoint)
  301. write_coord(floatround(farthest_point2[0]))
  302. write_coord(floatround(farthest_point2[1]))
  303. write_coord(zpoint)
  304. write_short(beamsprite)
  305. write_byte(1) // framestart
  306. write_byte(1) // framerate
  307. write_byte(get_pcvar_num(plugin_redrawtime) * 10)// life in 0.1's
  308. write_byte(5) // width
  309. write_byte(0) // noise
  310. write_byte(red) // red
  311. write_byte(green) // green
  312. write_byte(blue) // blue
  313. write_byte(get_pcvar_num(plugin_fencealpha))// brightness
  314. write_byte(0) // speed
  315. message_end()
  316. }

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: surf Rush kezdőre
HozzászólásElküldve: 2013.05.27. 18:09 
Offline
Jómunkásember

Csatlakozott: 2013.02.11. 16:06
Hozzászólások: 491
Megköszönt másnak: 96 alkalommal
Megköszönték neki: 50 alkalommal
Azzal a pluginnal nem érsz semmit, persze kell, de hogy ha különböző helyekre akarsz rusht, akkor vagy a rush.cor ba kell átirni a dolgokat, de az nem annyira könnyü.
de ha jól emlékszem, ezekbe az antirusher pluginokba benne van, hogy (say be ird) antirusher_menu és ott lehet huzni. de ha kell meg csinálom, mert értek ehhez, csak irj steamen, mivel skypeon letiltottalak XD

_________________
Rengeteg új beszólás eléréséhez kattints IDE (Ezek alapból sank soundshoz készültek)

Steam profil:
[steam]http://steamcommunity.com/profiles/76561198089487307[/steam]


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  [ 2 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 94 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