Raised This Month: $51 Target: $400
 12% 

Subplugin Submission [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]


Post New Thread Reply   
 
Thread Tools Display Modes
tfk94
Veteran Member
Join Date: Jan 2011
Location: [url=http://www.gametrac
Old 12-21-2013 , 03:06   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #191

Can someone make a limit to the force shields because when u throw a lot of them the server crashes.
Maybe 5 max at a time and when the first throwed shields disappears you can throw a new one.
Can someone do it ?
i have set them to 30 seconds

Last edited by tfk94; 12-21-2013 at 03:08.
tfk94 is offline
mohsen9010
Senior Member
Join Date: Jun 2011
Location: Iran
Old 07-10-2014 , 16:28   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #192

Quote:
Originally Posted by MeRcyLeZZ View Post
Working version here:
(should be placed AFTER default grenade plugins in plugins-zp-xxxxx.ini)
Tested in ZP 5.0.8 & not working
Beacuse of this plugin :
zp50_grenade_flare.amxx

some one can fix that ?

edit : i found that ... so fixed
__________________
Iman in Allah

Last edited by mohsen9010; 07-12-2014 at 00:55. Reason: fixed
mohsen9010 is offline
Send a message via Yahoo to mohsen9010 Send a message via Skype™ to mohsen9010
SilverShadow
Junior Member
Join Date: Aug 2014
Old 08-19-2014 , 17:27   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #193

eg

Last edited by SilverShadow; 09-17-2017 at 14:18. Reason: e
SilverShadow is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-13-2014 , 14:32   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #194

i would like to have the fix too... anyone?
Depresie is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-14-2014 , 03:11   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #195

What the problem?
zmd94 is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 11-14-2014 , 03:18   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #196

it was not working on zp 5.0.... but i found the fix from mercylez .. but if you have flare in your hand and you buy the forcefield he, you lose the flare tho..

btw here is the fix

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <zombieplague>
#include <hamsandwich>
#include <fakemeta_util>
#include <fun>

#define PLUGIN "[ZP] Extra Item: Force Field Grenade"
#define VERSION "v2.1"
#define AUTHOR "lucas_7_94" // Thanks To Users in credits too!.

#define CAMPO_ROUND_NAME "Force Shield (Complete Round)"
#define CAMPO_TIME_NAME "Force Shield (Short-Time)"
#define ValidTouch(%1) ( is_user_alive(%1) && ( zp_get_user_zombie(%1) || zp_get_user_nemesis(%1) ) )

/*=============================[Plugin Customization]=============================*/
#define CAMPO_TASK
//#define CAMPO_ROUND

//#define RANDOM_COLOR
#define ONE_COLOR

new const NADE_TYPE_CAMPO = 3679

#if defined ONE_COLOR
new Float:CampoColors[3] = { 
    255.0 , // r
    0.0 ,   // g
    0.0     // b
}
#endif

new const model_grenade[] = "models/zombie_plague/v_auragren.mdl"
new const model[] = "models/zombie_plague/aura8.mdl"
new const w_model[] = "models/zombie_plague/w_aura.mdl"
new const sprite_grenade_trail[] = "sprites/laserbeam.spr"
new const entclas[] = "campo_grenade_forze"

new g_trailSpr, cvar_push, g_SayText, g_itemID

new bool:g_bomb[33]

const item_cost = 15
/*=============================[End Customization]=============================*/

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    RegisterHam(Ham_Think, "grenade", "fw_ThinkGrenade")
    
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
    
    register_forward(FM_SetModel, "fw_SetModel")
    

    RegisterHam(Ham_Item_Deploy, "weapon_smokegrenade", "shield_deploy", 1)
    
    register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
    
    register_forward(FM_Touch, "fw_touch")
    
    g_SayText = get_user_msgid("SayText")
    
    register_cvar("zp_shield_creator", "lucas_7_94", FCVAR_SERVER|FCVAR_PROTECTED)
    
    #if defined CAMPO_ROUND
    g_itemID = zp_register_extra_item ( CAMPO_ROUND_NAME , item_cost * 2 , ZP_TEAM_HUMAN )
    #else 
    g_itemID = zp_register_extra_item ( CAMPO_TIME_NAME , item_cost , ZP_TEAM_HUMAN )
    #endif
    
    // Push cvar, (Only float's numbers)
    cvar_push = register_cvar("zp_forze_push", "7.5")
}

public event_round_start() {
    
    #if defined CAMPO_ROUND
    remove_entity_name(entclas)
    #endif
    
    arrayset( g_bomb, false, 33 );
}

public plugin_precache() {
    
    g_trailSpr = engfunc(EngFunc_PrecacheModel, sprite_grenade_trail)
    engfunc(EngFunc_PrecacheModel, model_grenade)
    engfunc(EngFunc_PrecacheModel, model)
    engfunc(EngFunc_PrecacheModel, w_model)
}

public client_disconnect(id) 
    g_bomb[id] = false;

public zp_extra_item_selected(player, itemid) {
    
    if(itemid == g_itemID)
    {
        if(g_bomb[player]) 
            Color(player, "!g[Shield]!y You already have a force field")
        else 
        {
            g_bomb[player] = true;
            
            give_item(player,"weapon_smokegrenade")
            
            
            #if defined CAMPO_ROUND
            Color(player, "!g[Shield]!y You Bought a force field!. This, lasts 1 round complete.")
            #else
            Color(player, "!g[Shield]!y You Bought a force field!. This, lasts very little!")
            #endif
        }
        
        
    }
    
}
public fw_PlayerKilled(victim, attacker, shouldgib) g_bomb[victim] = false;

public fw_ThinkGrenade(entity) {   
    
    if(!pev_valid(entity)) return HAM_IGNORED
    
    static Float:dmgtime   
    pev(entity, pev_dmgtime, dmgtime)
    
    if (dmgtime > get_gametime())
        return HAM_IGNORED   
    
    if(pev(entity, pev_flTimeStepSound) == NADE_TYPE_CAMPO)
        crear_ent(entity)
    
    return HAM_SUPERCEDE
}

public fw_SetModel(entity, const model[]) {    
    
    static Float:dmgtime
    pev(entity, pev_dmgtime, dmgtime)
    
    if (dmgtime == 0.0)
        return FMRES_IGNORED;
    
    if (equal(model[7], "w_sm", 4))
    {        
        new owner = pev(entity, pev_owner)        
        
        if( is_user_alive(owner) && !zp_get_user_zombie(owner) && g_bomb[owner]) 
        {
            fm_set_rendering(entity, kRenderFxGlowShell, 000, 255, 255, kRenderNormal, 16)
            
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(TE_BEAMFOLLOW) // TE id
            write_short(entity) // entity
            write_short(g_trailSpr) // sprite
            write_byte(10) // life
            write_byte(10) // width
            write_byte(000) // r
            write_byte(255) // g
            write_byte(255) // b
            write_byte(500) // brightness
            message_end()
            
            set_pev(entity, pev_flTimeStepSound, NADE_TYPE_CAMPO)
            
            set_task(6.0, "DeleteEntityGrenade" ,entity)
            entity_set_model(entity, w_model)
            
            g_bomb[owner] = false;
            
            return FMRES_SUPERCEDE
        }
    }
    return FMRES_IGNORED
    
}

public DeleteEntityGrenade(entity) remove_entity(entity)

