Bomb Infection

Unpaid Requests, Public Plugins
User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

Bomb Infection

#1

Post by lizoumapper » 3 Months Ago

are any developer can create plugin bomb infection when throw on human infect
this is plugin zp complete couverting to ZE
no forget add gibs effect tutorial :
  1. #include <amxmodx>
  2. #include <fun>
  3. #include <fakemeta>
  4. #include <hamsandwich>
  5. #include <amx_settings_api>
  6. #include <cs_weap_models_api>
  7. #include <zombie_escape>
  8.  
  9. // Settings file
  10. new const ZE_SETTING_FILE[] = "zombie_escape.ini"
  11.  
  12. // Default sounds
  13. new const sound_grenade_infect_explode[][] = { "zombie_escape/grenade_infect.wav" }
  14. new const sound_grenade_infect_player[][] = { "scientist/scream20.wav" , "scientist/scream22.wav" , "scientist/scream05.wav" }
  15.  
  16. #define MODEL_MAX_LENGTH 64
  17. #define SOUND_MAX_LENGTH 64
  18. #define SPRITE_MAX_LENGTH 64
  19.  
  20. // Models
  21. new g_model_grenade_infect[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_infect.mdl"
  22.  
  23. // Sprites
  24. new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
  25. new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
  26. new g_sprite_grenade_gibs[SPRITE_MAX_LENGTH] = "sprites/zombie_escape/infect_gibs.spr"
  27.  
  28. new Array:g_sound_grenade_infect_explode
  29. new Array:g_sound_grenade_infect_player
  30. new Array:g_sound_grenade_infect_gibs
  31.  
  32. // Explosion radius for custom grenades
  33. const Float:NADE_EXPLOSION_RADIUS = 240.0
  34.  
  35. // HACK: pev_ field used to store custom nade types and their values
  36. const PEV_NADE_TYPE = pev_flTimeStepSound
  37. const NADE_TYPE_INFECTION = 1111
  38.  
  39. new g_trailSpr, g_exploSpr, g_gibsSpr
  40.  
  41. new g_ItemID
  42. new g_GameModeInfectionID
  43. new g_GameModeMultiID
  44. new g_InfectionBombCounter, cvar_infection_bomb_round_limit, cvar_infection_reduis
  45.  
  46. public plugin_init()
  47. {
  48.     register_plugin("[ZE] Item: Infection Bomb", ZE_VERSION, AUTHORS)
  49.    
  50.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
  51.    
  52.     register_forward(FM_SetModel, "fw_SetModel")
  53.     RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
  54.    
  55.     g_ItemID = zp_items_register(ITEM_NAME, ITEM_COST)
  56.     cvar_infection_bomb_round_limit = register_cvar("ze_infection_bomb_round_limit", "3")
  57.     cvar_infection_reduis = register_cvar("ze_infection_bomb_reduis", "240")
  58. }
  59.  
  60. public plugin_precache()
  61. {
  62.     // Initialize arrays
  63.     g_sound_grenade_infect_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)
  64.     g_sound_grenade_infect_player = ArrayCreate(SOUND_MAX_LENGTH, 1)
  65.     g_sprite_grenade_gibs = ArrayCreate(SOUND_MAX_LENGTH, 1)
  66.    
  67.     // Load from external file
  68.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  69.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  70.    
  71.     // If we couldn't load custom sounds from file, use and save default ones
  72.     new index
  73.     if (ArraySize(g_sound_grenade_infect_explode) == 0)
  74.     {
  75.         for (index = 0; index < sizeof sound_grenade_infect_explode; index++)
  76.             ArrayPushString(g_sound_grenade_infect_explode, sound_grenade_infect_explode[index])
  77.        
  78.         // Save to external file
  79.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  80.     }
  81.     if (ArraySize(g_sound_grenade_infect_player) == 0)
  82.     {
  83.         for (index = 0; index < sizeof sound_grenade_infect_player; index++)
  84.             ArrayPushString(g_sound_grenade_infect_player, sound_grenade_infect_player[index])
  85.        
  86.         // Save to external file
  87.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  88.     }
  89.    
  90.     // Load from external file, save if not found
  91.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect, charsmax(g_model_grenade_infect)))
  92.         amx_save_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect)
  93.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))
  94.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail)
  95.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs, charsmax(g_sprite_grenade_gibs)))
  96.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs)
  97.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))
  98.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring)
  99.    
  100.     // Precache sounds
  101.     new sound[SOUND_MAX_LENGTH]
  102.     for (index = 0; index < ArraySize(g_sound_grenade_infect_explode); index++)
  103.     {
  104.         ArrayGetString(g_sound_grenade_infect_explode, index, sound, charsmax(sound))
  105.         precache_sound(sound)
  106.     }
  107.     for (index = 0; index < ArraySize(g_sound_grenade_infect_player); index++)
  108.     {
  109.         ArrayGetString(g_sound_grenade_infect_player, index, sound, charsmax(sound))
  110.         precache_sound(sound)
  111.     }
  112.    
  113.     // Precache models
  114.     precache_model(g_model_grenade_infect)
  115.     g_trailSpr = precache_model(g_sprite_grenade_trail)
  116.     g_exploSpr = precache_model(g_sprite_grenade_ring)
  117.     g_gibsSpr = precache_model(g_sprite_grenade_gibs)
  118. }
  119.  
  120. public plugin_cfg()
  121. {
  122.     g_GameModeInfectionID = zp_gamemodes_get_id("Infection Mode")
  123.     g_GameModeMultiID = zp_gamemodes_get_id("Multiple Infection Mode")
  124. }
  125.  
  126. public event_round_start()
  127. {
  128.     g_InfectionBombCounter = 0
  129. }
  130.  
  131. public zp_fw_items_select_pre(id, itemid, ignorecost)
  132. {
  133.     // This is not our item
  134.     if (itemid != g_ItemID)
  135.         return ZP_ITEM_AVAILABLE;
  136.    
  137.     // Infection bomb only available during infection modes
  138.     new current_mode = zp_gamemodes_get_current()
  139.     if (current_mode != g_GameModeInfectionID && current_mode != g_GameModeMultiID)
  140.         return ZP_ITEM_DONT_SHOW;
  141.    
  142.     // Infection bomb only available to zombies
  143.     if (!zp_core_is_zombie(id))
  144.         return ZP_ITEM_DONT_SHOW;
  145.    
  146.     // Display remaining item count for this round
  147.     static text[32]
  148.     formatex(text, charsmax(text), "[%d/%d]", g_InfectionBombCounter, get_pcvar_num(cvar_infection_bomb_round_limit))
  149.     zp_items_menu_text_add(text)
  150.    
  151.     // Reached infection bomb limit for this round
  152.     if (g_InfectionBombCounter >= get_pcvar_num(cvar_infection_bomb_round_limit))
  153.         return ZP_ITEM_NOT_AVAILABLE;
  154.    
  155.     // Player already owns infection bomb
  156.     if (user_has_weapon(id, CSW_HEGRENADE))
  157.         return ZP_ITEM_NOT_AVAILABLE;
  158.    
  159.     return ZP_ITEM_AVAILABLE;
  160. }
  161.  
  162. public zp_fw_items_select_post(id, itemid, ignorecost)
  163. {
  164.     // This is not our item
  165.     if (itemid != g_ItemID)
  166.         return;
  167.    
  168.     // Give infection bomb
  169.     give_item(id, "weapon_hegrenade")
  170.     g_InfectionBombCounter++
  171. }
  172.  
  173. public zp_fw_core_cure(id, attacker)
  174. {
  175.     // Remove custom grenade model
  176.     cs_reset_player_view_model(id, CSW_HEGRENADE)
  177. }
  178.  
  179. public zp_fw_core_infect_post(id, attacker)
  180. {
  181.     // Set custom grenade model
  182.     cs_set_player_view_model(id, CSW_HEGRENADE, g_model_grenade_infect)
  183. }
  184.  
  185. // Forward Set Model
  186. public fw_SetModel(entity, const model[])
  187. {
  188.     // We don't care
  189.     if (strlen(model) < 8)
  190.         return;
  191.    
  192.     // Narrow down our matches a bit
  193.     if (model[7] != 'w' || model[8] != '_')
  194.         return;
  195.    
  196.     // Get damage time of grenade
  197.     static Float:dmgtime
  198.     pev(entity, pev_dmgtime, dmgtime)
  199.    
  200.     // Grenade not yet thrown
  201.     if (dmgtime == 0.0)
  202.         return;
  203.    
  204.     // Grenade's owner isn't zombie?
  205.     if (!zp_core_is_zombie(pev(entity, pev_owner)))
  206.         return;
  207.    
  208.     // HE Grenade
  209.     if (model[9] == 'h' && model[10] == 'e')
  210.     {
  211.         // Give it a glow
  212.         fm_set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
  213.        
  214.         // And a colored trail
  215.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  216.         write_byte(TE_BEAMFOLLOW) // TE id
  217.         write_short(entity) // entity
  218.         write_short(g_trailSpr) // sprite
  219.         write_byte(10) // life
  220.         write_byte(10) // width
  221.         write_byte(0) // r
  222.         write_byte(200) // g
  223.         write_byte(0) // b
  224.         write_byte(200) // brightness
  225.         message_end()
  226.        
  227.         // Set grenade type on the thrown grenade entity
  228.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
  229.     }
  230. }
  231.  
  232. // Ham Grenade Think Forward
  233. public fw_ThinkGrenade(entity)
  234. {
  235.     // Invalid entity
  236.     if (!pev_valid(entity)) return HAM_IGNORED;
  237.    
  238.     // Get damage time of grenade
  239.     static Float:dmgtime
  240.     pev(entity, pev_dmgtime, dmgtime)
  241.    
  242.     // Check if it's time to go off
  243.     if (dmgtime > get_gametime())
  244.         return HAM_IGNORED;
  245.    
  246.     // Check if it's one of our custom nades
  247.     switch (pev(entity, PEV_NADE_TYPE))
  248.     {
  249.         case NADE_TYPE_INFECTION: // Infection Bomb
  250.         {
  251.             infection_explode(entity)
  252.             return HAM_SUPERCEDE;
  253.         }
  254.     }
  255.    
  256.     return HAM_IGNORED;
  257. }
  258.  
  259. // Infection Bomb Explosion
  260. infection_explode(ent)
  261. {
  262.     // Round ended
  263.     if (zp_gamemodes_get_current() == ZP_NO_GAME_MODE)
  264.     {
  265.         // Get rid of the grenade
  266.         engfunc(EngFunc_RemoveEntity, ent)
  267.         return;
  268.     }
  269.    
  270.     // Get origin
  271.     static Float:origin[3]
  272.     pev(ent, pev_origin, origin)
  273.    
  274.     // Make the explosion
  275.     create_blast(origin)
  276.    
  277.     // Infection nade explode sound
  278.     static sound[SOUND_MAX_LENGTH]
  279.     ArrayGetString(g_sound_grenade_infect_explode, random_num(0, ArraySize(g_sound_grenade_infect_explode) - 1), sound, charsmax(sound))
  280.     emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  281.    
  282.     // Get attacker
  283.     new attacker = pev(ent, pev_owner)
  284.    
  285.     // Infection bomb owner disconnected or not zombie anymore?
  286.     if (!is_user_connected(attacker) || !zp_core_is_zombie(attacker))
  287.     {
  288.         // Get rid of the grenade
  289.         engfunc(EngFunc_RemoveEntity, ent)
  290.         return;
  291.     }
  292.    
  293.     // Collisions
  294.     new victim = -1
  295.    
  296.     while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, cvar_infection_reduis)) != 0)
  297.     {
  298.         // Only effect alive humans
  299.         if (!is_user_alive(victim) || zp_core_is_zombie(victim))
  300.             continue;
  301.        
  302.         // Last human is killed
  303.         if (zp_core_get_human_count() == 1)
  304.         {
  305.             ExecuteHamB(Ham_Killed, victim, attacker, 0)
  306.             continue;
  307.         }
  308.        
  309.         // Turn into zombie
  310.         zp_core_infect(victim, attacker)
  311.        
  312.         // Victim's sound
  313.         ArrayGetString(g_sound_grenade_infect_player, random_num(0, ArraySize(g_sound_grenade_infect_player) - 1), sound, charsmax(sound))
  314.         emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  315.     }
  316.    
  317.     // Get rid of the grenade
  318.     engfunc(EngFunc_RemoveEntity, ent)
  319. }
  320.  
  321. // Infection Bomb: Green Blast
  322. create_blast(const Float:origin[3])
  323. {
  324.     // Smallest ring
  325.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  326.     write_byte(TE_BEAMCYLINDER) // TE id
  327.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  328.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  329.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  330.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  331.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  332.     engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis
  333.     write_short(g_exploSpr) // sprite
  334.     write_byte(0) // startframe
  335.     write_byte(0) // framerate
  336.     write_byte(4) // life
  337.     write_byte(60) // width
  338.     write_byte(0) // noise
  339.     write_byte(0) // red
  340.     write_byte(200) // green
  341.     write_byte(0) // blue
  342.     write_byte(200) // brightness
  343.     write_byte(0) // speed
  344.     message_end()
  345.    
  346.     // Medium ring
  347.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  348.     write_byte(TE_BEAMCYLINDER) // TE id
  349.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  350.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  351.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  352.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  353.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  354.     engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis
  355.     write_short(g_exploSpr) // sprite
  356.     write_byte(0) // startframe
  357.     write_byte(0) // framerate
  358.     write_byte(4) // life
  359.     write_byte(60) // width
  360.     write_byte(0) // noise
  361.     write_byte(0) // red
  362.     write_byte(200) // green
  363.     write_byte(0) // blue
  364.     write_byte(200) // brightness
  365.     write_byte(0) // speed
  366.     message_end()
  367.    
  368.     // Largest ring
  369.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  370.     write_byte(TE_BEAMCYLINDER) // TE id
  371.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  372.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  373.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  374.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  375.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  376.     engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis
  377.     write_short(g_exploSpr) // sprite
  378.     write_byte(0) // startframe
  379.     write_byte(0) // framerate
  380.     write_byte(4) // life
  381.     write_byte(60) // width
  382.     write_byte(0) // noise
  383.     write_byte(0) // red
  384.     write_byte(200) // green
  385.     write_byte(0) // blue
  386.     write_byte(200) // brightness
  387.     write_byte(0) // speed
  388.     message_end()
  389. }
  390.  
  391. // Set entity's rendering type (from fakemeta_util)
  392. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  393. {
  394.     static Float:color[3]
  395.     color[0] = float(r)
  396.     color[1] = float(g)
  397.     color[2] = float(b)
  398.    
  399.     set_pev(entity, pev_renderfx, fx)
  400.     set_pev(entity, pev_rendercolor, color)
  401.     set_pev(entity, pev_rendermode, render)
  402.     set_pev(entity, pev_renderamt, float(amount))
  403. }
  404.  
zp50_item_infection_bomb.sma
(12.65 KiB) Downloaded 12 times
zp50_item_infection_bomb.sma
(12.65 KiB) Downloaded 12 times
I Love Learn Languages Programmations

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#2

Post by Raheem » 3 Months Ago

  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. // Settings file
  5. new const ZE_SETTING_FILE[] = "zombie_escape.ini"
  6.  
  7. // Default sounds
  8. new const sound_grenade_infect_explode[][] = { "zombie_escape/grenade_infect.wav" }
  9. new const sound_grenade_infect_player[][] = { "scientist/scream20.wav" , "scientist/scream22.wav" , "scientist/scream05.wav" }
  10.  
  11. #define MODEL_MAX_LENGTH 64
  12. #define SOUND_MAX_LENGTH 64
  13. #define SPRITE_MAX_LENGTH 64
  14.  
  15. // Models
  16. new g_model_grenade_infect[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_infect.mdl"
  17.  
  18. // Sprites
  19. new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
  20. new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
  21. new g_sprite_grenade_gibs[SPRITE_MAX_LENGTH] = "sprites/zombie_escape/infect_gibs.spr"
  22.  
  23. new Array:g_sound_grenade_infect_explode
  24. new Array:g_sound_grenade_infect_player
  25. new Array:g_sound_grenade_infect_gibs
  26.  
  27. // Explosion radius for custom grenades
  28. const Float:NADE_EXPLOSION_RADIUS = 240.0
  29.  
  30. // HACK: pev_ field used to store custom nade types and their values
  31. const PEV_NADE_TYPE = pev_flTimeStepSound
  32. const NADE_TYPE_INFECTION = 1111
  33.  
  34. new g_trailSpr, g_exploSpr, g_gibsSpr
  35.  
  36. new g_ItemID
  37. new g_InfectionBombCounter, cvar_infection_bomb_round_limit, cvar_infection_reduis
  38.  
  39. new bool:g_bHasInfection[33]
  40.  
  41. public plugin_init()
  42. {
  43.     register_plugin("[ZE] Item: Infection Bomb", ZE_VERSION, AUTHORS)
  44.    
  45.     register_forward(FM_SetModel, "fw_SetModel")
  46.     RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
  47.    
  48.     g_ItemID = ze_register_item("Infection Bomb", 50, 0)
  49.     cvar_infection_bomb_round_limit = register_cvar("ze_infection_bomb_round_limit", "3")
  50.     cvar_infection_reduis = register_cvar("ze_infection_bomb_reduis", "240")
  51. }
  52.  
  53. public plugin_precache()
  54. {
  55.     // Initialize arrays
  56.     g_sound_grenade_infect_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)
  57.     g_sound_grenade_infect_player = ArrayCreate(SOUND_MAX_LENGTH, 1)
  58.     g_sound_grenade_infect_gibs = ArrayCreate(SOUND_MAX_LENGTH, 1)
  59.    
  60.     // Load from external file
  61.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  62.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  63.    
  64.     // If we couldn't load custom sounds from file, use and save default ones
  65.     new index
  66.     if (ArraySize(g_sound_grenade_infect_explode) == 0)
  67.     {
  68.         for (index = 0; index < sizeof sound_grenade_infect_explode; index++)
  69.             ArrayPushString(g_sound_grenade_infect_explode, sound_grenade_infect_explode[index])
  70.        
  71.         // Save to external file
  72.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  73.     }
  74.     if (ArraySize(g_sound_grenade_infect_player) == 0)
  75.     {
  76.         for (index = 0; index < sizeof sound_grenade_infect_player; index++)
  77.             ArrayPushString(g_sound_grenade_infect_player, sound_grenade_infect_player[index])
  78.        
  79.         // Save to external file
  80.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  81.     }
  82.    
  83.     // Load from external file, save if not found
  84.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect, charsmax(g_model_grenade_infect)))
  85.         amx_save_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect)
  86.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))
  87.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail)
  88.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs, charsmax(g_sprite_grenade_gibs)))
  89.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs)
  90.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))
  91.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring)
  92.    
  93.     // Precache sounds
  94.     new sound[SOUND_MAX_LENGTH]
  95.     for (index = 0; index < ArraySize(g_sound_grenade_infect_explode); index++)
  96.     {
  97.         ArrayGetString(g_sound_grenade_infect_explode, index, sound, charsmax(sound))
  98.         precache_sound(sound)
  99.     }
  100.     for (index = 0; index < ArraySize(g_sound_grenade_infect_player); index++)
  101.     {
  102.         ArrayGetString(g_sound_grenade_infect_player, index, sound, charsmax(sound))
  103.         precache_sound(sound)
  104.     }
  105.    
  106.     // Precache models
  107.     precache_model(g_model_grenade_infect)
  108.     g_trailSpr = precache_model(g_sprite_grenade_trail)
  109.     g_exploSpr = precache_model(g_sprite_grenade_ring)
  110.     g_gibsSpr = precache_model(g_sprite_grenade_gibs)
  111. }
  112.  
  113. public ze_game_started()
  114. {
  115.     g_InfectionBombCounter = 0
  116. }
  117.  
  118. public ze_select_item_pre(id, itemid)
  119. {
  120.     // This is not our item
  121.     if (itemid != g_ItemID)
  122.         return ZE_ITEM_AVAILABLE;
  123.    
  124.     // Available for Humans only, So don't show it for zombies
  125.     if (!ze_is_user_zombie(id))
  126.         return ZE_ITEM_DONT_SHOW
  127.    
  128.     // Display remaining item count for this round
  129.     static text[32]
  130.     formatex(text, charsmax(text), "[%d/%d]", g_InfectionBombCounter, get_pcvar_num(cvar_infection_bomb_round_limit))
  131.     ze_add_text_to_item(text)
  132.    
  133.     // Reached infection bomb limit for this round
  134.     if (g_InfectionBombCounter >= get_pcvar_num(cvar_infection_bomb_round_limit))
  135.         return ZE_ITEM_UNAVAILABLE;
  136.    
  137.     // Player already owns infection bomb
  138.     if (g_bHasInfection[id])
  139.         return ZE_ITEM_UNAVAILABLE;
  140.    
  141.     return ZE_ITEM_AVAILABLE
  142. }
  143.  
  144. public ze_select_item_post(player, itemid)
  145. {
  146.     if (itemid != g_ItemID)
  147.         return
  148.    
  149.     // Give infection bomb
  150.     give_item(player, "weapon_hegrenade")
  151.     g_InfectionBombCounter++
  152.     g_bHasInfection[player]
  153. }
  154.  
  155. public ze_user_humanized(id)
  156. {
  157.     // Remove custom grenade model
  158.     g_bHasInfection[id] = false
  159. }
  160.  
  161. public ze_user_infected(id, attacker)
  162. {
  163.     // Set custom grenade model
  164.     cs_set_player_view_model(id, CSW_HEGRENADE, g_model_grenade_infect)
  165. }
  166.  
  167. // Forward Set Model
  168. public fw_SetModel(entity, const model[])
  169. {
  170.     // We don't care
  171.     if (strlen(model) < 8)
  172.         return;
  173.    
  174.     // Narrow down our matches a bit
  175.     if (model[7] != 'w' || model[8] != '_')
  176.         return;
  177.    
  178.     // Get damage time of grenade
  179.     static Float:dmgtime
  180.     pev(entity, pev_dmgtime, dmgtime)
  181.    
  182.     // Grenade not yet thrown
  183.     if (dmgtime == 0.0)
  184.         return;
  185.    
  186.     // Grenade's owner isn't zombie?
  187.     if (!ze_is_user_zombie(pev(entity, pev_owner)))
  188.         return;
  189.    
  190.     // HE Grenade
  191.     if (model[9] == 'h' && model[10] == 'e')
  192.     {
  193.         // Give it a glow
  194.         fm_set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
  195.        
  196.         // And a colored trail
  197.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  198.         write_byte(TE_BEAMFOLLOW) // TE id
  199.         write_short(entity) // entity
  200.         write_short(g_trailSpr) // sprite
  201.         write_byte(10) // life
  202.         write_byte(10) // width
  203.         write_byte(0) // r
  204.         write_byte(200) // g
  205.         write_byte(0) // b
  206.         write_byte(200) // brightness
  207.         message_end()
  208.        
  209.         // Set grenade type on the thrown grenade entity
  210.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
  211.     }
  212. }
  213.  
  214. // Ham Grenade Think Forward
  215. public fw_ThinkGrenade(entity)
  216. {
  217.     // Invalid entity
  218.     if (!pev_valid(entity)) return HAM_IGNORED;
  219.    
  220.     // Get damage time of grenade
  221.     static Float:dmgtime
  222.     pev(entity, pev_dmgtime, dmgtime)
  223.    
  224.     // Check if it's time to go off
  225.     if (dmgtime > get_gametime())
  226.         return HAM_IGNORED;
  227.    
  228.     // Check if it's one of our custom nades
  229.     switch (pev(entity, PEV_NADE_TYPE))
  230.     {
  231.         case NADE_TYPE_INFECTION: // Infection Bomb
  232.         {
  233.             infection_explode(entity)
  234.             return HAM_SUPERCEDE;
  235.         }
  236.     }
  237.    
  238.     return HAM_IGNORED;
  239. }
  240.  
  241. // Infection Bomb Explosion
  242. infection_explode(ent)
  243. {
  244.     // Get origin
  245.     static Float:origin[3]
  246.     pev(ent, pev_origin, origin)
  247.    
  248.     // Make the explosion
  249.     create_blast(origin)
  250.    
  251.     // Infection nade explode sound
  252.     static sound[SOUND_MAX_LENGTH]
  253.     ArrayGetString(g_sound_grenade_infect_explode, random_num(0, ArraySize(g_sound_grenade_infect_explode) - 1), sound, charsmax(sound))
  254.     emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  255.    
  256.     // Get attacker
  257.     new attacker = pev(ent, pev_owner)
  258.    
  259.     // Infection bomb owner disconnected or not zombie anymore?
  260.     if (!is_user_connected(attacker) || !ze_is_user_zombie(attacker))
  261.     {
  262.         // Get rid of the grenade
  263.         engfunc(EngFunc_RemoveEntity, ent)
  264.         return;
  265.     }
  266.    
  267.     // Collisions
  268.     new victim = -1
  269.    
  270.     while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, cvar_infection_reduis)) != 0)
  271.     {
  272.         // Only effect alive humans
  273.         if (!is_user_alive(victim) || ze_is_user_zombie(victim))
  274.             continue;
  275.        
  276.         // Turn into zombie
  277.         ze_set_user_zombie(victim)
  278.        
  279.         // Victim's sound
  280.         ArrayGetString(g_sound_grenade_infect_player, random_num(0, ArraySize(g_sound_grenade_infect_player) - 1), sound, charsmax(sound))
  281.         emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  282.     }
  283.    
  284.     // Get rid of the grenade
  285.     engfunc(EngFunc_RemoveEntity, ent)
  286. }
  287.  
  288. // Infection Bomb: Green Blast
  289. create_blast(const Float:origin[3])
  290. {
  291.     // Smallest ring
  292.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  293.     write_byte(TE_BEAMCYLINDER) // TE id
  294.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  295.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  296.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  297.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  298.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  299.     engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis
  300.     write_short(g_exploSpr) // sprite
  301.     write_byte(0) // startframe
  302.     write_byte(0) // framerate
  303.     write_byte(4) // life
  304.     write_byte(60) // width
  305.     write_byte(0) // noise
  306.     write_byte(0) // red
  307.     write_byte(200) // green
  308.     write_byte(0) // blue
  309.     write_byte(200) // brightness
  310.     write_byte(0) // speed
  311.     message_end()
  312.    
  313.     // Medium ring
  314.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  315.     write_byte(TE_BEAMCYLINDER) // TE id
  316.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  317.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  318.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  319.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  320.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  321.     engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis
  322.     write_short(g_exploSpr) // sprite
  323.     write_byte(0) // startframe
  324.     write_byte(0) // framerate
  325.     write_byte(4) // life
  326.     write_byte(60) // width
  327.     write_byte(0) // noise
  328.     write_byte(0) // red
  329.     write_byte(200) // green
  330.     write_byte(0) // blue
  331.     write_byte(200) // brightness
  332.     write_byte(0) // speed
  333.     message_end()
  334.    
  335.     // Largest ring
  336.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  337.     write_byte(TE_BEAMCYLINDER) // TE id
  338.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  339.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  340.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  341.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  342.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  343.     engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis
  344.     write_short(g_exploSpr) // sprite
  345.     write_byte(0) // startframe
  346.     write_byte(0) // framerate
  347.     write_byte(4) // life
  348.     write_byte(60) // width
  349.     write_byte(0) // noise
  350.     write_byte(0) // red
  351.     write_byte(200) // green
  352.     write_byte(0) // blue
  353.     write_byte(200) // brightness
  354.     write_byte(0) // speed
  355.     message_end()
  356. }
  357.  
  358. // Set entity's rendering type (from fakemeta_util)
  359. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  360. {
  361.     static Float:color[3]
  362.     color[0] = float(r)
  363.     color[1] = float(g)
  364.     color[2] = float(b)
  365.    
  366.     set_pev(entity, pev_renderfx, fx)
  367.     set_pev(entity, pev_rendercolor, color)
  368.     set_pev(entity, pev_rendermode, render)
  369.     set_pev(entity, pev_renderamt, float(amount))
  370. }
  371.  
