Page 1 of 1

Fire Nade Effects

Posted: 04 Mar 2017, 20:37
by Raheem
Fire Nade Effects

Description:
  • Simple plugin that will add nice Effects for Fire Nade, So this will add in general Trail for the Grenade and there is Explosion Effect but it will appear only if the nade hit the zombies which mean when they get burn the effect will appear (This may reduce effect lag in case of it's not zombie).
Installation & Instructions:
  • Simply install it like any plugin but don't forget to copy sound and sprites folder to your server.
Changelog:
  • Spoiler!
    Version: 1.0
    • First Release.
    Version: 1.1 [Current Version]
    • Code optimized to use ReAPI engine functions.
Screenshots:
  • ImageImageImage
  • ImageImageImage
Downloads:

Re: Fire Nade Effects

Posted: 05 Mar 2017, 09:17
by OxiCorm
Nice plugin raheem ilove ur work and ihope u start to learn pawn iwill the first one who follow u ur work and ur explaining its so easy love ubro

Re: Fire Nade Effects

Posted: 05 Mar 2017, 10:48
by Raheem
OxiCorm wrote:
2 Years Ago
Nice plugin raheem ilove ur work and ihope u start to learn pawn iwill the first one who follow u ur work and ur explaining its so easy love ubro
I'll make videos for PAWN language this is my next project but this project will started when i finish this term i'am studing. These videos will be in arabic language for all arabs to learn this language and i'll try make things very easy with our language.

Re: Fire Nade Effects

Posted: 08 Mar 2017, 19:46
by Mohamed Alaa
In line 61, you added return PLUGIN_CONTINUE .. It's useless.
----------------------------------------------------------------------------------------------
For people who wanna use many sounds, do below:

1-Find:
    1. new const g_szSndExplosion[] = "new_exp1.wav"

    Change to:

    1. new const g_szSndExplosion[][] =
    2. {
    3.     "new_exp1.wav",
    4.     "new_exp2.wav",
    5.     "new_exp3.wav"
    6. }

    And you can add more.
2-Find: 3-Find:
    1. emit_sound(iEnt, CHAN_AUTO, g_szSndExplosion, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

    Change to:

    1. emit_sound(iEnt, CHAN_AUTO, random_num(0, sizeof(g_szSndExplosion)), VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
----------------------------------------------------------------------------------------------
You done! :D

Re: Fire Nade Effects

Posted: 08 Mar 2017, 21:56
by Raheem
-If you don't return PLUGIN_CONTINUE the zombies won't get fired. This is an pre_fire Forward which is very important to return a value on it.

-Nice Edit so the final code will be:

  1. #include <zombie_escape>
  2.  
  3. new const g_szSndExplosion[][] =
  4. {
  5.     "new_exp1.wav",
  6.     "new_exp2.wav"
  7. }
  8.  
  9. enum _:Sprites
  10. {
  11.     SPRITE_BEAM,
  12.     SPRITE_EXPLOSION,
  13.     SPRITE_EXPLOSION2,
  14.     SPRITE_SMOKE,
  15.     SPRITE_CYLINDER,
  16.     SPRITE_FLARE,
  17. }
  18.  
  19. new g_iSprites[Sprites]
  20.  
  21. public plugin_precache()
  22. {
  23.     for(new i = 0; i <= sizeof(g_szSndExplosion); i++)
  24.         precache_sound(g_szSndExplosion[i])
  25.    
  26.     g_iSprites[SPRITE_SMOKE] = precache_model("sprites/black_smoke4.spr")
  27.     g_iSprites[SPRITE_BEAM] = precache_model("sprites/new_trail_1.spr")
  28.     g_iSprites[SPRITE_EXPLOSION] = precache_model("sprites/new_explosion_1.spr")
  29.     g_iSprites[SPRITE_EXPLOSION2] = precache_model("sprites/new_explosion_2.spr")
  30.     g_iSprites[SPRITE_CYLINDER] = precache_model("sprites/white.spr")
  31.     g_iSprites[SPRITE_FLARE] = precache_model("sprites/3dmflaora.spr")
  32. }
  33.  
  34. public plugin_init()
  35. {
  36.     register_plugin("[ZE] FireNade Effects", "1.0", "Raheem")
  37. }
  38.  
  39. public grenade_throw(id, iEnt, iWeapon)
  40. {
  41.     switch(iWeapon)
  42.     {
  43.         case CSW_HEGRENADE:
  44.         {
  45.             UTIL_BeamFollow(iEnt, g_iSprites[SPRITE_BEAM], 12, 40, 255, 128, 0, 255)
  46.             UTIL_BeamFollow(iEnt, g_iSprites[SPRITE_BEAM], 8, 30, 255, 135, 40, 150)
  47.             UTIL_BeamFollow(iEnt, g_iSprites[SPRITE_BEAM], 5, 5, 255, 255, 255, 255)
  48.         }
  49.     }
  50. }
  51.  
  52. public ze_fire_pre(iEnt)
  53. {
  54.     emit_sound(iEnt, CHAN_AUTO, random_num(0, sizeof(g_szSndExplosion)), VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  55.            
  56.     UTIL_Explosion(iEnt, g_iSprites[SPRITE_EXPLOSION], 50, 30, 4)
  57.     UTIL_Explosion(iEnt, g_iSprites[SPRITE_EXPLOSION2], 50, 10, 4)
  58.            
  59.     UTIL_Smoke(iEnt, g_iSprites [SPRITE_SMOKE], 30, 30)
  60.     UTIL_Smoke(iEnt, g_iSprites[SPRITE_SMOKE], 15, 25)
  61.            
  62.     UTIL_DLight(iEnt, 80, 255, 128, 0, 50, 40 );
  63.     UTIL_BeamCylinder(iEnt, g_iSprites[SPRITE_CYLINDER], 0, 6, 20, 255, 255, 128, 0, 255, 0)
  64.     UTIL_SpriteTrail(iEnt, g_iSprites[SPRITE_FLARE], 15, 3, 3, 50, 0)
  65.    
  66.     return PLUGIN_CONTINUE
  67. }
  68.    
  69. UTIL_BeamCylinder(iEnt, iSprite, iFramerate, iLife, iWidth, iAmplitude, iRed, iGreen, iBlue, iBright, iSpeed)
  70. {
  71.     new Float:vOrigin[3]
  72.     pev(iEnt, pev_origin, vOrigin)
  73.    
  74.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  75.     write_byte(TE_BEAMCYLINDER)
  76.     engfunc(EngFunc_WriteCoord, vOrigin[0])
  77.     engfunc(EngFunc_WriteCoord, vOrigin[1])
  78.     engfunc(EngFunc_WriteCoord, vOrigin[2] + 10)
  79.     engfunc(EngFunc_WriteCoord, vOrigin[0] );
  80.     engfunc(EngFunc_WriteCoord, vOrigin[1] + 400)
  81.     engfunc(EngFunc_WriteCoord, vOrigin[2] + 400)
  82.     write_short(iSprite)
  83.     write_byte(0)
  84.     write_byte(iFramerate)
  85.     write_byte(iLife)
  86.     write_byte(iWidth)
  87.     write_byte(iAmplitude)
  88.     write_byte(iRed)
  89.     write_byte(iGreen)
  90.     write_byte(iBlue)
  91.     write_byte(iBright)
  92.     write_byte(iSpeed)
  93.     message_end()
  94. }
  95.    
  96. UTIL_BeamFollow(iEnt, iSprite, iLife, iWidth, iRed, iGreen, iBlue, iBright)
  97. {
  98.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  99.     write_byte(TE_BEAMFOLLOW)
  100.     write_short(iEnt)
  101.     write_short(iSprite)
  102.     write_byte(iLife)
  103.     write_byte(iWidth)
  104.     write_byte(iRed)
  105.     write_byte(iGreen)
  106.     write_byte(iBlue)
  107.     write_byte(iBright)
  108.     message_end()
  109. }
  110.  
  111. UTIL_DLight(iEnt, iRadius, iRed, iGreen, iBlue, iLife, iDecay)
  112. {
  113.     new Float:vOrigin[3]
  114.     pev(iEnt, pev_origin, vOrigin)
  115.    
  116.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  117.     write_byte(TE_DLIGHT)
  118.     engfunc(EngFunc_WriteCoord, vOrigin[0])
  119.     engfunc(EngFunc_WriteCoord, vOrigin[1])
  120.     engfunc(EngFunc_WriteCoord, vOrigin[2])
  121.     write_byte(iRadius)
  122.     write_byte(iRed)
  123.     write_byte(iGreen)
  124.     write_byte(iBlue)
  125.     write_byte(iLife)
  126.     write_byte(iDecay)
  127.     message_end()
  128. }
  129.  
  130. UTIL_Explosion(iEnt, iSprite, iScale, iFramerate, Flags)
  131. {
  132.     new Float:vOrigin[3]
  133.     pev(iEnt, pev_origin, vOrigin)
  134.    
  135.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  136.     write_byte( TE_EXPLOSION )
  137.     engfunc(EngFunc_WriteCoord, vOrigin[0])
  138.     engfunc(EngFunc_WriteCoord, vOrigin[1])
  139.     engfunc(EngFunc_WriteCoord, vOrigin[2])
  140.     write_short(iSprite)
  141.     write_byte(iScale)
  142.     write_byte(iFramerate)
  143.     write_byte(Flags)
  144.     message_end()
  145. }
  146.  
  147. UTIL_SpriteTrail(iEnt, iSprite, iCount, iLife, iScale, iVelocity, iVary)
  148. {
  149.     new Float:vOrigin[3]
  150.     pev(iEnt, pev_origin, vOrigin)
  151.    
  152.     message_begin( MSG_BROADCAST, SVC_TEMPENTITY)
  153.     write_byte(TE_SPRITETRAIL)
  154.     engfunc(EngFunc_WriteCoord, vOrigin[0])
  155.     engfunc(EngFunc_WriteCoord, vOrigin[1])
  156.     engfunc(EngFunc_WriteCoord, vOrigin[2] + 100)
  157.     engfunc(EngFunc_WriteCoord, vOrigin[0] + random_float(-200.0, 200.0))
  158.     engfunc(EngFunc_WriteCoord, vOrigin[1] + random_float(-200.0, 200.0))
  159.     engfunc(EngFunc_WriteCoord, vOrigin[2])
  160.     write_short(iSprite)
  161.     write_byte(iCount)
  162.     write_byte(iLife)
  163.     write_byte(iScale)
  164.     write_byte(iVelocity)
  165.     write_byte(iVary)
  166.     message_end()
  167. }
  168.  
  169. UTIL_Smoke(iEnt, iSprite, iScale, iFramerate)
  170. {
  171.     new Float:vOrigin[3]
  172.     pev(iEnt, pev_origin, vOrigin)
  173.    
  174.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  175.     write_byte(TE_SMOKE)
  176.     engfunc(EngFunc_WriteCoord, vOrigin[0])
  177.     engfunc(EngFunc_WriteCoord, vOrigin[1])
  178.     engfunc(EngFunc_WriteCoord, vOrigin[2])
  179.     write_short( iSprite)
  180.     write_byte(iScale)
  181.     write_byte(iFramerate)
  182.     message_end()
  183. }

Re: Fire Nade Effects

Posted: 29 Jul 2017, 05:13
by Raheem
New version available: 1.1