public crear_ent(id) {
    
    // Create entitity
    new iEntity = create_entity("info_target")
    
    if(!is_valid_ent(iEntity))
        return PLUGIN_HANDLED
    
    new Float: Origin[3] 
    entity_get_vector(id, EV_VEC_origin, Origin) 
    
    entity_set_string(iEntity, EV_SZ_classname, entclas)
    
    entity_set_vector(iEntity,EV_VEC_origin, Origin)
    entity_set_model(iEntity,model)
    entity_set_int(iEntity, EV_INT_solid, SOLID_TRIGGER)
    entity_set_size(iEntity, Float: {-100.0, -100.0, -100.0}, Float: {100.0, 100.0, 100.0})
    entity_set_int(iEntity, EV_INT_renderfx, kRenderFxGlowShell)
    entity_set_int(iEntity, EV_INT_rendermode, kRenderTransAlpha)
    entity_set_float(iEntity, EV_FL_renderamt, 50.0)
    
    #if defined RANDOM_COLOR
    if(is_valid_ent(iEntity))
    {
        new Float:vColor[3]
        
        for(new i; i < 3; i++)
            vColor[i] = random_float(0.0, 255.0)
        
        entity_set_vector(iEntity, EV_VEC_rendercolor, vColor)
    }
    #endif
    
    #if defined ONE_COLOR
    entity_set_vector(iEntity, EV_VEC_rendercolor, CampoColors)
    #endif
    
    #if defined CAMPO_TASK
    set_task(15.0, "DeleteEntity", iEntity)
    #endif
    
    
    return PLUGIN_CONTINUE;
}

public zp_user_infected_post(infected, infector) 
    if (g_bomb[infected]) 
        g_bomb[infected] = false;

public fw_touch(ent, touched)
{
    if ( !pev_valid(ent) ) return FMRES_IGNORED;
    static entclass[32];
    pev(ent, pev_classname, entclass, 31);
    
    if ( equali(entclass, entclas) )
    {    
        if( ValidTouch(touched) )
        {
            new Float:pos_ptr[3], Float:pos_ptd[3], Float:push_power = get_pcvar_float(cvar_push)
            
            pev(ent, pev_origin, pos_ptr)
            pev(touched, pev_origin, pos_ptd)
            
            for(new i = 0; i < 3; i++)
            {
                pos_ptd[i] -= pos_ptr[i]
                pos_ptd[i] *= push_power
            }
            set_pev(touched, pev_velocity, pos_ptd)
            set_pev(touched, pev_impulse, pos_ptd)
        }
    }
    return PLUGIN_HANDLED
}

public remove_ent() 
{
    remove_entity_name(entclas)
}  

public DeleteEntity( entity )  // Thanks xPaw For The Code =D
    if( is_valid_ent( entity ) ) 
    remove_entity( entity );

stock Color(const id, const input[], any:...)
{
    static msg[191]
    vformat(msg, 190, input, 3)
    
    replace_all(msg, 190, "!g", "^4")
    replace_all(msg, 190, "!y", "^1")
    replace_all(msg, 190, "!t", "^3")
    
    message_begin(MSG_ONE_UNRELIABLE, g_SayText, _, id)
    write_byte(id)
    write_string(msg)
    message_end()
}

public shield_deploy( shield_ent )
{
    if( pev_valid( shield_ent ) != 2 )
        return HAM_IGNORED;
    
    new id = get_pdata_cbase( shield_ent, 41, 4 );
    
    if( g_bomb[ id ] && !zp_get_user_zombie( id ) )
        set_pev( id, pev_viewmodel2, model_grenade );
    
    return HAM_IGNORED;
}

Last edited by Depresie; 11-14-2014 at 03:19.
Depresie is offline
Gam3ronE
SourceMod Donor
Join Date: Aug 2010
Old 11-16-2014 , 07:23   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #197

Thank you for sharing the fix, Depresie.
Gam3ronE is offline
guven5
Senior Member
Join Date: Jul 2010
Location: counter strike 1.6 downl
Old 07-11-2015 , 14:09   Re: [ZP] Extra Item : Force Field Grenade [v2.3] [Update 08-14-12]
Reply With Quote #198

how to be use without glow effect only with solid color, those render sh*ts using more cpu and crash reason.
guven5 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode