hlmod.hu
https://hlmod.hu/

fegyver eldobás utána eltünik
https://hlmod.hu/viewtopic.php?f=29&t=5867
Oldal: 1 / 1

Szerző:  expert [ 2012.09.06. 17:48 ]
Hozzászólás témája:  fegyver eldobás utána eltünik

Szeretnék egy plugint ami azt csinálja, hogy ha eldobom a fegyót akkor azonnal eltünjön a földöl és ne maradjon ott!!
Néztem ezt a No Weapon Drop on Death plugint de ha eldobom akkor ottmarad a földön és ez nem jó nekem !!

Szerző:  HunGamer [ 2012.09.06. 18:03 ]
Hozzászólás témája:  Re: fegyver eldobás utána eltünik

Ez teljesen ugyanaz csak 1 sort átírtam :D
SMA Forráskód: [ Mindet kijelol ]
  1. #include <amxmodx>
  2. #include <engine>
  3. #include <fakemeta>
  4.  
  5. #define CVAR "amx_noweapdrop_ondeath"
  6.  
  7. #define WBOX "models/w_weaponbox.mdl"
  8. #define BOMB "models/w_backpack.mdl"
  9. #define SHLD "models/w_shield.mdl"
  10.  
  11. #define MAX_PLAYERS 32
  12. new g_entid[MAX_PLAYERS + 1]
  13. new g_maxents
  14.  
  15. public plugin_init() {
  16. register_plugin("No Weapon Drop on Death", "0.2", "VEN")
  17. register_forward(FM_SetModel, "forward_set_model")
  18. register_cvar(CVAR, "1")
  19. g_maxents = get_global_int(GL_maxEntities)
  20. }
  21.  
  22. public forward_set_model(entid, model[]) {
  23. if (!is_valid_ent(entid) || !equal(model, WBOX, 9) || !get_cvar_num(CVAR))
  24. return FMRES_IGNORED
  25.  
  26. new id = entity_get_edict(entid, EV_ENT_owner)
  27. if (!id || !is_user_connected(id))//itt volt az is_user_alive
  28. return FMRES_IGNORED
  29.  
  30. if (equal(model, SHLD)) {
  31. kill_entity(entid)
  32. return FMRES_IGNORED
  33. }
  34.  
  35. if (equal(model, WBOX)) {
  36. g_entid[id] = entid
  37. return FMRES_IGNORED
  38. }
  39.  
  40. if (entid != g_entid[id])
  41. return FMRES_IGNORED
  42.  
  43. g_entid[id] = 0
  44.  
  45. if (equal(model, BOMB))
  46. return FMRES_IGNORED
  47.  
  48. for (new i = 1; i <= g_maxents; ++i) {
  49. if (is_valid_ent(i) && entid == entity_get_edict(i, EV_ENT_owner)) {
  50. kill_entity(entid)
  51. kill_entity(i)
  52. }
  53. }
  54.  
  55. return FMRES_IGNORED
  56. }
  57.  
  58. stock kill_entity(id) {
  59. entity_set_int(id, EV_INT_flags, entity_get_int(id, EV_INT_flags)|FL_KILLME)
  60. }

Szerző:  expert [ 2012.09.08. 07:35 ]
Hozzászólás témája:  Re: fegyver eldobás utána eltünik

köszi !!

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/