Available Shield force for human

Unpaid Requests, Public Plugins
Locked
czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

Shield force for human

#1

Post by czirimbolo » 7 years ago

Hey, what do you think about Shield force for human? Is it good thing for our zombie escape mod? I think it's interesting but this shield should exist max. 3-4 seconds and should be expensive. Zombies have madness, human can have shield :D Is it possbile to covert?

http://zombie-mod.ru/counter-strike/zom ... force.html
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#2

Post by johnnysins2000 » 7 years ago

yes it possible to convert but u posted it in the wrong section
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#3

Post by johnnysins2000 » 7 years ago

But i don't think it is a very good idea although it is a interesting plugin .... Humans in sheild how will zombie infect?
Nobody Is That Busy If They Make Time :roll:

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#4

Post by czirimbolo » 7 years ago

Zombie can infect when shield force is over (shield force exists only 3 seconds, its not too long)
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#5

Post by johnnysins2000 » 7 years ago

czirimbolo wrote: 7 years ago Zombie can infect when shield force is over (shield force exists only 3 seconds, its not too long)
U are saying this has time ? ok if u want it i will convert if for you tomorrow
Nobody Is That Busy If They Make Time :roll:

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#6

Post by czirimbolo » 7 years ago

I hope it has, in other case its unuseful, lets check it :)
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#7

Post by johnnysins2000 » 7 years ago

u want this to be convert to ZE Human extra items or zombie ?
Nobody Is That Busy If They Make Time :roll:

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#8

Post by czirimbolo » 7 years ago

for human, zombies already have some kind of shield called "Madness" ;)
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#9

Post by johnnysins2000 » 7 years ago

czirimbolo wrote: 7 years ago for human, zombies already have some kind of shield called "Madness" ;)
OK Tonight
Nobody Is That Busy If They Make Time :roll:

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#10

Post by johnnysins2000 » 7 years ago

Ok I have converted it here try it bro and test it and after testing it report it here if it works properly

Ok bro code updated Try Again
    1. #include <zombie_escape>
    2. #include <fun>
    3. #include <fakemeta_util>
    4.  
    5. #define PLUGIN "[ZE] Extra Item: Force Field Grenade"
    6. #define VERSION "v2.3"
    7. #define AUTHOR "lucas_7_94 + ZE DEV TEAM" // Thanks To Users in credits too!.
    8.  
    9. #define CAMPO_ROUND_NAME "Force Shield (Complete Round)"
    10. #define CAMPO_TIME_NAME "Force Shield (Short-Time)"
    11. #define ValidTouch(%1) ( is_user_alive(%1) && ( ze_is_user_zombie(%1)  ) )
    12.  
    13. /*=============================[Plugin Customization]=============================*/
    14. //#define CAMPO_TASK
    15. #define CAMPO_ROUND
    16.  
    17. //#define RANDOM_COLOR
    18. #define ONE_COLOR
    19.  
    20. new const NADE_TYPE_CAMPO = 6545
    21.  
    22. #if defined ONE_COLOR
    23. new Float:CampoColors[ 3 ] = { 255.0 , 0.0 ,   0.0  }
    24. #endif
    25.  
    26. new TrailColor[ 3 ] = { 000, 255, 255 }
    27. new Float:Maxs[ 3 ] = { 100.0 , 100.0 , 100.0 }
    28. new Float:Mins[ 3 ] = { -100.0, -100.0, -100.0 }
    29.  
    30. new const model_grenade[] = "models/zombie_plague/v_auragren.mdl"
    31. new const model[] = "models/zombie_plague/aura8.mdl"
    32. new const w_model[] = "models/zombie_plague/w_aura.mdl"
    33. new const sprite_grenade_trail[] = "sprites/laserbeam.spr"
    34. new const entclas[] = "campo_grenade_forze"
    35.  
    36. new cvar_flaregrenades, g_trailSpr, g_SayText, g_iItemID
    37.  
    38. new gBomb
    39. const Float:Push = 15.0
    40.  
    41. /*=============================[End Customization]=============================*/
    42.  
    43. public plugin_init()
    44. {
    45.     register_plugin(PLUGIN, VERSION, AUTHOR)
    46.    
    47.     RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
    48.    
    49.     RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    50.    
    51.     cvar_flaregrenades = get_cvar_pointer("zp_flare_grenades")
    52.    
    53.     register_forward(FM_SetModel, "fw_SetModel")
    54.    
    55.     RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade", "shield_deploy", 1)
    56.    
    57.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    58.    
    59.     register_forward(FM_Touch, "fw_touch")
    60.    
    61.     g_SayText = get_user_msgid("SayText")
    62.    
    63.     register_cvar("zp_shield_creator", "lucas_7_94", FCVAR_SERVER|FCVAR_PROTECTED)
    64.    
    65.     #if defined CAMPO_ROUND
    66.     g_iItemID = ze_register_item("Force Shield (One Round)", 30)
    67.     #else
    68.     g_iItemID = ze_register_item("Force Shield (Limited Time)", 10)
    69.     #endif     
    70. }
    71.  
    72. public event_round_start() {
    73.    
    74.     #if defined CAMPO_ROUND
    75.     remove_entity_name(entclas)
    76.     #endif
    77.    
    78.     gBomb = 0
    79. }
    80.  
    81. public plugin_precache() {
    82.    
    83.     g_trailSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_trail)
    84.     engfunc(EngFunc_PrecacheModel, model_grenade)
    85.     engfunc(EngFunc_PrecacheModel, model)
    86.     engfunc(EngFunc_PrecacheModel, w_model)
    87. }
    88.  
    89. public client_disconnect(id)
    90.     gBomb &= ~( 1 << ( id % 32 ) )
    91.  
    92. public ze_select_item_post(player, itemid) {
    93.    
    94.     if(itemid == g_iItemID)
    95.        return  
    96.     {
    97.         if( gBomb & ( 1 << ( player % 32 ) ) )
    98.             Color(player, "!g[Shield]!y You already have a force field")
    99.         else
    100.         {
    101.             gBomb |= ( 1 << ( player % 32 ) )
    102.            
    103.             if( !user_has_weapon( player, CSW_SMOKEGRENADE ) )
    104.                 give_item(player,"weapon_smokegrenade")
    105.            
    106.            
    107.             #if defined CAMPO_ROUND
    108.             Color(player, "!g[Shield]!y You Bought a force field!. This, lasts 1 round complete.")
    109.             #else
    110.             Color(player, "!g[Shield]!y You Bought a force field!. This, lasts very little!")
    111.             #endif
    112.         }
    113.        
    114.        
    115.     }
    116.    
    117. }
    118.  
    119. public ze_select_item_pre(id, itemid)
    120. {
    121.     // This not our item?
    122.     if (itemid != g_iItemID)
    123.         return ZE_ITEM_AVAILABLE
    124.    
    125.     // Available for Humans only, So don't show it for zombies
    126.     if (ze_is_user_zombie(id))
    127.         return ZE_ITEM_DONT_SHOW
    128.    
    129.     // Finally return that it's available
    130.     return ZE_ITEM_AVAILABLE
    131. }
    132.  
    133. public fw_PlayerKilled(victim, attacker, shouldgib)
    134. {
    135.     if( ( 1 <= attacker <= 32 ) && ( gBomb & ( 1 << ( victim % 32 ) ) ) )
    136.         gBomb &= ~( 1 << ( victim % 32 ) )
    137. }
    138.  
    139. public fw_ThinkGrenade(entity) {  
    140.    
    141.     if(!pev_valid(entity)) return HAM_IGNORED
    142.    
    143.     static Float:dmgtime  
    144.     pev(entity, pev_dmgtime, dmgtime)
    145.    
    146.     if (dmgtime > get_gametime())
    147.         return HAM_IGNORED  
    148.    
    149.     if(pev(entity, pev_flTimeStepSound) == NADE_TYPE_CAMPO)
    150.         crear_ent(entity)
    151.    
    152.     return HAM_SUPERCEDE
    153. }
    154.  
    155.  
    156. public fw_SetModel(entity, const model[]) {
    157.    
    158.     static Float:dmgtime
    159.     pev(entity, pev_dmgtime, dmgtime)
    160.    
    161.     if (dmgtime == 0.0)
    162.         return FMRES_IGNORED;
    163.    
    164.     if (equal(model[7], "w_sm", 4))
    165.     {      
    166.         new owner = pev(entity, pev_owner)     
    167.        
    168.         if( is_user_alive(owner) && !ze_is_user_zombie(owner) && ( gBomb & ( 1 << ( owner % 32 ) ) ) )
    169.         {
    170.             set_pcvar_num(cvar_flaregrenades,0)        
    171.            
    172.             fm_set_rendering(entity, kRenderFxGlowShell, 000, 255, 255, kRenderNormal, 16)
    173.            
    174.             message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    175.             write_byte(TE_BEAMFOLLOW) // TE id
    176.             write_short(entity) // entity
    177.             write_short(g_trailSpr) // sprite
    178.             write_byte(10) // life
    179.             write_byte(10) // width
    180.             write_byte(TrailColor[ 0 ]) // r
    181.             write_byte(TrailColor[ 1 ]) // g
    182.             write_byte(TrailColor[ 2 ]) // b
    183.             write_byte(500) // brightness
    184.             message_end()
    185.            
    186.             set_pev(entity, pev_flTimeStepSound, NADE_TYPE_CAMPO)
    187.            
    188.             set_task(6.0, "DeleteEntityGrenade" ,entity)
    189.             gBomb &= ~( 1 << ( owner % 32 ) )
    190.             entity_set_model(entity, w_model)
    191.             return FMRES_SUPERCEDE
    192.         }
    193.     }
    194.     return FMRES_IGNORED
    195.    
    196. }
    197.  
    198. public DeleteEntityGrenade(entity)
    199.     if( is_valid_ent( entity ) )
    200.         remove_entity(entity)
    201.  
    202. public crear_ent(id) {
    203.        
    204.     set_pcvar_num(cvar_flaregrenades,1)
    205.    
    206.     // Create entitity
    207.     new iEntity = create_entity("info_target")
    208.    
    209.     if(!is_valid_ent(iEntity))
    210.         return PLUGIN_HANDLED
    211.    
    212.     new Float: Origin[3]
    213.     entity_get_vector(id, EV_VEC_origin, Origin)
    214.    
    215.     entity_set_string(iEntity, EV_SZ_classname, entclas)
    216.    
    217.     entity_set_vector(iEntity,EV_VEC_origin, Origin)
    218.     entity_set_model(iEntity,model)
    219.     entity_set_int(iEntity, EV_INT_solid, SOLID_TRIGGER)
    220.     entity_set_size(iEntity, Mins, Maxs )
    221.     entity_set_int(iEntity, EV_INT_renderfx, kRenderFxGlowShell)
    222.     entity_set_int(iEntity, EV_INT_rendermode, kRenderTransAlpha)
    223.     entity_set_float(iEntity, EV_FL_renderamt, 50.0)
    224.    
    225.     #if defined RANDOM_COLOR
    226.     if(is_valid_ent(iEntity))
    227.     {
    228.         new Float:vColor[3]
    229.        
    230.         for(new i; i < 3; i++)
    231.             vColor[i] = random_float(0.0, 255.0)
    232.        
    233.         entity_set_vector(iEntity, EV_VEC_rendercolor, vColor)
    234.     }
    235.     #endif
    236.    
    237.     #if defined ONE_COLOR
    238.     entity_set_vector(iEntity, EV_VEC_rendercolor, CampoColors)
    239.     #endif
    240.    
    241.     #if defined CAMPO_TASK
    242.     set_task(15.0, "DeleteEntity", iEntity)
    243.     #endif
    244.    
    245.    
    246.     return PLUGIN_CONTINUE;
    247. }
    248.  
    249. public ze_user_infected(infected, infector)
    250.     if ( gBomb & ( 1 << ( infected % 32 ) ) )
    251.         gBomb &= ~( 1 << ( infected % 32 ) )
    252.  
    253. public fw_touch(ent, touched)
    254. {
    255.     if ( !pev_valid(ent) ) return FMRES_IGNORED;
    256.     static entclass[32];
    257.     pev(ent, pev_model, entclass, 31);
    258.    
    259.     if ( strcmp( entclass, model ) == 0 )
    260.     {  
    261.         if( ValidTouch(touched) )
    262.         {
    263.             static Float:pos_ptr[3], Float:pos_ptd[3]
    264.            
    265.             pev(ent, pev_origin, pos_ptr)
    266.             pev(touched, pev_origin, pos_ptd)
    267.            
    268.             for(new i = 0; i < 3; i++)
    269.             {
    270.                 pos_ptd[i] -= pos_ptr[i]
    271.                 pos_ptd[i] *= Push
    272.             }
    273.             set_pev(touched, pev_velocity, pos_ptd)
    274.             set_pev(touched, pev_impulse, pos_ptd)
    275.         }
    276.     }
    277.     return FMRES_HANDLED
    278. }
    279.  
    280.  
    281. public DeleteEntity( entity )  // Thanks xPaw For The Code =D
    282.     if( is_valid_ent( entity ) )
    283.     remove_entity( entity );
    284.  
    285. stock Color(const id, const input[], any:...)
    286. {
    287.     static msg[191]
    288.     vformat(msg, 190, input, 3)
    289.    
    290.     replace_all(msg, 190, "!g", "^4")
    291.     replace_all(msg, 190, "!y", "^1")
    292.     replace_all(msg, 190, "!t", "^3")
    293.    
    294.     message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
    295.     write_byte(id)
    296.     write_string(msg)
    297.     message_end()
    298. }
    299.  
    300. public shield_deploy( shield_ent )
    301. {
    302.     if( pev_valid( shield_ent ) != 2 )
    303.         return HAM_IGNORED;
    304.    
    305.     static const mPlayer = 41
    306.    
    307.     new id = get_pdata_cbase( shield_ent, mPlayer, 4 );
    308.    
    309.     if( ( gBomb & ( 1 << ( id % 32 ) ) ) && !ze_is_user_zombie( id ) )
    310.         set_pev( id, pev_viewmodel2, model_grenade );
    311.    
    312.     return HAM_IGNORED;
    313. }
Last edited by johnnysins2000 7 years ago, edited 1 time in total.
Nobody Is That Busy If They Make Time :roll:

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#11

Post by czirimbolo » 7 years ago

ok I compiled and uploaded. There is a shield in weapon menu but it doesnt work, no errors
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#12

Post by johnnysins2000 » 7 years ago

OK I will again check the code
Nobody Is That Busy If They Make Time :roll:


johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#14

Post by johnnysins2000 » 7 years ago

OK bro i have updated the code try again to compile and test it again
Nobody Is That Busy If They Make Time :roll:

czirimbolo
Veteran Member
Veteran Member
Poland
Posts: 598
Joined: 7 years ago
Contact:

#15

Post by czirimbolo » 7 years ago

Still doesn't work ;) I see this in weapon menu but nothing happens when I buy it
Image

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#16

Post by johnnysins2000 » 7 years ago

czirimbolo wrote: 7 years ago Still doesn't work ;) I see this in weapon menu but nothing happens when I buy it
That's strange :/

Maybe code bugged
Nobody Is That Busy If They Make Time :roll:

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#17

Post by Raheem » 6 years ago

He who fails to plan is planning to fail

Locked

Who is online

Users browsing this forum: No registered users and 5 guests