You don't know? Learn and you will know.

User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

#3

Post by lizoumapper » 3 Months Ago

@Raheem
Thanks So Much Bro :D
Niice <3
I Love Learn Languages Programmations

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 533
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#4

Post by czirimbolo » 3 Months Ago

lizoumapper wrote:
3 Months Ago
are any developer can create plugin bomb infection when throw on human infect
this is plugin zp complete couverting to ZE
no forget add gibs effect tutorial :

Can you upload resources here? Models, sprites etc?
Image

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#5

Post by Raheem » 3 Months Ago

czirimbolo wrote:
3 Months Ago
Can you upload resources here? Models, sprites etc?
Get it from zombie plague
You don't know? Learn and you will know.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 533
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#6

Post by czirimbolo » 3 Months Ago

Raheem wrote:
3 Months Ago
czirimbolo wrote:
3 Months Ago
Can you upload resources here? Models, sprites etc?
Get it from zombie plague
It cant be used on last human. Can you make this?
Image

User avatar
Raheem
Mod Developer
Mod Developer
Egypt
Posts: 1972
Joined: 2 Years Ago
Location: Egypt
Has thanked: 32 times
Been thanked: 108 times
Age: 22
Contact:

#7

Post by Raheem » 3 Months Ago

czirimbolo wrote:
3 Months Ago
It cant be used on last human. Can you make this?
  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. // Settings file
  5. new const ZE_SETTING_FILE[] = "zombie_escape.ini"
  6.  
  7. // Default sounds
  8. new const sound_grenade_infect_explode[][] = { "zombie_escape/grenade_infect.wav" }
  9. new const sound_grenade_infect_player[][] = { "scientist/scream20.wav" , "scientist/scream22.wav" , "scientist/scream05.wav" }
  10.  
  11. #define MODEL_MAX_LENGTH 64
  12. #define SOUND_MAX_LENGTH 64
  13. #define SPRITE_MAX_LENGTH 64
  14.  
  15. // Models
  16. new g_model_grenade_infect[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_infect.mdl"
  17.  
  18. // Sprites
  19. new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
  20. new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
  21. new g_sprite_grenade_gibs[SPRITE_MAX_LENGTH] = "sprites/zombie_escape/infect_gibs.spr"
  22.  
  23. new Array:g_sound_grenade_infect_explode
  24. new Array:g_sound_grenade_infect_player
  25. new Array:g_sound_grenade_infect_gibs
  26.  
  27. // Explosion radius for custom grenades
  28. const Float:NADE_EXPLOSION_RADIUS = 240.0
  29.  
  30. // HACK: pev_ field used to store custom nade types and their values
  31. const PEV_NADE_TYPE = pev_flTimeStepSound
  32. const NADE_TYPE_INFECTION = 1111
  33.  
  34. new g_trailSpr, g_exploSpr, g_gibsSpr
  35.  
  36. new g_ItemID
  37. new g_InfectionBombCounter, cvar_infection_bomb_round_limit, cvar_infection_reduis
  38.  
  39. new bool:g_bHasInfection[33]
  40.  
  41. public plugin_init()
  42. {
  43.     register_plugin("[ZE] Item: Infection Bomb", ZE_VERSION, AUTHORS)
  44.    
  45.     register_forward(FM_SetModel, "fw_SetModel")
  46.     RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
  47.    
  48.     g_ItemID = ze_register_item("Infection Bomb", 50, 0)
  49.     cvar_infection_bomb_round_limit = register_cvar("ze_infection_bomb_round_limit", "3")
  50.     cvar_infection_reduis = register_cvar("ze_infection_bomb_reduis", "240")
  51. }
  52.  
  53. public plugin_precache()
  54. {
  55.     // Initialize arrays
  56.     g_sound_grenade_infect_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)
  57.     g_sound_grenade_infect_player = ArrayCreate(SOUND_MAX_LENGTH, 1)
  58.     g_sound_grenade_infect_gibs = ArrayCreate(SOUND_MAX_LENGTH, 1)
  59.    
  60.     // Load from external file
  61.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  62.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  63.    
  64.     // If we couldn't load custom sounds from file, use and save default ones
  65.     new index
  66.     if (ArraySize(g_sound_grenade_infect_explode) == 0)
  67.     {
  68.         for (index = 0; index < sizeof sound_grenade_infect_explode; index++)
  69.             ArrayPushString(g_sound_grenade_infect_explode, sound_grenade_infect_explode[index])
  70.        
  71.         // Save to external file
  72.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  73.     }
  74.     if (ArraySize(g_sound_grenade_infect_player) == 0)
  75.     {
  76.         for (index = 0; index < sizeof sound_grenade_infect_player; index++)
  77.             ArrayPushString(g_sound_grenade_infect_player, sound_grenade_infect_player[index])
  78.        
  79.         // Save to external file
  80.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  81.     }
  82.    
  83.     // Load from external file, save if not found
  84.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect, charsmax(g_model_grenade_infect)))
  85.         amx_save_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect)
  86.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))
  87.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail)
  88.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs, charsmax(g_sprite_grenade_gibs)))
  89.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs)
  90.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))
  91.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring)
  92.    
  93.     // Precache sounds
  94.     new sound[SOUND_MAX_LENGTH]
  95.     for (index = 0; index < ArraySize(g_sound_grenade_infect_explode); index++)
  96.     {
  97.         ArrayGetString(g_sound_grenade_infect_explode, index, sound, charsmax(sound))
  98.         precache_sound(sound)
  99.     }
  100.     for (index = 0; index < ArraySize(g_sound_grenade_infect_player); index++)
  101.     {
  102.         ArrayGetString(g_sound_grenade_infect_player, index, sound, charsmax(sound))
  103.         precache_sound(sound)
  104.     }
  105.    
  106.     // Precache models
  107.     precache_model(g_model_grenade_infect)
  108.     g_trailSpr = precache_model(g_sprite_grenade_trail)
  109.     g_exploSpr = precache_model(g_sprite_grenade_ring)
  110.     g_gibsSpr = precache_model(g_sprite_grenade_gibs)
  111. }
  112.  
  113. public ze_game_started()
  114. {
  115.     g_InfectionBombCounter = 0
  116. }
  117.  
  118. public ze_select_item_pre(id, itemid)
  119. {
  120.     // This is not our item
  121.     if (itemid != g_ItemID)
  122.         return ZE_ITEM_AVAILABLE;
  123.    
  124.     // Available for Humans only, So don't show it for zombies
  125.     if (!ze_is_user_zombie(id))
  126.         return ZE_ITEM_DONT_SHOW
  127.    
  128.     // Display remaining item count for this round
  129.     static text[32]
  130.     formatex(text, charsmax(text), "[%d/%d]", g_InfectionBombCounter, get_pcvar_num(cvar_infection_bomb_round_limit))
  131.     ze_add_text_to_item(text)
  132.    
  133.     // Reached infection bomb limit for this round
  134.     if (g_InfectionBombCounter >= get_pcvar_num(cvar_infection_bomb_round_limit))
  135.         return ZE_ITEM_UNAVAILABLE;
  136.    
  137.     // Player already owns infection bomb
  138.     if (g_bHasInfection[id])
  139.         return ZE_ITEM_UNAVAILABLE;
  140.    
  141.     return ZE_ITEM_AVAILABLE
  142. }
  143.  
  144. public ze_select_item_post(player, itemid)
  145. {
  146.     if (itemid != g_ItemID)
  147.         return
  148.    
  149.     // Give infection bomb
  150.     give_item(player, "weapon_hegrenade")
  151.     g_InfectionBombCounter++
  152.     g_bHasInfection[player]
  153. }
  154.  
  155. public ze_user_humanized(id)
  156. {
  157.     // Remove custom grenade model
  158.     g_bHasInfection[id] = false
  159. }
  160.  
  161. public ze_user_infected(id, attacker)
  162. {
  163.     // Set custom grenade model
  164.     cs_set_player_view_model(id, CSW_HEGRENADE, g_model_grenade_infect)
  165. }
  166.  
  167. // Forward Set Model
  168. public fw_SetModel(entity, const model[])
  169. {
  170.     // We don't care
  171.     if (strlen(model) < 8)
  172.         return;
  173.    
  174.     // Narrow down our matches a bit
  175.     if (model[7] != 'w' || model[8] != '_')
  176.         return;
  177.    
  178.     // Get damage time of grenade
  179.     static Float:dmgtime
  180.     pev(entity, pev_dmgtime, dmgtime)
  181.    
  182.     // Grenade not yet thrown
  183.     if (dmgtime == 0.0)
  184.         return;
  185.    
  186.     // Grenade's owner isn't zombie?
  187.     if (!ze_is_user_zombie(pev(entity, pev_owner)))
  188.         return;
  189.    
  190.     // HE Grenade
  191.     if (model[9] == 'h' && model[10] == 'e')
  192.     {
  193.         // Give it a glow
  194.         fm_set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
  195.        
  196.         // And a colored trail
  197.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  198.         write_byte(TE_BEAMFOLLOW) // TE id
  199.         write_short(entity) // entity
  200.         write_short(g_trailSpr) // sprite
  201.         write_byte(10) // life
  202.         write_byte(10) // width
  203.         write_byte(0) // r
  204.         write_byte(200) // g
  205.         write_byte(0) // b
  206.         write_byte(200) // brightness
  207.         message_end()
  208.        
  209.         // Set grenade type on the thrown grenade entity
  210.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
  211.     }
  212. }
  213.  
  214. // Ham Grenade Think Forward
  215. public fw_ThinkGrenade(entity)
  216. {
  217.     // Invalid entity
  218.     if (!pev_valid(entity)) return HAM_IGNORED;
  219.    
  220.     // Get damage time of grenade
  221.     static Float:dmgtime
  222.     pev(entity, pev_dmgtime, dmgtime)
  223.    
  224.     // Check if it's time to go off
  225.     if (dmgtime > get_gametime())
  226.         return HAM_IGNORED;
  227.    
  228.     // Check if it's one of our custom nades
  229.     switch (pev(entity, PEV_NADE_TYPE))
  230.     {
  231.         case NADE_TYPE_INFECTION: // Infection Bomb
  232.         {
  233.             infection_explode(entity)
  234.             return HAM_SUPERCEDE;
  235.         }
  236.     }
  237.    
  238.     return HAM_IGNORED;
  239. }
  240.  
  241. // Infection Bomb Explosion
  242. infection_explode(ent)
  243. {
  244.     // Get origin
  245.     static Float:origin[3]
  246.     pev(ent, pev_origin, origin)
  247.    
  248.     // Make the explosion
  249.     create_blast(origin)
  250.    
  251.     // Infection nade explode sound
  252.     static sound[SOUND_MAX_LENGTH]
  253.     ArrayGetString(g_sound_grenade_infect_explode, random_num(0, ArraySize(g_sound_grenade_infect_explode) - 1), sound, charsmax(sound))
  254.     emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  255.    
  256.     // Get attacker
  257.     new attacker = pev(ent, pev_owner)
  258.    
  259.     // Infection bomb owner disconnected or not zombie anymore?
  260.     if (!is_user_connected(attacker) || !ze_is_user_zombie(attacker))
  261.     {
  262.         // Get rid of the grenade
  263.         engfunc(EngFunc_RemoveEntity, ent)
  264.         return;
  265.     }
  266.    
  267.     // Collisions
  268.     new victim = -1
  269.    
  270.     while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, cvar_infection_reduis)) != 0)
  271.     {
  272.         // Only effect alive humans
  273.         if (!is_user_alive(victim) || ze_is_user_zombie(victim))
  274.             continue;
  275.        
  276.         if (ze_get_humans_number() == 1)
  277.             continue;
  278.        
  279.         // Turn into zombie
  280.         ze_set_user_zombie(victim)
  281.        
  282.         // Victim's sound
  283.         ArrayGetString(g_sound_grenade_infect_player, random_num(0, ArraySize(g_sound_grenade_infect_player) - 1), sound, charsmax(sound))
  284.         emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  285.     }
  286.    
  287.     // Get rid of the grenade
  288.     engfunc(EngFunc_RemoveEntity, ent)
  289. }
  290.  
  291. // Infection Bomb: Green Blast
  292. create_blast(const Float:origin[3])
  293. {
  294.     // Smallest ring
  295.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  296.     write_byte(TE_BEAMCYLINDER) // TE id
  297.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  298.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  299.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  300.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  301.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  302.     engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis
  303.     write_short(g_exploSpr) // sprite
  304.     write_byte(0) // startframe
  305.     write_byte(0) // framerate
  306.     write_byte(4) // life
  307.     write_byte(60) // width
  308.     write_byte(0) // noise
  309.     write_byte(0) // red
  310.     write_byte(200) // green
  311.     write_byte(0) // blue
  312.     write_byte(200) // brightness
  313.     write_byte(0) // speed
  314.     message_end()
  315.    
  316.     // Medium ring
  317.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  318.     write_byte(TE_BEAMCYLINDER) // TE id
  319.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  320.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  321.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  322.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  323.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  324.     engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis
  325.     write_short(g_exploSpr) // sprite
  326.     write_byte(0) // startframe
  327.     write_byte(0) // framerate
  328.     write_byte(4) // life
  329.     write_byte(60) // width
  330.     write_byte(0) // noise
  331.     write_byte(0) // red
  332.     write_byte(200) // green
  333.     write_byte(0) // blue
  334.     write_byte(200) // brightness
  335.     write_byte(0) // speed
  336.     message_end()
  337.    
  338.     // Largest ring
  339.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  340.     write_byte(TE_BEAMCYLINDER) // TE id
  341.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  342.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  343.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  344.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  345.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  346.     engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis
  347.     write_short(g_exploSpr) // sprite
  348.     write_byte(0) // startframe
  349.     write_byte(0) // framerate
  350.     write_byte(4) // life
  351.     write_byte(60) // width
  352.     write_byte(0) // noise
  353.     write_byte(0) // red
  354.     write_byte(200) // green
  355.     write_byte(0) // blue
  356.     write_byte(200) // brightness
  357.     write_byte(0) // speed
  358.     message_end()
  359. }
  360.  
  361. // Set entity's rendering type (from fakemeta_util)
  362. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  363. {
  364.     static Float:color[3]
  365.     color[0] = float(r)
  366.     color[1] = float(g)
  367.     color[2] = float(b)
  368.    
  369.     set_pev(entity, pev_renderfx, fx)
  370.     set_pev(entity, pev_rendercolor, color)
  371.     set_pev(entity, pev_rendermode, render)
  372.     set_pev(entity, pev_renderamt, float(amount))
  373. }
  374.  
You don't know? Learn and you will know.

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 533
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#8

Post by czirimbolo » 3 Months Ago

Raheem wrote:
3 Months Ago
czirimbolo wrote:
3 Months Ago
It cant be used on last human. Can you make this?
  1. #include <zombie_escape>
  2. #include <fun>
  3.  
  4. // Settings file
  5. new const ZE_SETTING_FILE[] = "zombie_escape.ini"
  6.  
  7. // Default sounds
  8. new const sound_grenade_infect_explode[][] = { "zombie_escape/grenade_infect.wav" }
  9. new const sound_grenade_infect_player[][] = { "scientist/scream20.wav" , "scientist/scream22.wav" , "scientist/scream05.wav" }
  10.  
  11. #define MODEL_MAX_LENGTH 64
  12. #define SOUND_MAX_LENGTH 64
  13. #define SPRITE_MAX_LENGTH 64
  14.  
  15. // Models
  16. new g_model_grenade_infect[MODEL_MAX_LENGTH] = "models/zombie_escape/v_grenade_infect.mdl"
  17.  
  18. // Sprites
  19. new g_sprite_grenade_trail[SPRITE_MAX_LENGTH] = "sprites/laserbeam.spr"
  20. new g_sprite_grenade_ring[SPRITE_MAX_LENGTH] = "sprites/shockwave.spr"
  21. new g_sprite_grenade_gibs[SPRITE_MAX_LENGTH] = "sprites/zombie_escape/infect_gibs.spr"
  22.  
  23. new Array:g_sound_grenade_infect_explode
  24. new Array:g_sound_grenade_infect_player
  25. new Array:g_sound_grenade_infect_gibs
  26.  
  27. // Explosion radius for custom grenades
  28. const Float:NADE_EXPLOSION_RADIUS = 240.0
  29.  
  30. // HACK: pev_ field used to store custom nade types and their values
  31. const PEV_NADE_TYPE = pev_flTimeStepSound
  32. const NADE_TYPE_INFECTION = 1111
  33.  
  34. new g_trailSpr, g_exploSpr, g_gibsSpr
  35.  
  36. new g_ItemID
  37. new g_InfectionBombCounter, cvar_infection_bomb_round_limit, cvar_infection_reduis
  38.  
  39. new bool:g_bHasInfection[33]
  40.  
  41. public plugin_init()
  42. {
  43.     register_plugin("[ZE] Item: Infection Bomb", ZE_VERSION, AUTHORS)
  44.    
  45.     register_forward(FM_SetModel, "fw_SetModel")
  46.     RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
  47.    
  48.     g_ItemID = ze_register_item("Infection Bomb", 50, 0)
  49.     cvar_infection_bomb_round_limit = register_cvar("ze_infection_bomb_round_limit", "3")
  50.     cvar_infection_reduis = register_cvar("ze_infection_bomb_reduis", "240")
  51. }
  52.  
  53. public plugin_precache()
  54. {
  55.     // Initialize arrays
  56.     g_sound_grenade_infect_explode = ArrayCreate(SOUND_MAX_LENGTH, 1)
  57.     g_sound_grenade_infect_player = ArrayCreate(SOUND_MAX_LENGTH, 1)
  58.     g_sound_grenade_infect_gibs = ArrayCreate(SOUND_MAX_LENGTH, 1)
  59.    
  60.     // Load from external file
  61.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  62.     amx_load_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  63.    
  64.     // If we couldn't load custom sounds from file, use and save default ones
  65.     new index
  66.     if (ArraySize(g_sound_grenade_infect_explode) == 0)
  67.     {
  68.         for (index = 0; index < sizeof sound_grenade_infect_explode; index++)
  69.             ArrayPushString(g_sound_grenade_infect_explode, sound_grenade_infect_explode[index])
  70.        
  71.         // Save to external file
  72.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT EXPLODE", g_sound_grenade_infect_explode)
  73.     }
  74.     if (ArraySize(g_sound_grenade_infect_player) == 0)
  75.     {
  76.         for (index = 0; index < sizeof sound_grenade_infect_player; index++)
  77.             ArrayPushString(g_sound_grenade_infect_player, sound_grenade_infect_player[index])
  78.        
  79.         // Save to external file
  80.         amx_save_setting_string_arr(ZE_SETTING_FILE, "Sounds", "GRENADE INFECT PLAYER", g_sound_grenade_infect_player)
  81.     }
  82.    
  83.     // Load from external file, save if not found
  84.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect, charsmax(g_model_grenade_infect)))
  85.         amx_save_setting_string(ZE_SETTING_FILE, "Weapon Models", "GRENADE INFECT", g_model_grenade_infect)
  86.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail, charsmax(g_sprite_grenade_trail)))
  87.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT TRAIL", g_sprite_grenade_trail)
  88.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs, charsmax(g_sprite_grenade_gibs)))
  89.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "GRENADE INFECT GIBS", g_sprite_grenade_gibs)
  90.     if (!amx_load_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring, charsmax(g_sprite_grenade_ring)))
  91.         amx_save_setting_string(ZE_SETTING_FILE, "Grenade Sprites", "RING", g_sprite_grenade_ring)
  92.    
  93.     // Precache sounds
  94.     new sound[SOUND_MAX_LENGTH]
  95.     for (index = 0; index < ArraySize(g_sound_grenade_infect_explode); index++)
  96.     {
  97.         ArrayGetString(g_sound_grenade_infect_explode, index, sound, charsmax(sound))
  98.         precache_sound(sound)
  99.     }
  100.     for (index = 0; index < ArraySize(g_sound_grenade_infect_player); index++)
  101.     {
  102.         ArrayGetString(g_sound_grenade_infect_player, index, sound, charsmax(sound))
  103.         precache_sound(sound)
  104.     }
  105.    
  106.     // Precache models
  107.     precache_model(g_model_grenade_infect)
  108.     g_trailSpr = precache_model(g_sprite_grenade_trail)
  109.     g_exploSpr = precache_model(g_sprite_grenade_ring)
  110.     g_gibsSpr = precache_model(g_sprite_grenade_gibs)
  111. }
  112.  
  113. public ze_game_started()
  114. {
  115.     g_InfectionBombCounter = 0
  116. }
  117.  
  118. public ze_select_item_pre(id, itemid)
  119. {
  120.     // This is not our item
  121.     if (itemid != g_ItemID)
  122.         return ZE_ITEM_AVAILABLE;
  123.    
  124.     // Available for Humans only, So don't show it for zombies
  125.     if (!ze_is_user_zombie(id))
  126.         return ZE_ITEM_DONT_SHOW
  127.    
  128.     // Display remaining item count for this round
  129.     static text[32]
  130.     formatex(text, charsmax(text), "[%d/%d]", g_InfectionBombCounter, get_pcvar_num(cvar_infection_bomb_round_limit))
  131.     ze_add_text_to_item(text)
  132.    
  133.     // Reached infection bomb limit for this round
  134.     if (g_InfectionBombCounter >= get_pcvar_num(cvar_infection_bomb_round_limit))
  135.         return ZE_ITEM_UNAVAILABLE;
  136.    
  137.     // Player already owns infection bomb
  138.     if (g_bHasInfection[id])
  139.         return ZE_ITEM_UNAVAILABLE;
  140.    
  141.     return ZE_ITEM_AVAILABLE
  142. }
  143.  
  144. public ze_select_item_post(player, itemid)
  145. {
  146.     if (itemid != g_ItemID)
  147.         return
  148.    
  149.     // Give infection bomb
  150.     give_item(player, "weapon_hegrenade")
  151.     g_InfectionBombCounter++
  152.     g_bHasInfection[player]
  153. }
  154.  
  155. public ze_user_humanized(id)
  156. {
  157.     // Remove custom grenade model
  158.     g_bHasInfection[id] = false
  159. }
  160.  
  161. public ze_user_infected(id, attacker)
  162. {
  163.     // Set custom grenade model
  164.     cs_set_player_view_model(id, CSW_HEGRENADE, g_model_grenade_infect)
  165. }
  166.  
  167. // Forward Set Model
  168. public fw_SetModel(entity, const model[])
  169. {
  170.     // We don't care
  171.     if (strlen(model) < 8)
  172.         return;
  173.    
  174.     // Narrow down our matches a bit
  175.     if (model[7] != 'w' || model[8] != '_')
  176.         return;
  177.    
  178.     // Get damage time of grenade
  179.     static Float:dmgtime
  180.     pev(entity, pev_dmgtime, dmgtime)
  181.    
  182.     // Grenade not yet thrown
  183.     if (dmgtime == 0.0)
  184.         return;
  185.    
  186.     // Grenade's owner isn't zombie?
  187.     if (!ze_is_user_zombie(pev(entity, pev_owner)))
  188.         return;
  189.    
  190.     // HE Grenade
  191.     if (model[9] == 'h' && model[10] == 'e')
  192.     {
  193.         // Give it a glow
  194.         fm_set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);
  195.        
  196.         // And a colored trail
  197.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  198.         write_byte(TE_BEAMFOLLOW) // TE id
  199.         write_short(entity) // entity
  200.         write_short(g_trailSpr) // sprite
  201.         write_byte(10) // life
  202.         write_byte(10) // width
  203.         write_byte(0) // r
  204.         write_byte(200) // g
  205.         write_byte(0) // b
  206.         write_byte(200) // brightness
  207.         message_end()
  208.        
  209.         // Set grenade type on the thrown grenade entity
  210.         set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
  211.     }
  212. }
  213.  
  214. // Ham Grenade Think Forward
  215. public fw_ThinkGrenade(entity)
  216. {
  217.     // Invalid entity
  218.     if (!pev_valid(entity)) return HAM_IGNORED;
  219.    
  220.     // Get damage time of grenade
  221.     static Float:dmgtime
  222.     pev(entity, pev_dmgtime, dmgtime)
  223.    
  224.     // Check if it's time to go off
  225.     if (dmgtime > get_gametime())
  226.         return HAM_IGNORED;
  227.    
  228.     // Check if it's one of our custom nades
  229.     switch (pev(entity, PEV_NADE_TYPE))
  230.     {
  231.         case NADE_TYPE_INFECTION: // Infection Bomb
  232.         {
  233.             infection_explode(entity)
  234.             return HAM_SUPERCEDE;
  235.         }
  236.     }
  237.    
  238.     return HAM_IGNORED;
  239. }
  240.  
  241. // Infection Bomb Explosion
  242. infection_explode(ent)
  243. {
  244.     // Get origin
  245.     static Float:origin[3]
  246.     pev(ent, pev_origin, origin)
  247.    
  248.     // Make the explosion
  249.     create_blast(origin)
  250.    
  251.     // Infection nade explode sound
  252.     static sound[SOUND_MAX_LENGTH]
  253.     ArrayGetString(g_sound_grenade_infect_explode, random_num(0, ArraySize(g_sound_grenade_infect_explode) - 1), sound, charsmax(sound))
  254.     emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  255.    
  256.     // Get attacker
  257.     new attacker = pev(ent, pev_owner)
  258.    
  259.     // Infection bomb owner disconnected or not zombie anymore?
  260.     if (!is_user_connected(attacker) || !ze_is_user_zombie(attacker))
  261.     {
  262.         // Get rid of the grenade
  263.         engfunc(EngFunc_RemoveEntity, ent)
  264.         return;
  265.     }
  266.    
  267.     // Collisions
  268.     new victim = -1
  269.    
  270.     while ((victim = engfunc(EngFunc_FindEntityInSphere, victim, origin, cvar_infection_reduis)) != 0)
  271.     {
  272.         // Only effect alive humans
  273.         if (!is_user_alive(victim) || ze_is_user_zombie(victim))
  274.             continue;
  275.        
  276.         if (ze_get_humans_number() == 1)
  277.             continue;
  278.        
  279.         // Turn into zombie
  280.         ze_set_user_zombie(victim)
  281.        
  282.         // Victim's sound
  283.         ArrayGetString(g_sound_grenade_infect_player, random_num(0, ArraySize(g_sound_grenade_infect_player) - 1), sound, charsmax(sound))
  284.         emit_sound(victim, CHAN_VOICE, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
  285.     }
  286.    
  287.     // Get rid of the grenade
  288.     engfunc(EngFunc_RemoveEntity, ent)
  289. }
  290.  
  291. // Infection Bomb: Green Blast
  292. create_blast(const Float:origin[3])
  293. {
  294.     // Smallest ring
  295.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  296.     write_byte(TE_BEAMCYLINDER) // TE id
  297.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  298.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  299.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  300.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  301.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  302.     engfunc(EngFunc_WriteCoord, origin[2]+385.0) // z axis
  303.     write_short(g_exploSpr) // sprite
  304.     write_byte(0) // startframe
  305.     write_byte(0) // framerate
  306.     write_byte(4) // life
  307.     write_byte(60) // width
  308.     write_byte(0) // noise
  309.     write_byte(0) // red
  310.     write_byte(200) // green
  311.     write_byte(0) // blue
  312.     write_byte(200) // brightness
  313.     write_byte(0) // speed
  314.     message_end()
  315.    
  316.     // Medium ring
  317.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  318.     write_byte(TE_BEAMCYLINDER) // TE id
  319.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  320.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  321.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  322.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  323.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  324.     engfunc(EngFunc_WriteCoord, origin[2]+470.0) // z axis
  325.     write_short(g_exploSpr) // sprite
  326.     write_byte(0) // startframe
  327.     write_byte(0) // framerate
  328.     write_byte(4) // life
  329.     write_byte(60) // width
  330.     write_byte(0) // noise
  331.     write_byte(0) // red
  332.     write_byte(200) // green
  333.     write_byte(0) // blue
  334.     write_byte(200) // brightness
  335.     write_byte(0) // speed
  336.     message_end()
  337.    
  338.     // Largest ring
  339.     engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, origin, 0)
  340.     write_byte(TE_BEAMCYLINDER) // TE id
  341.     engfunc(EngFunc_WriteCoord, origin[0]) // x
  342.     engfunc(EngFunc_WriteCoord, origin[1]) // y
  343.     engfunc(EngFunc_WriteCoord, origin[2]) // z
  344.     engfunc(EngFunc_WriteCoord, origin[0]) // x axis
  345.     engfunc(EngFunc_WriteCoord, origin[1]) // y axis
  346.     engfunc(EngFunc_WriteCoord, origin[2]+555.0) // z axis
  347.     write_short(g_exploSpr) // sprite
  348.     write_byte(0) // startframe
  349.     write_byte(0) // framerate
  350.     write_byte(4) // life
  351.     write_byte(60) // width
  352.     write_byte(0) // noise
  353.     write_byte(0) // red
  354.     write_byte(200) // green
  355.     write_byte(0) // blue
  356.     write_byte(200) // brightness
  357.     write_byte(0) // speed
  358.     message_end()
  359. }
  360.  
  361. // Set entity's rendering type (from fakemeta_util)
  362. stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
  363. {
  364.     static Float:color[3]
  365.     color[0] = float(r)
  366.     color[1] = float(g)
  367.     color[2] = float(b)
  368.    
  369.     set_pev(entity, pev_renderfx, fx)
  370.     set_pev(entity, pev_rendercolor, color)
  371.     set_pev(entity, pev_rendermode, render)
  372.     set_pev(entity, pev_renderamt, float(amount))
  373. }
  374.  
Thanks mate. In my opinion its too powerful item. So I have small request. If humans have more armor than 55 (>55), this bomb will not infect a human. Can you make it?
Image

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 533
Joined: 2 Years Ago
Has thanked: 19 times
Been thanked: 1 time
Contact:

#9

Post by czirimbolo » 3 Months Ago

Ok its bugged. Sometimes you can infect and sometimes not
Image

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 399
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#10

Post by Muhammet20 » 3 Months Ago

bad grenade, the zombies can win every round with it
i don't prefer it

[ Post made via Android ]
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests