Converted Ethereal

Zombies/Humans Extra-Items
johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

Ethereal

#1

Post by johnnysins2000 » 2 Years Ago

Ethereal

Description:
  • Here this is another Gun Ethereal Converted into ZE VIP Extra Item. This Ethereal Gun is a type of Aug Rifle but it shoots Lasers.It also Has Second mode which is electricity Mode. U can turn it on when the dark blue bolt sign on your left side of the screen Turn Light Blue.
  • Only VIP Members Will be able to see the The VIP Extra item
Installation & Instructions:
  • Simply install it like any plugin and Don't forget to copy Models in zombie_escape Folder, Sounds, Sprites.
  • You should install VIP plugin so this plugin works.
  • The VIP flag used is VIP_A so VIP to get this gun he should have access a.

Screenshots:
  • ImageImageImageImageImage
Downloads:
  • Ethereal.zip
    [ZE] Extra-Item: Ethereal
    (925.02 KiB) Downloaded 292 times
    Ethereal.zip
    [ZE] Extra-Item: Ethereal
    (925.02 KiB) Downloaded 292 times
Last edited by Raheem on 28 Jul 2017, 02:18, edited 2 times in total.
Reason: Updating to work with Zombie Escape v1.1 & VIP v1.1
These users thanked the author johnnysins2000 for the post:
Prekrasnoe Daleko (1 Year Ago)
Nobody Is That Busy If They Make Time :roll:

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 » 2 Years Ago

I added working screenshots. Nice work bro we will wait you to convert more and more.
You don't know? Learn and you will know.

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 21
Contact:

#3

Post by Prekrasnoe Daleko » 1 Year Ago

Heloo, not working this plugin , whats problem?
logs :
Start of error session.
Info (map "ze_isla_arcivias_f2") (file "addons/amxmodx/logs/error_20180408.log")
[AMXX] Plugin file open error (plugin "ze_extra_vip_ethereal.amxx")

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#4

Post by johnnysins2000 » 1 Year Ago

Ayde12 wrote:
1 Year Ago
Heloo, not working this plugin , whats problem?
logs :
Start of error session.
Info (map "ze_isla_arcivias_f2") (file "addons/amxmodx/logs/error_20180408.log")
[AMXX] Plugin file open error (plugin "ze_extra_vip_ethereal.amxx")
Are u using ze v1.2?

If u are then just restart the map

That plugin is not being loaded in that map

That is what this error means


Just reload the map several times until that plugin loads into that map and it will work
These users thanked the author johnnysins2000 for the post:
Prekrasnoe Daleko (1 Year Ago)
Nobody Is That Busy If They Make Time :roll:

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 21
Contact:

#5

Post by Prekrasnoe Daleko » 1 Year Ago

johnnysins2000 wrote:
1 Year Ago

Are u using ze v1.2?

If u are then just restart the map

That plugin is not being loaded in that map

That is what this error means


Just reload the map several times until that plugin loads into that map and it will work
yes i'm using ze v 1.2, for other map not working, no problems map
These users thanked the author Prekrasnoe Daleko for the post:
johnnysins2000 (1 Year Ago)

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#6

Post by johnnysins2000 » 1 Year Ago

Ayde12 wrote:
1 Year Ago
johnnysins2000 wrote:
1 Year Ago

Are u using ze v1.2?

If u are then just restart the map

That plugin is not being loaded in that map

That is what this error means


Just reload the map several times until that plugin loads into that map and it will work
yes i'm using ze v 1.2, for other map not working, no problems map
Have u put the resources of This Plugin ?

1 thing can be missing from your server

This is a vip extra item

Make sure u have latest ZE VIP plugin install in your server .

And also convert this Item with latest VIP method

This should solve your Problem
These users thanked the author johnnysins2000 for the post:
Prekrasnoe Daleko (1 Year Ago)
Nobody Is That Busy If They Make Time :roll:

User avatar
Prekrasnoe Daleko
Member
Member
Russia
Posts: 32
Joined: 1 Year Ago
Location: Россия,Крым
Has thanked: 11 times
Been thanked: 1 time
Age: 21
Contact:

#7

Post by Prekrasnoe Daleko » 1 Year Ago

hello ,johnnysins2000 all work thanks.

johnnysins2000
Veteran Member
Veteran Member
Pakistan
Posts: 672
Joined: 2 Years Ago
Location: Lahore
Has thanked: 11 times
Been thanked: 10 times
Age: 22
Contact:

#8

Post by johnnysins2000 » 1 Year Ago

Ayde12 wrote:
1 Year Ago
hello ,johnnysins2000 all work thanks.
All Right :)
Nobody Is That Busy If They Make Time :roll:

LosT
Member
Member
Belgium
Posts: 13
Joined: 1 Year Ago
Has thanked: 0
Been thanked: 0
Contact:

#9

Post by LosT » 1 Year Ago

error

Code: Select all

//// ze_extra_VIP_ethereal.sma
//
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(211) : error 017: undefined symbol "create_entity"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(212) : error 017: undefined symbol "entity_set_model"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(213) : error 017: undefined symbol "entity_set_float"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(213) : warning 215: expression has no effect
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(213) : error 001: expected token: ";", but found ")"
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(213) : error 029: invalid expression, assumed zero
// C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\ze_extra_VIP_ethereal.sma(213) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
// Could not locate output file C:\Users\rappe\Desktop\SCRIPTING-ZE1.2\compiled\ze_extra_VIP_ethereal.amx (compile failed).
//
// Compilation Time: 1.89 sec

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:

#10

Post by Raheem » 1 Year Ago

