hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.04.27. 00:44



Jelenlévő felhasználók

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

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

Regisztrált felhasználók: Bing [Bot] 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  [ 11 hozzászólás ]  Oldal 1 2 Következő
Szerző Üzenet
 Hozzászólás témája: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.06. 09:53 
Offline
Senior Tag
Avatar

Csatlakozott: 2014.04.22. 10:54
Hozzászólások: 226
Megköszönték neki: 19 alkalommal
Sziasztok!

Érdekelne, hogy lehet e berakni Paintball módba új fegyvereket? Mindenbizonnyal a paintballgun.sma tartalmazza ezeket a dolgokat.
Szeretnék bele plusz dolgokat rakni, legtöbb dolog ZP-s fegyver.
Valaki segítene megcsinálni?

Plusz dolgok:
[ablak]http://hlmod.hu/viewtopic.php?f=101&t=12416
http://hlmod.hu/viewtopic.php?f=101&t=14247
http://hlmod.hu/viewtopic.php?f=101&t=15604
http://hlmod.hu/viewtopic.php?f=101&t=15603
http://hlmod.hu/viewtopic.php?f=101&t=12427
http://hlmod.hu/viewtopic.php?f=101&t=14509[/ablak]

Paintballgun.sma:
[ablak]
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <fakemeta>
  3. #include <hamsandwich>
  4. #include <cstrike>
  5. #include <fun>
  6.  
  7. #define PLUGIN "R Paintball Gun"
  8. #define VERSION "5.10"
  9. #define AUTHOR "Rul4 - WhooKid"
  10.  
  11. #define MAX_PAINTBALLS 200
  12. #define TASK_PB_RESET 1000
  13. #define TASK_RELOAD 2000
  14. #define TASK_NADE 5000
  15. #define CROSSHAIR_REMOVED ( 1<<6 )
  16.  
  17. #define PB_MARKER 1
  18. #define PB_USP 2
  19. #define PB_GLOCK 3
  20. #define PB_SNIPER 4
  21. #define PB_LAUNCHER 5
  22. #define PB_SHOTGUN 6
  23. #define PB_SUPERMARKER 7
  24.  
  25. new g_msgHideWeapon;
  26. new g_paintballs[MAX_PAINTBALLS], g_pbstatus[MAX_PAINTBALLS], g_pbcount, Float:lastshot[33], Float:nextattack[33], freezetime;
  27. new pbgun, color, shots, blife, sound, bglow, damage, friendlyfire, beamspr;
  28. new blood1, blood2, knife_ohk, jamon, pellets_real, pbslauncher;
  29.  
  30. new fire_rate_low, fire_rate_medium, fire_rate_high, jam_prob_low, jam_prob_high, gravity, speed_marker, speed_pistol, speed_shotgun, speed_sniper, dispersion, removecrosshair, speed_launcher, speed_smarker ;
  31.  
  32. static const g_shot_anim[8] = {0, 3, 9, 5, 1, 1, 1, 3};
  33. static const g_pbgun_models[11][] = {"models/v_pbgun.mdl", "models/v_pbgun1.mdl", "models/v_pbgun2.mdl", "models/v_pbgun3.mdl", "models/v_pbgun4.mdl", "models/v_pbgun5.mdl", "models/v_pbgun6.mdl", "models/v_pbgun7.mdl", "models/v_pbgun8.mdl", "models/v_pbgun9.mdl", "models/v_pbgun10.mdl"};
  34.  
  35. new g_Jammed[33];
  36.  
  37. public plugin_init()
  38. {
  39. register_plugin(PLUGIN, VERSION, AUTHOR);
  40. register_cvar("rpaintballgun", VERSION, FCVAR_SERVER|FCVAR_UNLOGGED);
  41. set_cvar_string("rpaintballgun", VERSION)
  42. register_clcmd("say /ent", "ent_info", ADMIN_SLAY);
  43. g_msgHideWeapon = get_user_msgid( "HideWeapon" );
  44.  
  45. if (get_pcvar_num(pbgun))
  46. {
  47. register_event("CurWeapon", "ev_curweapon", "be");
  48. register_logevent("ev_roundstart", 2, "0=World triggered", "1=Round_Start");
  49. if (get_cvar_num("mp_freezetime") > 0)
  50. register_event("HLTV", "ev_freezetime", "a", "1=0", "2=0");
  51.  
  52. register_forward(FM_Touch, "fw_touch");
  53. register_forward(FM_SetModel, "fw_setmodel");
  54. register_forward(FM_CmdStart, "fw_cmdstart");
  55. register_forward(FM_UpdateClientData, "fw_updateclientdata",1);
  56. if (get_pcvar_num(pbslauncher))
  57. register_forward(FM_Think, "fw_think");
  58.  
  59. RegisterHam ( Ham_TakeDamage, "player", "fwd_TakeDamage" );
  60.  
  61. RegisterHam (Ham_Weapon_Reload, "weapon_m3", "fw_reload", 1);
  62. RegisterHam (Ham_Weapon_Reload, "weapon_xm1014", "fw_reload", 1);
  63. RegisterHam (Ham_Weapon_Reload, "weapon_scout", "fw_reload", 1);
  64.  
  65. set_cvar_num ("sv_maxvelocity", 4000);
  66.  
  67. new a, max_ents_allow = global_get(glb_maxEntities) - 5;
  68. for (a = 1; a <= get_pcvar_num(shots); a++)
  69. if (a < MAX_PAINTBALLS)
  70. if (engfunc(EngFunc_NumberOfEntities) < max_ents_allow)
  71. {
  72. g_paintballs[a] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
  73. if (pev_valid(g_paintballs[a]))
  74. {
  75. set_pev(g_paintballs[a], pev_effects, pev(g_paintballs[a], pev_effects) | EF_NODRAW);
  76. g_pbcount++;
  77. }
  78. }
  79. if (g_pbcount < 1)
  80. set_fail_state("[AMXX] A Paintball mod betoltese sikertelen volt!");
  81.  
  82. server_print("*** %s v%s by %s Engedelyezve ***", PLUGIN, VERSION, AUTHOR);
  83. }
  84. }
  85.  
  86. public plugin_precache()
  87. {
  88. pbgun = register_cvar("amx_pbgun", "1");
  89. knife_ohk = register_cvar("amx_knifeonehitkill", "1");
  90. jamon = register_cvar("amx_pbgun_jam","1");
  91.  
  92. friendlyfire = get_cvar_pointer("mp_friendlyfire");
  93.  
  94. if (get_pcvar_num(pbgun)) {
  95.  
  96. color = register_cvar("pbgun_color", "1");
  97. shots = register_cvar("pbgun_shots", "100");
  98. blife = register_cvar("pbgun_life", "15");
  99. sound = register_cvar("pbgun_sound", "1");
  100. bglow = register_cvar("pbgun_glow", "c");
  101. damage = register_cvar("pbgun_damage", "100");
  102.  
  103. fire_rate_low = register_cvar("pbgun_fireratelow", "1.1");
  104. fire_rate_high = register_cvar("pbgun_fireratehigh", "0.16");
  105. fire_rate_medium = register_cvar("pbgun_fireratemedium", "0.7");
  106. jam_prob_low = register_cvar("pbgun_jamproblow", "30");
  107. jam_prob_high = register_cvar("pbgun_jamprobhigh", "100");
  108. gravity = register_cvar("pbgun_gravity", "1");
  109. speed_marker = register_cvar("pbgun_velocity_marker", "2000");
  110. speed_smarker = register_cvar("pbgun_velocity_super_marker", "2500");
  111. speed_pistol = register_cvar("pbgun_velocity_pistol", "1500");
  112. speed_launcher = register_cvar("pbgun_velocity_launcher", "1500");
  113. speed_shotgun = register_cvar("pbgun_velocity_shotgun", "1500");
  114. speed_sniper = register_cvar("pbgun_velocity_sniper", "4000");
  115. dispersion = register_cvar("pbgun_dispersion", "100");
  116. removecrosshair = register_cvar("pbgun_nocrosshair", "1");
  117. pellets_real = register_cvar("pbgun_real_pellets", "1");
  118. pbslauncher = register_cvar("pbgun_pbslauncher", "1");
  119.  
  120. precache_model(g_pbgun_models[3]);
  121. precache_model(g_pbgun_models[7]);
  122. precache_model("models/v_pbgun1.mdl");
  123. precache_model("models/v_pbgun6.mdl");
  124. precache_model("models/p_pbgun.mdl");
  125. precache_model("models/p_pbgun1.mdl");
  126. precache_model("models/w_pbgun.mdl");
  127. precache_model("models/v_pb_sniper.mdl");
  128. precache_model("models/p_pb_sniper.mdl");
  129. precache_model("models/w_pb_sniper.mdl");
  130. precache_model("models/v_pb_shotgun.mdl");
  131. precache_model("models/p_pb_shotgun.mdl");
  132. precache_model("models/w_pb_shotgun.mdl");
  133. precache_model("models/v_pb_launcher.mdl");
  134. precache_model("models/w_pb_launcher.mdl");
  135. precache_model("models/p_pb_launcher.mdl");
  136. precache_model("models/w_pb_launch_he.mdl");
  137. precache_model("models/p_pb_knife.mdl");
  138. precache_model("models/v_pb_knife.mdl");
  139. precache_model("models/v_pb_superlauncher.mdl");
  140. precache_model("models/w_pb_supernade.mdl");
  141. blood1 = precache_model("sprites/blood.spr");
  142. blood2 = precache_model("sprites/bloodspray.spr");
  143. precache_model("models/v_pbusp.mdl");
  144. precache_model("models/p_pbusp.mdl");
  145. precache_model("models/v_pbglock.mdl");
  146. precache_model("models/p_pbglock.mdl");
  147.  
  148. precache_sound("misc/pb1.wav");
  149. precache_sound("misc/pb2.wav");
  150. precache_sound("misc/pb3.wav");
  151. precache_sound("misc/pb4.wav");
  152. precache_sound("misc/pbg.wav");
  153. precache_sound("misc/pb_launcher.wav");
  154. precache_model("models/w_paintball.mdl");
  155. precache_model("sprites/paintball.spr");
  156. precache_sound("weapons/scout_fire-1.wav");
  157. precache_sound("weapons/dryfire_pistol.wav");
  158. precache_sound("weapons/scout_bolt.wav");
  159. precache_sound("weapons/draw.wav");
  160. precache_sound("weapons/insert.wav");
  161. precache_sound("weapons/magin.wav");
  162. precache_sound("weapons/magout.wav");
  163. precache_sound("weapons/magrel.wav");
  164. precache_sound("weapons/pullout.wav");
  165. precache_sound("weapons/roll.wav");
  166. }
  167. beamspr = precache_model("sprites/laserbeam.spr");
  168. }
  169.  
  170. public ent_info(id)
  171. client_print(id, print_chat, "[AMXX] Paintball: (%d/%d) : (%d/%d)", g_pbcount, get_pcvar_num(shots), engfunc(EngFunc_NumberOfEntities), global_get(glb_maxEntities));
  172.  
  173. public ev_curweapon(id)
  174. {
  175. //replace the weapon model with the PB model
  176. new model[25];
  177. pev(id, pev_viewmodel2, model, 24);
  178. if (equali(model, "models/v_mp5.mdl") && get_pcvar_num(pbgun))
  179. {
  180. set_pev(id, pev_viewmodel2, (get_user_team(id) == 1) ? g_pbgun_models[3] : g_pbgun_models[7]);
  181. set_pev(id, pev_weaponmodel2, "models/p_pbgun1.mdl");
  182. }
  183. else if (equali(model, "models/v_usp.mdl") && get_pcvar_num(pbgun))
  184. {
  185. set_pev(id, pev_viewmodel2, "models/v_pbusp.mdl");
  186. set_pev(id, pev_weaponmodel2, "models/p_pbusp.mdl");
  187. }
  188. else if (equali(model, "models/v_glock18.mdl") && get_pcvar_num(pbgun))
  189. {
  190. set_pev(id, pev_viewmodel2, "models/v_pbglock.mdl");
  191. set_pev(id, pev_weaponmodel2, "models/p_pbglock.mdl");
  192. }else if (equali(model, "models/v_scout.mdl") && get_pcvar_num(pbgun))
  193. {
  194. set_pev(id, pev_viewmodel2, "models/v_pb_sniper.mdl");
  195. set_pev(id, pev_weaponmodel2, "models/p_pb_sniper.mdl");
  196. }else if (equali(model, "models/v_m3.mdl") && get_pcvar_num(pbgun))
  197. {
  198. set_pev(id, pev_viewmodel2, "models/v_pb_launcher.mdl");
  199. set_pev(id, pev_weaponmodel2, "models/p_pb_launcher.mdl");
  200. }else if (equali(model, "models/v_knife.mdl") && get_pcvar_num(pbgun))
  201. {
  202. set_pev(id, pev_viewmodel2, "models/v_pb_knife.mdl");
  203. set_pev(id, pev_weaponmodel2, "models/p_pb_knife.mdl");
  204. }else if (equali(model, "models/v_p90.mdl") && get_pcvar_num(pbgun))
  205. {
  206. set_pev(id, pev_viewmodel2, (get_user_team(id) == 1) ? "models/v_pbgun1.mdl" : "models/v_pbgun6.mdl" );
  207.  
  208. set_pev(id, pev_weaponmodel2, "models/p_pbgun1.mdl");
  209. }else if (equali(model, "models/v_xm1014.mdl") && get_pcvar_num(pbgun))
  210. {
  211. set_pev(id, pev_viewmodel2, "models/v_pb_shotgun.mdl");
  212. set_pev(id, pev_weaponmodel2, "models/p_pb_shotgun.mdl");
  213. }else if (equali(model, "models/v_flashbang.mdl") && get_pcvar_num(pbgun) && get_pcvar_num(pbslauncher))
  214. {
  215. set_pev(id, pev_viewmodel2, "models/v_pb_superlauncher.mdl");
  216. set_pev(id, pev_weaponmodel2, "models/p_pb_shotgun.mdl");
  217. }
  218.  
  219. new my_pbgun = user_has_pbgun(id);
  220. if (my_pbgun){
  221.  
  222. if (get_pcvar_num(removecrosshair))
  223. {
  224. //Remove the crosshair
  225. message_begin( MSG_ONE_UNRELIABLE, g_msgHideWeapon, _, id );
  226. write_byte( CROSSHAIR_REMOVED );
  227. message_end();
  228. }
  229.  
  230. }
  231. }
  232.  
  233. public fw_setmodel(ent, model[])
  234. {
  235. //replace dropped models with PB models
  236. if (equali(model, "models/w_mp5.mdl") || equali(model, "models/w_p90.mdl"))
  237. if (get_pcvar_num(pbgun))
  238. {
  239. engfunc(EngFunc_SetModel, ent, "models/w_pbgun.mdl");
  240.  
  241. return FMRES_SUPERCEDE;
  242. }
  243. if (equali(model, "models/w_scout.mdl"))
  244. if (get_pcvar_num(pbgun))
  245. {
  246. engfunc(EngFunc_SetModel, ent, "models/w_pb_sniper.mdl");
  247.  
  248. return FMRES_SUPERCEDE;
  249. }
  250. if (equali(model, "models/w_m3.mdl"))
  251. if (get_pcvar_num(pbgun))
  252. {
  253. engfunc(EngFunc_SetModel, ent, "models/w_pb_launcher.mdl");
  254.  
  255. return FMRES_SUPERCEDE;
  256. }
  257. if (equali(model, "models/w_xm1014.mdl"))
  258. if (get_pcvar_num(pbgun))
  259. {
  260. engfunc(EngFunc_SetModel, ent, "models/w_pb_shotgun.mdl");
  261.  
  262. return FMRES_SUPERCEDE;
  263. }
  264. if (equali(model, "models/w_flashbang.mdl") && get_pcvar_num(pbslauncher))
  265. if (get_pcvar_num(pbgun))
  266. {
  267. engfunc(EngFunc_SetModel, ent, "models/w_pb_supernade.mdl");
  268.  
  269. return FMRES_SUPERCEDE;
  270. }
  271.  
  272. return FMRES_IGNORED;
  273. }
  274.  
  275. public fw_updateclientdata(id, sw, cd_handle)
  276. {
  277. //this function overrides the client side sounds and stuff
  278. if (user_has_pbgun(id) && cd_handle)
  279. {
  280.  
  281. set_cd(cd_handle, CD_ID, 1);
  282. get_cd(cd_handle, CD_flNextAttack, nextattack[id]);
  283.  
  284. return FMRES_HANDLED;
  285.  
  286. }
  287. return FMRES_IGNORED;
  288. }
  289.  
  290. public fw_reload(weapon)
  291. {
  292. new id = pev(weapon, pev_owner)
  293. new ammo, null = get_user_weapon(id, ammo, null);
  294. new my_pbgun = user_has_pbgun(id)
  295.  
  296. if ((my_pbgun == PB_LAUNCHER && ammo < 8) || (my_pbgun == PB_SHOTGUN && ammo < 7) || (my_pbgun == PB_SNIPER && ammo < 10))
  297. {
  298. lastshot[id] = get_gametime();
  299. set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 1.0, 1.0);
  300. show_hudmessage(id, "Fegyver ujratoltes...");
  301.  
  302. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id);
  303. write_byte(3);
  304. write_byte(0);
  305. message_end();
  306. }
  307. }
  308.  
  309. public try_to_jam(id, my_pbgun){
  310.  
  311. //chance of jamming the current weapon
  312. if(get_pcvar_num(jamon) && !g_Jammed[id] && my_pbgun != PB_GLOCK && my_pbgun != PB_USP && !is_user_bot(id))
  313. {
  314. new average_usage_jam;
  315.  
  316. switch (my_pbgun)
  317. {
  318. case PB_MARKER: average_usage_jam = get_pcvar_num(jam_prob_high);
  319. case PB_GLOCK: average_usage_jam = get_pcvar_num(jam_prob_high);
  320. case PB_USP: average_usage_jam = get_pcvar_num(jam_prob_high);
  321. case PB_SNIPER: average_usage_jam = get_pcvar_num(jam_prob_low);
  322. case PB_LAUNCHER: average_usage_jam = get_pcvar_num(jam_prob_low);
  323. case PB_SHOTGUN: average_usage_jam = get_pcvar_num(jam_prob_low);
  324. case PB_SUPERMARKER: average_usage_jam = get_pcvar_num(jam_prob_high) * 2;
  325. default: average_usage_jam = get_pcvar_num(jam_prob_high);
  326. }
  327.  
  328. new jam = (random(average_usage_jam)==0);
  329. if(jam)
  330. {
  331. emit_sound(id,CHAN_AUTO, "weapons/dryfire_pistol.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  332. g_Jammed[id] = my_pbgun;
  333. }
  334. }
  335.  
  336. }
  337.  
  338. public fw_cmdstart( id, uc_handle, random_seed )
  339. {
  340. if ( !is_user_alive( id ) )
  341. return FMRES_IGNORED
  342.  
  343. static buttons; buttons = get_uc( uc_handle, UC_Buttons )
  344. new my_pbgun = user_has_pbgun(id);
  345.  
  346. //if jammed, clear the chamber
  347. if ( buttons & IN_USE && my_pbgun == g_Jammed[id] && my_pbgun && get_pcvar_num(jamon))
  348. clear_chamber(id);
  349.  
  350. //if he is shooting with a PBGUN
  351. if ( buttons & IN_ATTACK && my_pbgun)
  352. {
  353. //check if weapon is jammed
  354. if(g_Jammed[id] == my_pbgun && !is_user_bot(id) && get_pcvar_num(jamon))
  355. {
  356. weapon_jam(id, uc_handle);
  357. return FMRES_IGNORED;
  358. }
  359.  
  360. set_uc (uc_handle, UC_Buttons, buttons & ~IN_ATTACK);
  361.  
  362. new ammo, null = get_user_weapon(id, ammo, null);
  363. if (ammo)
  364. {
  365. new Float:gametime = get_gametime(), Float:g_speed;
  366.  
  367. switch (my_pbgun)
  368. {
  369. case PB_MARKER: g_speed = get_pcvar_float(fire_rate_high);
  370. case PB_GLOCK: g_speed = get_pcvar_float(fire_rate_high);
  371. case PB_USP: g_speed = get_pcvar_float(fire_rate_high);
  372. case PB_SNIPER: g_speed = get_pcvar_float(fire_rate_low);
  373. case PB_LAUNCHER: g_speed = get_pcvar_float(fire_rate_low);
  374. case PB_SHOTGUN: g_speed = get_pcvar_float(fire_rate_medium);
  375. case PB_SUPERMARKER: g_speed = get_pcvar_float(fire_rate_high)/2.0;
  376. default: g_speed = get_pcvar_float(fire_rate_high);
  377. }
  378.  
  379. new cangofull = (my_pbgun == PB_MARKER || my_pbgun == PB_LAUNCHER || my_pbgun == PB_SHOTGUN || my_pbgun == PB_SUPERMARKER);
  380.  
  381. //check that the button was not pressed before or that the weapon can go full-auto
  382. new auto = !(pev(id, pev_oldbuttons) & IN_ATTACK) || cangofull;
  383.  
  384. //check the fire-rate and freezetime
  385. if (gametime-lastshot[id] > g_speed && (is_user_bot(id) || nextattack[id] < 0.0) && !freezetime && auto)
  386. {
  387.  
  388. new fired;
  389.  
  390. if (my_pbgun == PB_SHOTGUN)
  391. { //shoot 5 pellets
  392. for (new a = 0; a < 5; a++)
  393. fired = paint_fire(id, a) || fired;
  394. }
  395. else //shoot 1 pellet
  396. fired = paint_fire(id, 0);
  397.  
  398. if (fired)
  399. {
  400.  
  401. lastshot[id] = gametime;
  402. set_user_clip(id, ammo - 1);
  403.  
  404. //show the animation
  405. set_pev(id, pev_punchangle, Float:{-0.5, 0.0, 0.0});
  406. message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, _, id);
  407. write_byte(g_shot_anim[my_pbgun]);
  408. write_byte(0);
  409. message_end();
  410.  
  411. //shooting sound
  412. if (get_pcvar_num(sound))
  413. if (my_pbgun != PB_SNIPER)
  414. if (my_pbgun != PB_LAUNCHER)
  415. emit_sound(id, CHAN_AUTO, "misc/pbg.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  416. else
  417. emit_sound(id, CHAN_AUTO, "misc/pb_launcher.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  418. else
  419. emit_sound(id, CHAN_AUTO, "weapons/scout_fire-1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  420.  
  421. try_to_jam(id,my_pbgun)
  422.  
  423. }
  424. }
  425.  
  426. }
  427. return FMRES_IGNORED;
  428. }
  429.  
  430. return FMRES_IGNORED
  431. }
  432.  
  433. public paint_fire(id, num)
  434. {
  435. new a, ent;
  436. while (a++ < g_pbcount - 1 && !ent)
  437. if (g_pbstatus[a] == 0)
  438. ent = g_pbstatus[a] = g_paintballs[a];
  439. if (!ent)
  440. while (a-- > 1 && !ent)
  441. if (g_pbstatus[a] == 2)
  442. ent = g_pbstatus[a] = g_paintballs[a];
  443.  
  444. if (pev_valid(ent) && is_user_alive(id))
  445. {
  446. new Float:vangles[3], Float:nvelocity[3], Float:voriginf[3], vorigin[3], clr;
  447. set_pev(ent, pev_owner, id);
  448.  
  449. new my_pbgun = user_has_pbgun(id);
  450.  
  451. if (my_pbgun != PB_LAUNCHER) { //create a pellet
  452. set_pev(ent, pev_classname, "pbBullet");
  453. engfunc(EngFunc_SetModel, ent, "models/w_paintball.mdl");
  454.  
  455.  
  456. if (my_pbgun == PB_SHOTGUN) //make them smaller to avoid creation collisions
  457. engfunc(EngFunc_SetSize, ent, Float:{0.0, 0.0, 0.0}, Float:{1.0, 1.0, 1.0});
  458. else
  459. engfunc(EngFunc_SetSize, ent, Float:{-1.0, -1.0, -1.0}, Float:{1.0, 1.0, 1.0});
  460.  
  461. switch (get_pcvar_num(color))
  462. {
  463. case 2: clr = (get_user_team(id) == 1) ? 0 : 1;
  464. case 3: clr = (get_user_team(id) == 1) ? 4 : 3;
  465. case 4: clr = (get_user_team(id) == 1) ? 2 : 5;
  466. default: clr = random_num(0, 6);
  467. }
  468. set_pev(ent, pev_skin, clr);
  469.  
  470. set_pev(ent, pev_gravity, 0.5);
  471. }else
  472. { //create a nade
  473. set_pev(ent, pev_classname, "pbExplosive");
  474. engfunc(EngFunc_SetModel, ent, "models/w_pb_launch_he.mdl");
  475. engfunc(EngFunc_SetSize, ent, Float:{-3.0, -3.0, -3.0}, Float:{3.0, 3.0, 3.0});
  476.  
  477. set_pev(ent, pev_gravity, 1.0);
  478. }
  479. get_user_origin(id, vorigin, 1);
  480.  
  481. if (my_pbgun == PB_SHOTGUN)
  482. { //avoid creation collisions
  483. vorigin[0] += random(5)-2;
  484. vorigin[1] += random(5)-2;
  485. vorigin[2] += num*5
  486. }
  487. IVecFVec(vorigin, voriginf);
  488. engfunc(EngFunc_SetOrigin, ent, voriginf);
  489.  
  490. vangles[0] = random_float(-180.0, 180.0);
  491. vangles[1] = random_float(-180.0, 180.0);
  492. set_pev(ent, pev_angles, vangles);
  493.  
  494. pev(id, pev_v_angle, vangles);
  495. set_pev(ent, pev_v_angle, vangles);
  496. pev(id, pev_view_ofs, vangles);
  497. set_pev(ent, pev_view_ofs, vangles);
  498.  
  499. new veloc;
  500.  
  501. if (get_pcvar_num(gravity))
  502. set_pev(ent, pev_movetype, MOVETYPE_BOUNCE);
  503. else
  504. set_pev(ent, pev_movetype, MOVETYPE_FLY);
  505. set_pev(ent, pev_solid, 2);
  506.  
  507.  
  508. //Different guns shoot at different speeds
  509. switch (my_pbgun)
  510. {
  511. case PB_MARKER: veloc = get_pcvar_num(speed_marker);
  512. case PB_GLOCK: veloc = get_pcvar_num(speed_pistol);
  513. case PB_USP: veloc = get_pcvar_num(speed_pistol);
  514. case PB_SNIPER: veloc = get_pcvar_num(speed_sniper);
  515. case PB_LAUNCHER: veloc = get_pcvar_num(speed_launcher);
  516. case PB_SHOTGUN: veloc = get_pcvar_num(speed_shotgun);
  517. case PB_SUPERMARKER: veloc = get_pcvar_num(speed_smarker);
  518. default: veloc = get_pcvar_num(speed_pistol);
  519. }
  520.  
  521. velocity_by_aim(id, veloc, nvelocity);
  522.  
  523. //Fix aim for bots
  524. if (is_user_bot(id))
  525. switch (my_pbgun)
  526. {
  527. case PB_MARKER: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0;
  528. case PB_GLOCK: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0;
  529. case PB_USP: nvelocity[2] += (get_pcvar_num(gravity))? 200 : 0;
  530. case PB_SNIPER: nvelocity[2] += (get_pcvar_num(gravity))? 35 : 0;
  531. case PB_LAUNCHER: nvelocity[2] += 250;
  532. case PB_SHOTGUN: nvelocity[2] += (get_pcvar_num(gravity))? 50 : 0;
  533. case PB_SUPERMARKER: nvelocity[2] += (get_pcvar_num(gravity))? 100 : 0;
  534. default: nvelocity[2] += (get_pcvar_num(gravity))? 150 : 0;
  535. }
  536.  
  537. //Recoil!!!
  538. if (cs_get_user_zoom(id)== CS_SET_NO_ZOOM){
  539. //the sniper will shoot terribly bad without a scope
  540. new modifier = (my_pbgun != PB_SNIPER)? 1 : 5;
  541.  
  542. new buttons = pev(id, pev_button);
  543.  
  544. if (my_pbgun == PB_SHOTGUN)
  545. modifier = 2;
  546. else //shoot worse while moving
  547. if (buttons & IN_JUMP || buttons & IN_FORWARD || buttons & IN_BACK || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT)
  548. modifier *= 2;
  549.  
  550. new disp = get_pcvar_num(dispersion);
  551. nvelocity[0] += (random(disp)-disp/2) * modifier;
  552. nvelocity[1] += (random(disp)-disp/2) * modifier;
  553. nvelocity[2] += (random(disp)-disp/2) * modifier;
  554. }
  555.  
  556. set_pev(ent, pev_velocity, nvelocity);
  557. set_pev(ent, pev_effects, pev(ent, pev_effects) & ~EF_NODRAW);
  558.  
  559. //glow
  560. set_task(0.1, "paint_glow", ent);
  561.  
  562. if (my_pbgun != PB_LAUNCHER) //make it dissapear after a while
  563. set_task(15.0 , "paint_reset", ent+TASK_PB_RESET);
  564. else //make it explode if there is no impact
  565. set_task(2.0, "time_explode", ent+TASK_PB_RESET);
  566. }
  567.  
  568. return ent;
  569. }
  570.  
  571. public fw_touch(bullet, ent)
  572. {
  573. new class[20];
  574. pev(bullet, pev_classname, class, 19);
  575.  
  576. if (!equali(class, "pbBullet")&&!equali(class, "pbHarmlessBullet")&&!equali(class, "pbExplosive"))
  577. return FMRES_IGNORED;
  578.  
  579. new owner = pev(bullet, pev_owner);
  580.  
  581. new Float:origin[3], class2[20], is_ent_alive = is_user_alive(ent);
  582. pev(ent, pev_classname, class2, 19);
  583. pev(bullet, pev_origin, origin);
  584.  
  585.  
  586. if (equali(class, "pbExplosive")){ //it is a nade
  587. new Float:gametime = get_gametime();
  588.  
  589. //if it hits something after this time, explode
  590. if (gametime-lastshot[owner] > 0.5){
  591. act_explode(bullet);
  592.  
  593. set_pev(bullet, pev_velocity, Float:{0.0, 0.0, 0.0});
  594. set_pev(bullet, pev_classname, "pbPaint");
  595. set_pev(bullet, pev_solid, 0);
  596. set_pev(bullet, pev_movetype, 0);
  597. engfunc(EngFunc_SetModel, bullet, "sprites/paintball.spr");
  598.  
  599. new a, findpb = 0;
  600. while (a++ < g_pbcount && !findpb)
  601. if (g_paintballs[a] == bullet)
  602. findpb = g_pbstatus[a] = 2;
  603. remove_task(bullet);
  604. remove_task(bullet+TASK_PB_RESET);
  605. paint_reset(bullet+TASK_PB_RESET);
  606. return FMRES_HANDLED;
  607. }
  608. else if (!equali(class2, "pbBullet")&&!equali(class2, "pbHarmlessBullet")&&get_pcvar_num(gravity)){
  609.  
  610. //make it bounce and loose some velocity
  611. new Float:vel[3];
  612. pev(bullet,pev_velocity,vel);
  613.  
  614. vel[0] /= 5.0;
  615. vel[1] /= 5.0;
  616. vel[2] /= 5.0;
  617.  
  618. set_pev(bullet, pev_velocity, vel);
  619.  
  620. if (!is_ent_alive) //make damage to world stuff
  621. ExecuteHam(Ham_TakeDamage, ent, owner, owner, get_pcvar_float(damage), 4098);
  622.  
  623.  
  624. return FMRES_IGNORED;
  625. }
  626. }
  627.  
  628. //The bullet hits or bounces
  629. new hit;
  630. hit = random(5);
  631.  
  632. if (is_ent_alive) //make damage
  633. {
  634. if (owner == ent || pev(ent, pev_takedamage) == DAMAGE_NO)
  635. return FMRES_IGNORED;
  636. if (get_user_team(owner) == get_user_team(ent))
  637. if (!get_pcvar_num(friendlyfire))
  638. return FMRES_IGNORED;
  639.  
  640. if (hit != 0 && !equali(class, "pbHarmlessBullet"))
  641. ExecuteHam(Ham_TakeDamage, ent, owner, owner, get_pcvar_float(damage), 4098);
  642. }
  643.  
  644. if (!equali(class2, "pbBullet")&&!equali(class2, "pbHarmlessBullet"))
  645. if (hit != 0 || !get_pcvar_num(pellets_real))
  646. { //stop the pellet and make a splat
  647. set_pev(bullet, pev_velocity, Float:{0.0, 0.0, 0.0});
  648. set_pev(bullet, pev_classname, "pbPaint");
  649. set_pev(bullet, pev_solid, 0);
  650. set_pev(bullet, pev_movetype, 0);
  651. engfunc(EngFunc_SetModel, bullet, "sprites/paintball.spr");
  652.  
  653. new a, findpb = 0;
  654. while (a++ < g_pbcount && !findpb)
  655. if (g_paintballs[a] == bullet)
  656. findpb = g_pbstatus[a] = 2;
  657.  
  658. remove_task(bullet);
  659. remove_task(bullet+TASK_PB_RESET);
  660.  
  661. if (get_pcvar_num(sound))
  662. {
  663. static wav[20];
  664. formatex(wav, 20, is_ent_alive ? "player/pl_pain%d.wav" : "misc/pb%d.wav", is_ent_alive ? random_num(4,7) : random_num(1,4));
  665. emit_sound(bullet, CHAN_AUTO, wav, 1.0, ATTN_NORM, 0, PITCH_NORM);
  666. }
  667.  
  668. new bool:valid_surface = (is_ent_alive || containi(class2, "door") != -1) ? false : true;
  669. if (pev(ent, pev_health) && !is_ent_alive)
  670. {
  671. ExecuteHam(Ham_TakeDamage, ent, owner, owner, float(pev(ent, pev_health)), 0);
  672. valid_surface = false;
  673. }
  674. if (valid_surface)
  675. {
  676. paint_splat(bullet);
  677. set_task(float(get_pcvar_num(blife)), "paint_reset", bullet+TASK_PB_RESET);
  678. }
  679. else
  680. paint_reset(bullet+TASK_PB_RESET);
  681.  
  682. return FMRES_HANDLED;
  683. }else
  684. { //the pellet bounces, reduce its speed
  685. if (get_pcvar_num(gravity)){
  686. new Float:vel[3];
  687. pev(bullet,pev_velocity,vel);
  688.  
  689. vel[0] /= 10.0;
  690. vel[1] /= 10.0;
  691. vel[2] /= 10.0;
  692. set_pev(bullet, pev_velocity, vel);
  693. }
  694. //A bullet that bounces becomes harmless to players
  695. set_pev(bullet, pev_classname, "pbHarmlessBullet");
  696. return FMRES_IGNORED;
  697. }
  698. /*else
  699. {
  700. paint_reset(bullet+TASK_PB_RESET);
  701. return FMRES_HANDLED;
  702. }
  703. */
  704.  
  705. return FMRES_IGNORED;
  706. }
  707.  
  708. //for the super launcher
  709. public fw_think(ent)
  710. {
  711. new model[35];
  712. pev(ent, pev_model, model, 34);
  713.  
  714. if (!equali(model, "models/w_pb_supernade.mdl"))
  715. return FMRES_IGNORED;
  716.  
  717. if(!is_user_alive(pev(ent, pev_owner)))
  718. return FMRES_IGNORED;
  719.  
  720. set_task(1.6, "act_superboom", ent);
  721.  
  722. return FMRES_SUPERCEDE;
  723. }
  724.  
  725. public act_superboom(ent)
  726. {
  727. for (new a = 0; a < 10; a++)
  728. set_task(0.1 + a*0.2, "launch_nade", ent + TASK_NADE);
  729.  
  730. set_task(2.5, "remove_nade", ent + TASK_NADE);
  731.  
  732. }
  733.  
  734. public remove_nade(ent)
  735. {
  736. remove_task (ent)
  737. ent -= TASK_NADE
  738. act_explode(ent);
  739. engfunc(EngFunc_RemoveEntity, ent);
  740.  
  741. }
  742.  
  743. public launch_nade(param)
  744. {
  745. new spawnent = param - TASK_NADE
  746.  
  747. new a, ent;
  748. while (a++ < g_pbcount - 1 && !ent)
  749. if (g_pbstatus[a] == 0)
  750. ent = g_pbstatus[a] = g_paintballs[a];
  751. if (!ent)
  752. while (a-- > 1 && !ent)
  753. if (g_pbstatus[a] == 2)
  754. ent = g_pbstatus[a] = g_paintballs[a];
  755.  
  756. if (pev_valid(ent)&&pev_valid(spawnent))
  757. {
  758. new Float:nvelocity[3], vorigin[3];
  759. set_pev(ent, pev_owner, pev(spawnent, pev_owner));
  760.  
  761. //create a nade
  762. set_pev(ent, pev_classname, "pbExplosive");
  763. engfunc(EngFunc_SetModel, ent, "models/w_pb_launch_he.mdl");
  764. engfunc(EngFunc_SetSize, ent, Float:{-3.0, -3.0, -3.0}, Float:{3.0, 3.0, 3.0});
  765.  
  766. set_pev(ent, pev_gravity, 1.0);
  767.  
  768. pev(spawnent,pev_origin, vorigin)
  769. vorigin[2] += 30
  770. set_pev(ent, pev_origin, vorigin)
  771.  
  772. //IVecFVec(vorigin, voriginf);
  773. //engfunc(EngFunc_SetOrigin, ent, vorigin);
  774.  
  775. set_pev(ent, pev_movetype, MOVETYPE_BOUNCE);
  776.  
  777. set_pev(ent, pev_solid, 2);
  778.  
  779. nvelocity[0] = random_float(-200.0, 200.0);
  780. nvelocity[1] = random_float(-200.0, 200.0);
  781. nvelocity[2] = 500.0;
  782.  
  783. set_pev(ent, pev_velocity, nvelocity);
  784. set_pev(ent, pev_effects, pev(ent, pev_effects) & ~EF_NODRAW);
  785.  
  786. set_task(2.0, "time_explode", ent+TASK_PB_RESET);
  787. }
  788.  
  789. return ent;
  790. }
  791.  
  792.  
  793. public act_explode(ent)
  794. {
  795. new origin[3], Float:forigin[3], colors[4], owner = pev(ent, pev_owner), user_team = get_user_team(owner);
  796.  
  797. colors = (user_team == 1) ? { 255, 0, 247, 70} : { 0, 255, 208, 30};
  798. pev(ent, pev_origin, forigin);
  799. FVecIVec(forigin, origin);
  800.  
  801. new id, Float:distance = 150.0, Float:porigin[3];
  802.  
  803. new MaxPlayers = get_maxplayers();
  804.  
  805. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  806. write_byte(TE_BLOODSPRITE);
  807. write_coord(origin[0]);
  808. write_coord(origin[1]);
  809. write_coord(origin[2] + 20);
  810. write_short(blood2);
  811. write_short(blood1);
  812. write_byte(colors[2]);
  813. write_byte(30);
  814. message_end();
  815.  
  816. while (id++ < MaxPlayers)
  817. if (is_user_alive(id))
  818. {
  819. pev(id, pev_origin, porigin);
  820. if (get_distance_f(forigin, porigin) <= distance)
  821. if (fm_is_visible(ent, id))
  822. ExecuteHam(Ham_TakeDamage, id, owner, owner, (user_team != get_user_team(id)) ? 100.0 : 300.0, 4098);
  823. }
  824.  
  825. emit_sound(ent, CHAN_AUTO, "weapons/sg_explode.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
  826.  
  827. set_pev(ent, pev_classname, "pbHarmlessBullet");
  828.  
  829. }
  830.  
  831. stock bool:fm_is_visible(ent, target)
  832. {
  833. if (pev_valid(ent) && pev_valid(target))
  834. {
  835. new Float:start[3], Float:view_ofs[3], Float:point[3];
  836. pev(ent, pev_origin, start);
  837. pev(ent, pev_view_ofs, view_ofs);
  838. pev(target, pev_origin, point);
  839. start[0] += view_ofs[0];
  840. start[1] += view_ofs[1];
  841. start[2] += view_ofs[2];
  842. engfunc(EngFunc_TraceLine, start, point, 1, ent, 0);
  843. new Float:fraction;
  844. get_tr2(0, TR_flFraction, fraction);
  845. if (fraction == 1.0)
  846. return true;
  847. }
  848. return false;
  849. }
  850.  
  851. public paint_splat(ent)
  852. {
  853. new Float:origin[3], Float:norigin[3], Float:viewofs[3], Float:angles[3], Float:normal[3], Float:aiming[3];
  854. pev(ent, pev_origin, origin);
  855. pev(ent, pev_view_ofs, viewofs);
  856. pev(ent, pev_v_angle, angles);
  857.  
  858. norigin[0] = origin[0] + viewofs[0];
  859. norigin[1] = origin[1] + viewofs[1];
  860. norigin[2] = origin[2] + viewofs[2];
  861. aiming[0] = norigin[0] + floatcos(angles[1], degrees) * 1000.0;
  862. aiming[1] = norigin[1] + floatsin(angles[1], degrees) * 1000.0;
  863. aiming[2] = norigin[2] + floatsin(-angles[0], degrees) * 1000.0;
  864.  
  865. new tr = 0
  866. engfunc(EngFunc_TraceLine, norigin, aiming, 0, ent, tr);
  867. //get_tr2(tr, TR_vecPlaneNormal, normal);
  868. //EngFunc_TraceHull,(const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
  869. //engfunc(EngFunc_TraceHull, norigin, aiming, 0, HULL_LARGE, ent, tr)
  870. get_tr2(tr, TR_vecPlaneNormal, normal)
  871.  
  872.  
  873. vector_to_angle(normal, angles);
  874. angles[1] += 180.0;
  875. if (angles[1] >= 360.0) angles[1] -= 360.0;
  876.  
  877. set_pev(ent, pev_angles, angles);
  878. set_pev(ent, pev_v_angle, angles);
  879.  
  880. origin[0] += (normal[0] * random_float(0.3, 2.7));
  881. origin[1] += (normal[1] * random_float(0.3, 2.7));
  882. origin[2] += (normal[2] * random_float(0.3, 2.7));
  883. engfunc(EngFunc_SetOrigin, ent, origin);
  884. set_pev(ent, pev_frame, float(random_num( (pev(ent, pev_skin) * 18), (pev(ent, pev_skin) * 18) + 17 ) ));
  885.  
  886. if (pev(ent, pev_renderfx) != kRenderFxNone)
  887. set_rendering(ent);
  888.  
  889. }
  890.  
  891. public paint_glow(ent)
  892. {
  893. if (pev_valid(ent))
  894. {
  895. static pbglow[5], clr[3];
  896. get_pcvar_string(bglow, pbglow, 4);
  897. switch (get_pcvar_num(color))
  898. {
  899. case 2: clr = (get_user_team(pev(ent, pev_owner))==1) ? {255, 0, 0} : {0, 0, 255};
  900. default: clr = {255, 255, 255};
  901. }
  902. if (read_flags(pbglow) & (1 << 0))
  903. set_rendering(ent, kRenderFxGlowShell, clr[0], clr[1], clr[2], kRenderNormal, 255);
  904. if (read_flags(pbglow) & (1 << 1))
  905. {
  906. message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
  907. write_byte(TE_BEAMFOLLOW);
  908. write_short(ent);
  909. write_short(beamspr);
  910. write_byte(4);
  911. write_byte(2);
  912. write_byte(clr[0]);
  913. write_byte(clr[1]);
  914. write_byte(clr[2]);
  915. write_byte(255);
  916. message_end();
  917. }
  918. }
  919. }
  920.  
  921. public paint_reset(ent)
  922. {
  923. remove_task(ent);
  924. ent -= TASK_PB_RESET;
  925. new a, findpb = 1;
  926. while (a++ <= g_pbcount && findpb)
  927. if (g_paintballs[a] == ent)
  928. findpb = g_pbstatus[a] = 0;
  929.  
  930. set_pev(ent, pev_effects, pev(ent, pev_effects) | EF_NODRAW);
  931. engfunc(EngFunc_SetSize, ent, Float:{0.0, 0.0, 0.0}, Float:{0.0, 0.0, 0.0});
  932. set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
  933. engfunc(EngFunc_SetOrigin, ent, Float:{-2000.0, -2000.0, -2000.0});
  934. if (pev(ent, pev_renderfx) != kRenderFxNone)
  935. set_rendering(ent);
  936. }
  937.  
  938. public time_explode(ent)
  939. {
  940. remove_task(ent);
  941. ent -= TASK_PB_RESET;
  942. if (!pev_valid(ent))
  943. return;
  944. act_explode(ent);
  945.  
  946. set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
  947. set_pev(ent, pev_classname, "pbPaint");
  948. set_pev(ent, pev_solid, 0);
  949. set_pev(ent, pev_movetype, 0);
  950. engfunc(EngFunc_SetModel, ent, "sprites/paintball.spr");
  951.  
  952. new a, findpb = 0;
  953. while (a++ < g_pbcount && !findpb)
  954. if (g_paintballs[a] == ent)
  955. findpb = g_pbstatus[a] = 2;
  956. remove_task(ent);
  957. paint_reset(ent+TASK_PB_RESET);
  958. }
  959.  
  960.  
  961. public ev_roundstart()
  962. {
  963. for (new a = 1; a <= g_pbcount; a++)
  964. if (g_pbstatus[a] != 0)
  965. paint_reset(g_paintballs[a]+TASK_PB_RESET);
  966. if (freezetime)
  967. freezetime = 0;
  968.  
  969. }
  970.  
  971. public ev_freezetime()
  972. freezetime = 1;
  973.  
  974. stock user_has_pbgun(id)
  975. {
  976. new retval;
  977.  
  978. if (is_user_alive(id))
  979. {
  980. switch(get_user_weapon(id))
  981. {
  982. case CSW_MP5NAVY: retval = PB_MARKER;
  983. case CSW_USP: retval = PB_USP;
  984. case CSW_GLOCK18: retval = PB_GLOCK;
  985. case CSW_SCOUT: retval = PB_SNIPER;
  986. case CSW_M3: retval = PB_LAUNCHER;
  987. case CSW_XM1014: retval = PB_SHOTGUN;
  988. case CSW_P90: retval = PB_SUPERMARKER;
  989. default: retval = 0;
  990. }
  991.  
  992. }
  993. return retval;
  994. }
  995.  
  996.  
  997. stock set_user_clip(id, ammo)
  998. {
  999. new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
  1000. get_weaponname(weapon, weaponname, 31);
  1001. while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
  1002. if (pev(weaponid, pev_owner) == id) {
  1003. set_pdata_int(weaponid, 51, ammo, 4);
  1004. return weaponid;
  1005. }
  1006. return 0;
  1007. }
  1008.  
  1009. // teame06's function
  1010. stock set_rendering(index, fx=kRenderFxNone, r=0, g=0, b=0, render=kRenderNormal, amount=16)
  1011. {
  1012. set_pev(index, pev_renderfx, fx);
  1013. new Float:RenderColor[3];
  1014. RenderColor[0] = float(r);
  1015. RenderColor[1] = float(g);
  1016. RenderColor[2] = float(b);
  1017. set_pev(index, pev_rendercolor, RenderColor);
  1018. set_pev(index, pev_rendermode, render);
  1019. set_pev(index, pev_renderamt, float(amount));
  1020. }
  1021.  
  1022.  
  1023. public fwd_TakeDamage ( id, i_Inflictor, i_Attacker, Float:f_Damage, i_DamageBits )
  1024. {
  1025. if (!is_user_alive(i_Attacker))
  1026. return PLUGIN_CONTINUE;
  1027.  
  1028. if ( get_user_weapon(i_Attacker) == CSW_KNIFE && get_pcvar_num(knife_ohk))
  1029. {
  1030. ExecuteHam(Ham_TakeDamage, id, i_Attacker, i_Attacker, 101.0, 4098);
  1031. }
  1032.  
  1033. return PLUGIN_CONTINUE;
  1034. }
  1035.  
  1036. public weapon_jam(id, uc_handle)
  1037. {
  1038. if (get_pcvar_num(jamon))
  1039. {
  1040. // show messages
  1041. set_hudmessage(255, 255, 255, -1.0, 0.33, 0, 6.0, 12.0)
  1042. show_hudmessage(id, "Paintball Hasznalat - Nyomj E betut az aktivalashoz")
  1043.  
  1044. // block the attack button
  1045. static buttons; buttons = get_uc( uc_handle, UC_Buttons )
  1046. set_uc (uc_handle, UC_Buttons, buttons & ~IN_ATTACK);
  1047. }
  1048. }
  1049.  
  1050. public clear_chamber(id)
  1051. {
  1052. if (get_pcvar_num(jamon))
  1053. {
  1054. g_Jammed[id] = false;
  1055. emit_sound(id,CHAN_AUTO,"weapons/scout_bolt.wav",1.0,ATTN_NORM,0,PITCH_NORM);
  1056.  
  1057. // show messages
  1058. set_hudmessage(255, 255, 255, -1.0, 0.3, 0, 3.0, 12.0);
  1059. show_hudmessage(id, "Ujratoltes Tanacsolt");
  1060. }
  1061. }
  1062.  
  1063.  
  1064. public make_solid(ent)
  1065. {
  1066. remove_task(ent);
  1067. ent -= TASK_PB_RESET;
  1068. if (!pev_valid(ent))
  1069. return;
  1070. set_pev(ent, pev_solid, 2);
  1071. if (get_pcvar_num(gravity))
  1072. set_pev(ent, pev_movetype, MOVETYPE_BOUNCE);
  1073. }
  1074.  
  1075. stock is_rpaintball_active()
  1076. {
  1077. if(!cvar_exists("amx_pbmod"))
  1078. {
  1079. log_amx("Cvar: ^"amx_pbmod^" does not exist.")
  1080. return 0
  1081. }
  1082. return get_cvar_num("amx_pbmod")
  1083. }
  1084.  
[/ablak]


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.29. 16:49 
Offline
Nagyúr

Csatlakozott: 2014.05.10. 16:41
Hozzászólások: 721
Megköszönt másnak: 43 alkalommal
Megköszönték neki: 64 alkalommal
Tessék! Ezzel le tudod cseréni! :) GHW Fegyver modell/hang csere


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.29. 23:33 
Offline
Senior Tag
Avatar

Csatlakozott: 2014.07.03. 00:07
Hozzászólások: 297
Megköszönt másnak: 37 alkalommal
Megköszönték neki: 35 alkalommal
Igen ezzel le lehet cserélni , de nem fog paintball golyókat lőni.

_________________
http://www.subbass.hu
[steam]krisz_nvidia[/steam]
Admin Rendszer v1.3
http://csgoskins.net/?rid=76561198147396400


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.29. 23:48 
Offline
Nagyúr
Avatar

Csatlakozott: 2013.09.04. 15:21
Hozzászólások: 635
Megköszönt másnak: 1 alkalommal
Megköszönték neki: 141 alkalommal
Nem azt kérte hogy cserélje le a fegyver skint hanem + fegyvereket belerakni :)
Olvassátok el figyelmesebben!

_________________
My Steam:
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.30. 10:10 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
A Paintballgun.sma-ba kell beleírni az új fegyvereket.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.30. 10:35 
Offline
Félisten
Avatar

Csatlakozott: 2013.12.30. 12:26
Hozzászólások: 987
Megköszönt másnak: 34 alkalommal
Megköszönték neki: 133 alkalommal
V!rusHD írta:
A Paintballgun.sma-ba kell beleírni az új fegyvereket.

Na ne mondd, szerinted miért csatolta az sma-t?

_________________
Kép
Pár pluginom:
LCAW Frag Bolt
S E C R E T (78%...)
KépKép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.30. 10:38 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
Hibás sma-t csatoltt.

_________________
Kép


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.31. 12:34 
Offline
Nagyúr

Csatlakozott: 2014.05.10. 16:41
Hozzászólások: 721
Megköszönt másnak: 43 alkalommal
Megköszönték neki: 64 alkalommal
Nem fog golyot löni csak ész kell hozzá! :) nm külön mapába kell rakni és ennek lenni a nevének v_pbgun_te v_pbgun_ct pl vagy amit akrsz de a v_pbgun-nak ott kell lennije


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.07.31. 23:26 
Offline
Tag
Avatar

Csatlakozott: 2014.05.11. 01:10
Hozzászólások: 56
Megköszönt másnak: 11 alkalommal
Megköszönték neki: 2 alkalommal
Azért nem lő ki paintball lövedéket mert a models mappába kell bele rakni a model-t és ezt kell bele írni pl:"models/v_pbgun.mdl" "models/v_uj_pbgun.mdl" "T" vagy "CT"


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Paintball módba új fegyverek
HozzászólásElküldve: 2014.08.01. 09:59 
Offline
Nagyúr
Avatar

Csatlakozott: 2014.07.22. 17:59
Hozzászólások: 667
Megköszönt másnak: 49 alkalommal
Megköszönték neki: 36 alkalommal
Nud[!]e jól mondja, az a fő, hogy a models mapába rakjuk és, hogy v_pbgun benne legyen a nevében!

_________________
Kép


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  [ 11 hozzászólás ]  Oldal 1 2 Következő


Ki van itt

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