Fixed the Weapon HUD Sprite:

  1. #include <zombie_escape>
  2. #include <engine>
  3. #include <ze_vip>
  4. #include <cstrike>
  5. #include <xs>
  6. #include <fun>
  7.  
  8. #define ENG_NULLENT         -1
  9. #define EV_INT_WEAPONKEY        EV_INT_impulse
  10. #define ethereal_WEAPONKEY      666
  11. #define MAX_PLAYERS             32
  12. #define IsValidUser(%1)         (1 <= %1 <= g_MaxPlayers)
  13. #define m_flNextSecondaryAttack     47
  14.  
  15. const USE_STOPPED = 0
  16. const OFFSET_ACTIVE_ITEM = 373
  17. const OFFSET_WEAPONOWNER = 41
  18. const OFFSET_LINUX = 5
  19. const OFFSET_LINUX_WEAPONS = 4
  20.  
  21. #define write_coord_f(%1)       engfunc(EngFunc_WriteCoord,%1)
  22. #define WEAP_LINUX_XTRA_OFF     4
  23. #define m_fKnown            44
  24. #define m_flNextPrimaryAttack       46
  25. #define m_flTimeWeaponIdle      48
  26. #define m_iClip             51
  27. #define m_fInReload         54
  28. #define PLAYER_LINUX_XTRA_OFF       5
  29. #define m_flNextAttack          83
  30.  
  31. #define ethereal_RELOAD_TIME    3.0
  32. #define ethereal_RELOAD     1
  33. #define ethereal_DRAW       2
  34. #define ethereal_SHOOT1     3
  35. #define ethereal_SHOOT2     4
  36.  
  37. #define deathMSG        //Death Message
  38. #define Icon            //Left Icon
  39. #define ZombiePlague
  40. #if defined Icon
  41.     new g_Msg_StatusIcon
  42. #endif
  43.  
  44. /*Laser Ethereal Mode: Color Settings */
  45. //Laser Ethereal Icon Colors
  46. #define l_ethereal_i_r      0   //R
  47. #define l_ethereal_i_g      0   //G
  48. #define l_ethereal_i_b      200 //B
  49. //Laser Ethereal Line Colors
  50. #define l_ethereal_l_r      0   //R
  51. #define l_ethereal_l_g      0   //G
  52. #define l_ethereal_l_b      200 //B
  53.  
  54.  
  55.  
  56. /* Ethereal Electro Mode Settings */
  57. //Electro Ethereal Icon Colors
  58. #define e_ethereal_i_r      0   //R
  59. #define e_ethereal_i_g      200 //G
  60. #define e_ethereal_i_b      200 //B
  61.  
  62. //Electro Ethereal Line Colors
  63. #define e_ethereal_l_r      0   //R
  64. #define e_ethereal_l_g      200 //G
  65. #define e_ethereal_l_b      200 //B
  66.  
  67. //Electro Ethereal Line Size
  68. #define e_ethereal_ls_min   0   //Min size
  69. #define e_ethereal_ls_max   30  //Max size
  70.  
  71. //  On\Off
  72. //#define electro_fire_hole //Electro Hole Effect
  73. //#define electro_fire_smoke    //Electro Smode Effect
  74.  
  75.  
  76. #define get_bit(%1,%2)      (%1 & (1 << (%2 & 31)))
  77. #define set_bit(%1,%2)      %1 |= (1 << (%2 & 31))
  78. #define reset_bit(%1,%2)    %1 &= ~(1 << (%2 & 31))
  79.  
  80. new g_bitsMuzzleFlash;
  81.  
  82. new g_iEntity;
  83.  
  84. new const Laser_Sounds[] = { "weapons/ethereal_shoot1.wav" }    //Laser mode fire sound
  85. new const Electro_Sounds[]= { "weapons/ethereal_shoot1.wav" }   //Electro mode fire sound
  86.  
  87. new ethereal_V_MODEL[64] = "models/zombie_escape/v_ethereal.mdl"        //v_model
  88. new ethereal_P_MODEL[64] = "models/zombie_escape/p_ethereal.mdl"    //p_model
  89. new ethereal_W_MODEL[64] = "models/zombie_escape/w_ethereal.mdl"    //w_model
  90.  
  91.  
  92. new cvar_dmg_ethereal_laser, cvar_spd_ethereal_laser,cvar_recoil_ethereal_laser
  93. new cvar_dmg_ethereal_electro, cvar_spd_ethereal_electro,cvar_recoil_ethereal_electro
  94.  
  95. new g_itemid_ethereal, cvar_clip_ethereal, cvar_ethereal_ammo
  96. new g_MaxPlayers, g_orig_event_ethereal, g_IsInPrimaryAttack
  97. new Float:cl_pushangle[MAX_PLAYERS + 1][3], m_iBlood[2]
  98. new g_has_ethereal[33], g_clip_ammo[33], g_ethereal_TmpClip[33], oldweap[33]
  99. new gmsgWeaponList
  100. new g_SmokePuff_SprId
  101. new g_iItemID
  102. static wSprite
  103. const UNIT_SECOND = (1 << 12)
  104. new eth_mode[33]
  105. new ethereal_changemode[33]
  106. new ethereal_reloaded[33]
  107. const PRIMARY_WEAPONS_BIT_SUM =
  108. (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
  109. CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
  110. new const WEAPONENTNAMES[][] = { "", "weapon_p228", "", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10",
  111.             "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550",
  112.             "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249",
  113.             "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552",
  114.             "weapon_ak47", "weapon_knife", "weapon_p90" }
  115.  
  116. public plugin_init()
  117. {
  118.     register_plugin("[WPN] Ethereal", "1.0", "Chrescoe1")
  119.     /*
  120.      *Crock / =) (Poprogun4ik) / LARS-DAY[BR]EAKER - Authors Original Code "Scar Basic Edition"
  121.      *Dias - Thank's for Smoke and bullet hole from Balrog 3
  122.      *Alexander.3 - Thank's for LineTraceAttack from zl_Ethereal
  123.      *WPMG Team - Thank's for Muzzle
  124.      *Extra : Ethereal (by Shurik)  - Weapon model and resource
  125.      *Chrescoe1 - Changed "Scar Basic Edition" and use all code to create "Ethereal dual-mode"
  126.     */
  127.     #if defined Icon
  128.         g_Msg_StatusIcon = get_user_msgid("StatusIcon")
  129.     #endif
  130.     #if defined deathMSG
  131.         register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")
  132.     #endif
  133.    
  134.     register_event("CurWeapon","CurrentWeapon","be","1=1")
  135.    
  136.     RegisterHam(Ham_Item_AddToPlayer, "weapon_aug", "fw_ethereal_AddToPlayer")
  137.     RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1)
  138.     RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1)
  139.     RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1)
  140.     RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1)
  141.    
  142.     for (new i = 1; i < sizeof WEAPONENTNAMES; i++)
  143.    
  144.     if (WEAPONENTNAMES[i][0])
  145.         RegisterHam(Ham_Item_Deploy, WEAPONENTNAMES[i], "fw_Item_Deploy_Post", 1)
  146.    
  147.     RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_aug", "fw_ethereal_PrimaryAttack")
  148.     RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_aug", "fw_ethereal_PrimaryAttack_Post", 1)
  149.     RegisterHam(Ham_Item_PostFrame, "weapon_aug", "ethereal_ItemPostFrame")
  150.     RegisterHam(Ham_Weapon_Reload, "weapon_aug", "ethereal_Reload")
  151.     RegisterHam(Ham_Weapon_Reload, "weapon_aug", "ethereal_Reload_Post", 1)
  152.     RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
  153.    
  154.     register_forward(FM_SetModel, "fw_SetModel")
  155.     register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
  156.     register_forward(FM_PlaybackEvent, "fwPlaybackEvent")
  157.    
  158.     RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack", 1)
  159.     RegisterHam(Ham_TraceAttack, "func_breakable", "fw_TraceAttack", 1)
  160.     RegisterHam(Ham_TraceAttack, "func_wall", "fw_TraceAttack", 1)
  161.     RegisterHam(Ham_TraceAttack, "func_door", "fw_TraceAttack", 1)
  162.     RegisterHam(Ham_TraceAttack, "func_door_rotating", "fw_TraceAttack", 1)
  163.     RegisterHam(Ham_TraceAttack, "func_plat", "fw_TraceAttack", 1)
  164.     RegisterHam(Ham_TraceAttack, "func_rotating", "fw_TraceAttack", 1)
  165.     RegisterHam(Ham_TraceAttack, "player", "fw_TraceAttack", 1)
  166.    
  167.     register_forward(FM_CmdStart, "fw_CmdStart")
  168.     register_forward(FM_AddToFullPack, "CPlayer__AddToFullPack_post", 1);  
  169.     register_forward(FM_CheckVisibility, "CEntity__CheckVisibility");
  170.     register_forward(FM_PrecacheEvent, "fwPrecacheEvent_Post", 1)
  171.    
  172.     //Laser Mode Config
  173.     cvar_dmg_ethereal_laser = register_cvar("eth_laser_dmg", "1.24")            //Damage - 1.64 - 164% from original weapon
  174.     cvar_spd_ethereal_laser = register_cvar("eth_laser_attack_spd", "1.24")     //Attack Speed - 1.24 - 124% from original weapon
  175.     cvar_recoil_ethereal_laser = register_cvar("eth_laser_recoil", "0.03")      //Recoil - 0.03 - 3% from original weapon
  176.    
  177.     //Electro Mode Config
  178.     cvar_dmg_ethereal_electro = register_cvar("eth_electro_dmg", "0.87")        //Damage - 0,87 - 87% from original weapon
  179.     cvar_spd_ethereal_electro = register_cvar("eth_electro_attack_spd", "0.25") //Attack Speed - 0.25 - 25% from original weapon
  180.     cvar_recoil_ethereal_electro = register_cvar("eth_laser_recoil", "0.17")        //Recoil - 0.17 - 17% from original weapon
  181.  
  182.     cvar_clip_ethereal= register_cvar("ethereal_clip", "50")                //Max Clip
  183.     cvar_ethereal_ammo = register_cvar("ethereal_ammo", "250")          //Max Ammo
  184.    
  185.     g_iItemID = ze_register_item("Ethereal \r(V.I.P)", 60, 0)  
  186.    
  187.     g_MaxPlayers = get_maxplayers()
  188.     gmsgWeaponList = get_user_msgid("WeaponList")
  189.    
  190.     register_clcmd("weapon_ethereal_sh", "HookSelect");
  191. }
  192.  
  193. public HookSelect(this)
  194. {
  195.     engclient_cmd(this, "weapon_aug");
  196. }
  197.  
  198. public plugin_precache()
  199. {
  200.     precache_model(ethereal_V_MODEL)
  201.     precache_model(ethereal_P_MODEL)
  202.     precache_model(ethereal_W_MODEL)
  203.    
  204.     precache_sound(Laser_Sounds)   
  205.     precache_sound(Electro_Sounds)
  206.     precache_sound("weapons/ethereal_reload.wav")
  207.     precache_sound("weapons/ethereal_draw.wav")
  208.    
  209.     m_iBlood[0] = precache_model("sprites/blood.spr")
  210.     m_iBlood[1] = precache_model("sprites/bloodspray.spr")
  211.    
  212.     precache_generic("sprites/weapon_ethereal_sh.txt")
  213.     precache_generic("sprites/sh/640hud74.spr")
  214.     precache_generic("sprites/sh/640hud7x.spr")
  215.     precache_model("sprites/muzzleflash7.spr")
  216.    
  217.     g_SmokePuff_SprId = engfunc(EngFunc_PrecacheModel, "sprites/wall_puff1.spr")
  218.     wSprite = precache_model("sprites/laserbeam.spr")   //Laser Sprite
  219.    
  220.     g_iEntity = create_entity("info_target")
  221.     entity_set_model(g_iEntity, "sprites/muzzleflash7.spr")
  222.     entity_set_float(g_iEntity, EV_FL_scale, 0.2)
  223.    
  224.     entity_set_int(g_iEntity, EV_INT_rendermode, kRenderTransTexture)
  225.     entity_set_float(g_iEntity, EV_FL_renderamt, 0.0)
  226.    
  227.     register_clcmd("wpn_ethereal3", "weapon_hook") 
  228. }
  229.  
  230. public weapon_hook(id)
  231. {
  232.         engclient_cmd(id, "weapon_aug")
  233.         return PLUGIN_HANDLED
  234. }
  235. public fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType, Float:fVec1[3], Float:fVec2[3])
  236. {
  237.     if(!is_user_alive(iAttacker))
  238.         return
  239.  
  240.     new g_currentweapon = get_user_weapon(iAttacker)
  241.  
  242.     if(g_currentweapon != CSW_AUG)
  243.         return
  244.    
  245.     if(!g_has_ethereal[iAttacker])
  246.         return
  247.  
  248.     static Float:flEnd[3]
  249.     get_tr2(ptr, TR_vecEndPos, flEnd)
  250.    
  251.     if(!is_user_alive(iEnt))
  252.     {
  253.         if(eth_mode[iAttacker]==1)
  254.         {
  255.             Make_BulletHole(iAttacker, flEnd,flDamage)
  256.             Make_BulletSmoke(iAttacker, ptr)
  257.             emit_sound(iAttacker, CHAN_WEAPON, Laser_Sounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  258.             LaserBeam(iAttacker, flEnd,1, 2,l_ethereal_l_r,l_ethereal_l_g,l_ethereal_l_b,1,1)
  259.         }
  260.         else
  261.         {
  262.             #if defined electro_fire_hole
  263.                 Make_BulletHole(iAttacker, flEnd,flDamage)
  264.             #endif
  265.            
  266.             #if defined electro_fire_smoke
  267.                 Make_BulletSmoke(iAttacker, ptr)
  268.             #endif
  269.             LaserBeam(iAttacker,flEnd, 1, 2,e_ethereal_l_r,e_ethereal_l_g,e_ethereal_l_b,e_ethereal_ls_min,e_ethereal_ls_max)
  270.             emit_sound(iAttacker, CHAN_WEAPON, Electro_Sounds[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
  271.         }
  272.     }
  273. }
  274. public  LaserBeam(id, Float: Origin[3],Time, Size,red,green,blue,randmin,randmax)
  275. {
  276.     if(get_user_weapon(id) == CSW_AUG && g_has_ethereal[id])
  277.     {
  278.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  279.     write_byte (TE_BEAMENTPOINT)
  280.     write_short(id | 0x1000)
  281.     engfunc(EngFunc_WriteCoord, Origin[0])
  282.     engfunc(EngFunc_WriteCoord, Origin[1])
  283.     engfunc(EngFunc_WriteCoord, Origin[2])
  284.     write_short(wSprite)
  285.     write_byte(1)
  286.     write_byte(5)
  287.     write_byte(Time)
  288.     write_byte(Size)
  289.     write_byte(random_num(randmin,randmax))
  290.     write_byte(red)
  291.     write_byte(green)
  292.     write_byte(blue)
  293.     write_byte(200)
  294.     write_byte(200)
  295.     message_end()
  296.     }
  297. }
  298. public Make_BulletSmoke(id, TrResult)
  299. {
  300.    
  301.     static Float:vecSrc[3], Float:vecEnd[3], TE_FLAG
  302.     get_weapon_attachment(id, vecSrc)
  303.     global_get(glb_v_forward, vecEnd)
  304.    
  305.     xs_vec_mul_scalar(vecEnd, 8192.0, vecEnd)
  306.     xs_vec_add(vecSrc, vecEnd, vecEnd)
  307.  
  308.     get_tr2(TrResult, TR_vecEndPos, vecSrc)
  309.     get_tr2(TrResult, TR_vecPlaneNormal, vecEnd)
  310.    
  311.     xs_vec_mul_scalar(vecEnd, 2.5, vecEnd)
  312.     xs_vec_add(vecSrc, vecEnd, vecEnd)
  313.    
  314.     TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
  315.     TE_FLAG |= TE_EXPLFLAG_NOSOUND
  316.     TE_FLAG |= TE_EXPLFLAG_NOPARTICLES
  317.     engfunc(EngFunc_MessageBegin, MSG_PAS, SVC_TEMPENTITY, vecEnd, 0)
  318.     write_byte(TE_EXPLOSION)
  319.     engfunc(EngFunc_WriteCoord, vecEnd[0])
  320.     engfunc(EngFunc_WriteCoord, vecEnd[1])
  321.     engfunc(EngFunc_WriteCoord, vecEnd[2] - 10.0)
  322.     write_short(g_SmokePuff_SprId)
  323.     write_byte(2)
  324.     write_byte(50)
  325.     write_byte(TE_FLAG)
  326.     message_end()
  327. }
  328.  
  329. stock Make_BulletHole(id, Float:Origin[3], Float:Damage)
  330. {
  331.     // Find target
  332.     static Decal; Decal = random_num(41, 45)
  333.     static LoopTime;
  334.    
  335.     if(Damage > 100.0) LoopTime = 2
  336.     else LoopTime = 1
  337.    
  338.     for(new i = 0; i < LoopTime; i++)
  339.     {
  340.         // Put decal on "world" (a wall)
  341.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  342.         write_byte(TE_WORLDDECAL)
  343.         engfunc(EngFunc_WriteCoord, Origin[0])
  344.         engfunc(EngFunc_WriteCoord, Origin[1])
  345.         engfunc(EngFunc_WriteCoord, Origin[2])
  346.         write_byte(Decal)
  347.         message_end()
  348.        
  349.         // Show sparcles
  350.         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
  351.         write_byte(TE_GUNSHOTDECAL)
  352.         engfunc(EngFunc_WriteCoord, Origin[0])
  353.         engfunc(EngFunc_WriteCoord, Origin[1])
  354.         engfunc(EngFunc_WriteCoord, Origin[2])
  355.         write_short(id)
  356.         write_byte(Decal)
  357.         message_end()
  358.     }
  359. }
  360. stock get_weapon_attachment(id, Float:output[3], Float:fDis = 40.0)
  361. {
  362.     new Float:vfEnd[3], viEnd[3]
  363.     get_user_origin(id, viEnd, 3)  
  364.     IVecFVec(viEnd, vfEnd)
  365.    
  366.     new Float:fOrigin[3], Float:fAngle[3]
  367.    
  368.     pev(id, pev_origin, fOrigin)
  369.     pev(id, pev_view_ofs, fAngle)
  370.    
  371.     xs_vec_add(fOrigin, fAngle, fOrigin)
  372.    
  373.     new Float:fAttack[3]
  374.    
  375.     xs_vec_sub(vfEnd, fOrigin, fAttack)
  376.     xs_vec_sub(vfEnd, fOrigin, fAttack)
  377.    
  378.     new Float:fRate
  379.    
  380.     fRate = fDis / vector_length(fAttack)
  381.     xs_vec_mul_scalar(fAttack, fRate, fAttack)
  382.    
  383.     xs_vec_add(fOrigin, fAttack, output)
  384. }
  385. public plugin_natives ()
  386. {
  387.     register_native("give_ethereal_wpn", "native_give_weapon_add", 1)
  388. }
  389. public native_give_weapon_add(id)
  390. {
  391.     give_ethereal(id)
  392. }
  393.  
  394. public fwPrecacheEvent_Post(type, const name[])
  395. {
  396.     if (equal("events/aug.sc", name))
  397.     {
  398.         g_orig_event_ethereal = get_orig_retval()
  399.         return FMRES_HANDLED
  400.     }
  401.     return FMRES_IGNORED
  402. }
  403.  
  404. public client_connect(id)
  405. {
  406.     g_has_ethereal[id] = false
  407. }
  408.  
  409. public fw_SetModel(entity, model[])
  410. {
  411.     if(!is_valid_ent(entity))
  412.         return FMRES_IGNORED
  413.    
  414.     static szClassName[33]
  415.     entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName))
  416.        
  417.     if(!equal(szClassName, "weaponbox"))
  418.         return FMRES_IGNORED
  419.    
  420.     static iOwner
  421.    
  422.     iOwner = entity_get_edict(entity, EV_ENT_owner)
  423.    
  424.     if(equal(model, "models/w_aug.mdl"))
  425.     {
  426.         static iStoredAugID
  427.        
  428.         iStoredAugID = find_ent_by_owner(ENG_NULLENT, "weapon_aug", entity)
  429.    
  430.         if(!is_valid_ent(iStoredAugID))
  431.             return FMRES_IGNORED
  432.    
  433.         if(g_has_ethereal[iOwner])
  434.         {
  435.             entity_set_int(iStoredAugID, EV_INT_WEAPONKEY, ethereal_WEAPONKEY)
  436.            
  437.             g_has_ethereal[iOwner] = false
  438.            
  439.             entity_set_model(entity, ethereal_W_MODEL)
  440.            
  441.             return FMRES_SUPERCEDE
  442.         }
  443.     }
  444.     return FMRES_IGNORED
  445. }
  446.  
  447. public ze_select_item_pre(id, itemid)
  448. {
  449.     // This not our item?
  450.     if (itemid != g_iItemID)
  451.         return ZE_ITEM_AVAILABLE
  452.    
  453.     // Available for Humans only, So don't show it for zombies
  454.     if (ze_is_user_zombie(id))
  455.         return ZE_ITEM_DONT_SHOW
  456.    
  457.     // Player Not VIP?
  458.     if (!(ze_get_vip_flags(id) & VIP_A))
  459.         return ZE_ITEM_DONT_SHOW
  460.    
  461.     // Finally return that it's available
  462.     return ZE_ITEM_AVAILABLE
  463. }
  464.  
  465. public ze_select_item_post(id, itemid)
  466. {
  467.     // This is not our item, Block it here and don't execute the blew code
  468.     if (itemid != g_iItemID)
  469.         return
  470.    
  471.     give_ethereal(id)
  472. }
  473.  
  474. public give_ethereal(id)
  475. {
  476.     drop_weapons(id, 1)
  477.     new iWep2 = give_item(id,"weapon_aug")
  478.     if( iWep2 > 0 )
  479.     {
  480.         cs_set_weapon_ammo(iWep2, get_pcvar_num(cvar_clip_ethereal))
  481.         cs_set_user_bpammo (id, CSW_AUG, get_pcvar_num(cvar_ethereal_ammo))
  482.         UTIL_PlayWeaponAnimation(id, ethereal_DRAW)
  483.         set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF)
  484.        
  485.         message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
  486.         write_string("weapon_ethereal_sh")
  487.         write_byte(4)
  488.         write_byte(90)
  489.         write_byte(-1)
  490.         write_byte(-1)
  491.         write_byte(0)
  492.         write_byte(17)
  493.         write_byte(CSW_AUG)
  494.         message_end()
  495.     }
  496.     g_has_ethereal[id] = true
  497.    
  498.     eth_mode[id]=1
  499.     set_task(0.1,"clockdown",id)
  500. }
  501. public zp_extra_item_selected(id, itemid)
  502. {
  503.     if(itemid != g_itemid_ethereal)
  504.         return
  505.     give_ethereal(id)
  506.     ethereal_changemode[id]=0
  507.     ethereal_reloaded[id]=0
  508. }
  509.  
  510. public fw_ethereal_AddToPlayer(ethereal, id)
  511. {
  512.     if(!is_valid_ent(ethereal) || !is_user_connected(id))
  513.         return HAM_IGNORED
  514.    
  515.     if(entity_get_int(ethereal, EV_INT_WEAPONKEY) == ethereal_WEAPONKEY)
  516.     {
  517.         g_has_ethereal[id] = true
  518.        
  519.         entity_set_int(ethereal, EV_INT_WEAPONKEY, 0)
  520.  
  521.         message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
  522.         write_string("weapon_ethereal_sh")
  523.         write_byte(4)
  524.         write_byte(90)
  525.         write_byte(-1)
  526.         write_byte(-1)
  527.         write_byte(0)
  528.         write_byte(17)
  529.         write_byte(CSW_AUG)
  530.         message_end()
  531.        
  532.         return HAM_HANDLED
  533.     }
  534.     else
  535.     {
  536.         message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
  537.         write_string("weapon_aug")
  538.         write_byte(4)
  539.         write_byte(90)
  540.         write_byte(-1)
  541.         write_byte(-1)
  542.         write_byte(0)
  543.         write_byte(17)
  544.         write_byte(CSW_AUG)
  545.         message_end()
  546.     }
  547.     return HAM_IGNORED
  548. }
  549.  
  550. public fw_UseStationary_Post(entity, caller, activator, use_type)
  551. {
  552.     if (use_type == USE_STOPPED && is_user_connected(caller))
  553.         replace_weapon_models(caller, get_user_weapon(caller))
  554. }
  555.  
  556. public fw_Item_Deploy_Post(weapon_ent)
  557. {
  558.     static owner
  559.     owner = fm_cs_get_weapon_ent_owner(weapon_ent)
  560.    
  561.     static weaponid
  562.     weaponid = cs_get_weapon_id(weapon_ent)
  563.    
  564.     replace_weapon_models(owner, weaponid)
  565. }
  566.  
  567. public CurrentWeapon(id)
  568. {
  569.     replace_weapon_models(id, read_data(2))
  570.    
  571.     if(read_data(2) != CSW_AUG || !g_has_ethereal[id])
  572.     {
  573.         #if defined Icon
  574.         ethereal_debugicon(id)
  575.         #endif
  576.         return
  577.     }
  578.     static Float:iSpeed
  579.    
  580.     if(g_has_ethereal[id])
  581.         if(eth_mode[id]==1)
  582.             iSpeed = get_pcvar_float(cvar_spd_ethereal_laser)
  583.         else
  584.             iSpeed = get_pcvar_float(cvar_spd_ethereal_electro)
  585.            
  586.     static weapon[32],Ent
  587.     get_weaponname(read_data(2),weapon,31)
  588.     Ent = find_ent_by_owner(-1,weapon,id)
  589.    
  590.     if(Ent)
  591.     {
  592.         static Float:Delay
  593.         Delay = get_pdata_float( Ent, 46, 4) * iSpeed
  594.        
  595.         if (Delay > 0.0)
  596.             set_pdata_float(Ent, 46, Delay, 4)
  597.     }
  598.     #if defined Icon
  599.     ethereal_debugicon(id)
  600.     #endif
  601. }
  602.  
  603. replace_weapon_models(id, weaponid)
  604. {
  605.     switch (weaponid)
  606.     {
  607.         case CSW_AUG:
  608.         {
  609.            
  610.             if(g_has_ethereal[id])
  611.             {
  612.                 set_pev(id, pev_viewmodel2, ethereal_V_MODEL)
  613.                 set_pev(id, pev_weaponmodel2, ethereal_P_MODEL)
  614.                 if(oldweap[id] != CSW_AUG)
  615.                 {
  616.                     UTIL_PlayWeaponAnimation(id, ethereal_DRAW)
  617.                     set_pdata_float(id, m_flNextAttack, 1.0, PLAYER_LINUX_XTRA_OFF)
  618.                     #if defined Icon
  619.                         ethereal_debugicon(id)
  620.                     #endif
  621.                     message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
  622.                     write_string("weapon_ethereal_sh")
  623.                     write_byte(4)
  624.                     write_byte(90)
  625.                     write_byte(-1)
  626.                     write_byte(-1)
  627.                     write_byte(0)
  628.                     write_byte(17)
  629.                     write_byte(CSW_AUG)
  630.                     message_end()
  631.                 }
  632.             }
  633.         }
  634.     }
  635.     oldweap[id] = weaponid
  636. }
  637.  
  638. public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle)
  639. {
  640.     if(!is_user_alive(Player) || (get_user_weapon(Player) != CSW_AUG || !g_has_ethereal[Player]))
  641.         return FMRES_IGNORED
  642.    
  643.     set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.001)
  644.     return FMRES_HANDLED
  645. }
  646.  
  647. public fw_ethereal_PrimaryAttack(Weapon)
  648. {
  649.     new Player = get_pdata_cbase(Weapon, 41, 4)
  650.    
  651.     if (!g_has_ethereal[Player])
  652.         return
  653.    
  654.     g_IsInPrimaryAttack = 1
  655.     pev(Player,pev_punchangle,cl_pushangle[Player])
  656.    
  657.     g_clip_ammo[Player] = cs_get_weapon_ammo(Weapon)
  658. }
  659.  
  660. public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
  661. {
  662.     if ((eventid != g_orig_event_ethereal) || !g_IsInPrimaryAttack)
  663.         return FMRES_IGNORED
  664.     if (!(1 <= invoker <= g_MaxPlayers))
  665.         return FMRES_IGNORED
  666.     playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
  667.     return FMRES_SUPERCEDE
  668. }
  669.  
  670. public fw_ethereal_PrimaryAttack_Post(Weapon)
  671. {
  672.     new iPlayerID = get_pdata_cbase(Weapon, 41, 4);
  673.    
  674.    
  675.     g_IsInPrimaryAttack = 0
  676.     new Player = get_pdata_cbase(Weapon, 41, 4)
  677.    
  678.     new szClip, szAmmo
  679.     get_user_weapon(Player, szClip, szAmmo)
  680.    
  681.     if(!is_user_alive(Player))
  682.         return
  683.  
  684.     if(g_has_ethereal[Player])
  685.     {
  686.         if (!g_clip_ammo[Player])
  687.             return
  688.  
  689.         new Float:push[3]
  690.         pev(Player,pev_punchangle,push)
  691.         xs_vec_sub(push,cl_pushangle[Player],push)
  692.         if(eth_mode[Player]==1)
  693.             xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_ethereal_laser),push)
  694.         else
  695.             xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_ethereal_electro),push)
  696.        
  697.         xs_vec_add(push,cl_pushangle[Player],push)
  698.         set_pev(Player,pev_punchangle,push)
  699.        
  700.         UTIL_PlayWeaponAnimation(Player, random_num(ethereal_SHOOT1, ethereal_SHOOT2))
  701.            
  702.         set_bit(g_bitsMuzzleFlash, iPlayerID);
  703.     }
  704. }
  705.  
  706. public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
  707. {
  708.     if (victim != attacker && is_user_connected(attacker))
  709.     {
  710.         if(get_user_weapon(attacker) == CSW_AUG)
  711.         {
  712.             if(g_has_ethereal[attacker])
  713.                 if(eth_mode[attacker]==1)
  714.                     SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmg_ethereal_laser))
  715.                 else
  716.                     SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmg_ethereal_electro))
  717.         }
  718.     }
  719. }
  720. #if defined  deathMSG
  721. public message_DeathMsg(msg_id, msg_dest, id)
  722. {
  723.     static szTruncatedWeapon[33], iAttacker, iVictim
  724.    
  725.     get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
  726.    
  727.     iAttacker = get_msg_arg_int(1)
  728.     iVictim = get_msg_arg_int(2)
  729.    
  730.     if(!is_user_connected(iAttacker) || iAttacker == iVictim)
  731.         return PLUGIN_CONTINUE
  732.    
  733.     if(equal(szTruncatedWeapon, "aug") && get_user_weapon(iAttacker) == CSW_AUG)
  734.         if(g_has_ethereal[iAttacker])
  735.             if(eth_mode[iAttacker]==0)
  736.                 set_msg_arg_string(4, "Ethereal Electric")
  737.             else
  738.             if(eth_mode[iAttacker]==1)
  739.                 set_msg_arg_string(4, "Ethereal Laser")
  740.            
  741.     return PLUGIN_CONTINUE
  742. }
  743. #endif
  744. stock fm_cs_get_current_weapon_ent(id)
  745. {
  746.     return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX)
  747. }
  748.  
  749. stock fm_cs_get_weapon_ent_owner(ent)
  750. {
  751.     return get_pdata_cbase(ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS)
  752. }
  753.  
  754. stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
  755. {
  756.     set_pev(Player, pev_weaponanim, Sequence)
  757.    
  758.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
  759.     write_byte(Sequence)
  760.     write_byte(pev(Player, pev_body))
  761.     message_end()
  762. }
  763.  
  764. public ethereal_ItemPostFrame(weapon_entity)
  765. {
  766.     new id = pev(weapon_entity, pev_owner)
  767.  
  768.     if (!is_user_connected(id)||!g_has_ethereal[id])
  769.         return HAM_IGNORED
  770.    
  771.     static iClipExtra
  772.     iClipExtra = get_pcvar_num(cvar_clip_ethereal)
  773.    
  774.     new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, PLAYER_LINUX_XTRA_OFF)
  775.     new iBpAmmo = cs_get_user_bpammo(id, CSW_AUG)
  776.     new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
  777.     new fInReload = get_pdata_int(weapon_entity, m_fInReload, WEAP_LINUX_XTRA_OFF)
  778.    
  779.     if( fInReload && flNextAttack <= 0.0 )
  780.     {
  781.         new j = min(iClipExtra - iClip, iBpAmmo)
  782.        
  783.         set_pdata_int(weapon_entity, m_iClip, iClip + j, WEAP_LINUX_XTRA_OFF)
  784.         cs_set_user_bpammo(id, CSW_AUG, iBpAmmo-j)
  785.            
  786.         set_pdata_int(weapon_entity, m_fInReload, 0, WEAP_LINUX_XTRA_OFF)
  787.         fInReload = 0
  788.     }
  789.     return HAM_IGNORED
  790. }
  791.  
  792. public ethereal_Reload(weapon_entity)
  793. {
  794.     new id = pev(weapon_entity, pev_owner)
  795.  
  796.     if (!is_user_connected(id)||!g_has_ethereal[id])
  797.         return HAM_IGNORED
  798.    
  799.     static iClipExtra
  800.     if(g_has_ethereal[id])
  801.         iClipExtra = get_pcvar_num(cvar_clip_ethereal)
  802.    
  803.     g_ethereal_TmpClip[id] = -1
  804.    
  805.     new iBpAmmo = cs_get_user_bpammo(id, CSW_AUG)
  806.     new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
  807.    
  808.     if (iBpAmmo <= 0||iClip >= iClipExtra)
  809.         return HAM_SUPERCEDE
  810.        
  811.     g_ethereal_TmpClip[id] = iClip
  812.     ethereal_reloaded[id]=1
  813.     set_task(ethereal_RELOAD_TIME,"reload_end",id)
  814.     return HAM_IGNORED
  815. }
  816. public reload_end(id)
  817.     ethereal_reloaded[id]=0
  818. public ethereal_Reload_Post(weapon_entity)
  819. {
  820.     new id = pev(weapon_entity, pev_owner)
  821.     if (!g_has_ethereal[id]||g_ethereal_TmpClip[id] == -1||!is_user_connected(id))
  822.         return HAM_IGNORED
  823.  
  824.     set_pdata_int(weapon_entity, m_iClip, g_ethereal_TmpClip[id], WEAP_LINUX_XTRA_OFF)
  825.     set_pdata_float(weapon_entity, m_flTimeWeaponIdle, ethereal_RELOAD_TIME, WEAP_LINUX_XTRA_OFF)
  826.     set_pdata_float(id, m_flNextAttack, ethereal_RELOAD_TIME, PLAYER_LINUX_XTRA_OFF)
  827.     set_pdata_int(weapon_entity, m_fInReload, 1, WEAP_LINUX_XTRA_OFF)
  828.    
  829.     UTIL_PlayWeaponAnimation(id, ethereal_RELOAD)
  830.  
  831.     return HAM_IGNORED
  832. }
  833.  
  834. stock drop_weapons(id, dropwhat)
  835. {
  836.     static weapons[32], num, i, weaponid
  837.     num = 0
  838.     get_user_weapons(id, weapons, num)
  839.    
  840.     for (i = 0; i < num; i++)
  841.     {
  842.         weaponid = weapons[i]
  843.        
  844.         if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
  845.         {
  846.             static wname[32]
  847.             get_weaponname(weaponid, wname, sizeof wname - 1)
  848.             engclient_cmd(id, "drop", wname)
  849.         }
  850.     }
  851. }
  852. public fw_CmdStart(id, uc_handle, seed)
  853. {
  854.     if(!is_user_alive(id)||ethereal_changemode[id]==1||!g_has_ethereal[id]||ethereal_reloaded[id]==1)
  855.         return
  856.  
  857.     if((get_uc(uc_handle, UC_Buttons) & IN_USE) && !(pev(id, pev_oldbuttons) & IN_USE))
  858.     {
  859.         new szClip, szAmmo
  860.         new szWeapID = get_user_weapon(id, szClip, szAmmo)
  861.         if(szWeapID == CSW_AUG && g_has_ethereal[id])
  862.         {
  863.             if(eth_mode[id]==1)
  864.             {
  865.                 eth_mode[id]=0
  866.                 ethereal_changemode[id]=1
  867.                 client_print(id,print_center,"Electric mode selected")
  868.                 set_pdata_float(id, m_flNextAttack, ethereal_RELOAD_TIME, PLAYER_LINUX_XTRA_OFF)
  869.                 UTIL_PlayWeaponAnimation(id, ethereal_RELOAD)
  870.                 set_task(3.0,"clockdown",id)
  871.                 #if defined Icon
  872.                     Status_Icon(id,l_ethereal_i_r,l_ethereal_i_g,l_ethereal_i_b,2)
  873.                 #endif
  874.             }
  875.             else
  876.             {
  877.                 eth_mode[id]=1
  878.                 ethereal_changemode[id]=1
  879.                 client_print(id,print_center,"Laser mode selected")
  880.                 set_pdata_float(id, m_flNextAttack, ethereal_RELOAD_TIME, PLAYER_LINUX_XTRA_OFF)
  881.                 UTIL_PlayWeaponAnimation(id, ethereal_RELOAD)
  882.                 set_task(3.0,"clockdown",id)
  883.                 #if defined Icon
  884.                     Status_Icon(id,e_ethereal_i_r,e_ethereal_i_g,e_ethereal_i_b,2)
  885.                 #endif
  886.             }
  887.             cs_set_user_zoom(id,0,0)
  888.         }
  889.     }
  890. }
  891. public clockdown(id)
  892. {
  893.     ethereal_changemode[id]=0
  894.     #if defined Icon
  895.         ethereal_debugicon(id)
  896.     #endif
  897. }
  898. public CPlayer__AddToFullPack_post(esState, iE, iEnt, iHost, iHostFlags, iPlayer, pSet)
  899. {
  900.     if (iEnt != g_iEntity)
  901.         return;
  902.     if (get_bit(g_bitsMuzzleFlash, iHost))
  903.     {
  904.         set_es(esState, ES_Frame, float(random_num(0, 2)));
  905.            
  906.         set_es(esState, ES_RenderMode, kRenderTransAdd);
  907.         set_es(esState, ES_RenderAmt, 255.0);
  908.        
  909.         reset_bit(g_bitsMuzzleFlash, iHost);
  910.     }
  911.        
  912.     set_es(esState, ES_Skin, iHost);
  913.     set_es(esState, ES_Body, 1);
  914.     set_es(esState, ES_AimEnt, iHost);
  915.     set_es(esState, ES_MoveType, MOVETYPE_FOLLOW);
  916. }
  917. public CEntity__CheckVisibility(iEntity, pSet)
  918. {
  919.     if (iEntity != g_iEntity)
  920.         return FMRES_IGNORED;
  921.    
  922.     forward_return(FMV_CELL, 1);
  923.    
  924.     return FMRES_SUPERCEDE;
  925. }
  926. #if defined Icon
  927. Status_Icon(id,r,g,b,p)
  928. {          
  929.     {
  930.         message_begin(MSG_ONE_UNRELIABLE, g_Msg_StatusIcon, {0,0,0}, id)
  931.         write_byte(p)
  932.         write_string("dmg_shock")
  933.         write_byte(r)           // red
  934.         write_byte(g)           // green
  935.         write_byte(b)           // blue
  936.         message_end()
  937.     }
  938. }
  939. public ethereal_debugicon(id)
  940. {
  941.     if(get_user_weapon(id)==CSW_AUG&&g_has_ethereal[id]&&is_user_alive(id))
  942.         if(eth_mode[id]==1)
  943.             Status_Icon(id,l_ethereal_i_r,l_ethereal_i_g,l_ethereal_i_b,1)
  944.         else
  945.             Status_Icon(id,e_ethereal_i_r,e_ethereal_i_g,e_ethereal_i_b,1)
  946.     else
  947.         Status_Icon(id,0,0,0,0)
  948. }
  949. #endif
Last edited by Raheem on 21 Sep 2018, 11:14, edited 1 time in total.
Reason: Added missing includes.
You don't know? Learn and you will know.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest