Modificare Plugin[rezolvat!]

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

24 Sep 2013, 04:24

Salut

A-si dori si eu sa imi modificati acest plugin .
Zombie Bomb | Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
#include < zombieplague >

#define Plugin    "[ZP] Extra Item: Jumping Zombie"
#define Version    "1.0"
#define Author    "NiHiLaNTh"

// === Customization starts below! ===
new const g_PlayerModel [ ] = "models/p_zombibomb.mdl"
new const g_ViewModel [ ] = "models/v_zombibomb_pc_zombi.mdl"
new const g_WorldModel [ ] = "models/w_zombibomb.mdl"

// You can add more than 1 sound!
new const g_SoundGrenadeBuy [ ] [ ] = { "zombie_plague/zombi_bomb_deploy.wav" }
new const g_SoundAmmoPurchase [ ] [ ] = { "items/9mmclip1.wav" }
new const g_SoundBombExplode [ ] [ ] = { "zombie_plague/zombi_bomb_exp.wav" }

new const g_szItemName [ ] = "Zombie Bomb" // Name
new const g_iItemPrice = 5 // Price

#define MAXCARRY    5 // How many grenades 1 player can hold at the same time
#define RADIUS        350.0 // Affect radius
// === Customization ends above! ===

#define MAXPLAYERS        32
#define pev_nade_type        pev_flTimeStepSound
#define NADE_TYPE_JUMPING    26517
#define AMMOID_SM        13

new g_iExplo

new g_iNadeID

new g_iJumpingNadeCount [ MAXPLAYERS+1 ]
new g_iCurrentWeapon [ MAXPLAYERS+1 ]

new cvar_speed

new g_MaxPlayers
new g_msgAmmoPickup

public plugin_precache ( )
{
    precache_model ( g_PlayerModel )
    precache_model ( g_ViewModel )
    precache_model ( g_WorldModel )
    
    new i
    for ( i = 0; i < sizeof g_SoundGrenadeBuy; i++ )
        precache_sound ( g_SoundGrenadeBuy [ i ] )
    for ( i = 0; i < sizeof g_SoundAmmoPurchase; i++ )
        precache_sound ( g_SoundAmmoPurchase [ i ] )
    for ( i = 0; i < sizeof g_SoundBombExplode; i++ )
        precache_sound ( g_SoundBombExplode [ i ] )
    
    g_iExplo = precache_model ( "sprites/zombiebomb_exp.spr" )
}

public plugin_init ( )
{
    register_plugin ( Plugin, Version, Author )
    
    g_iNadeID = zp_register_extra_item ( g_szItemName, g_iItemPrice, ZP_TEAM_ZOMBIE )
    
    register_event ( "CurWeapon", "EV_CurWeapon", "be", "1=1" )
    register_event ( "HLTV", "EV_NewRound", "a", "1=0", "2=0" )
    register_event ( "DeathMsg", "EV_DeathMsg", "a" )
    
    register_forward ( FM_SetModel, "fw_SetModel" )
    RegisterHam ( Ham_Think, "grenade", "fw_ThinkGrenade" )
    
    cvar_speed = register_cvar ( "zp_zombiebomb_knockback", "10000" )
    
    g_msgAmmoPickup = get_user_msgid ( "AmmoPickup" )
    
    g_MaxPlayers = get_maxplayers ( )
}

public client_connect ( Player )
{
    g_iJumpingNadeCount [ Player ] = 0
}

public zp_extra_item_selected ( Player, Item )
{
    if ( Item == g_iNadeID )
    {
        if ( g_iJumpingNadeCount [ Player ] >= MAXCARRY )
        {
            client_print ( Player, print_chat, "[ZP] Cannot hold mode grenades!" )
            return ZP_PLUGIN_HANDLED
        }
        
        new iBpAmmo = cs_get_user_bpammo ( Player, CSW_SMOKEGRENADE )
        
        if ( g_iJumpingNadeCount [ Player ] >= 1 )
        {
            cs_set_user_bpammo ( Player, CSW_SMOKEGRENADE, iBpAmmo+1 )
            
            emit_sound ( Player, CHAN_ITEM, g_SoundAmmoPurchase[random_num(0, sizeof g_SoundAmmoPurchase-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
            
            AmmoPickup ( Player, AMMOID_SM, 1 )
            
            g_iJumpingNadeCount [ Player ]++
        }
        else
        {
            give_item ( Player, "weapon_smokegrenade" )
            
            emit_sound ( Player, CHAN_ITEM, g_SoundGrenadeBuy[random_num(0, sizeof g_SoundGrenadeBuy-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
            
            AmmoPickup ( Player, AMMOID_SM, 1 )
            
            g_iJumpingNadeCount [ Player ] = 1
        }
    }
    return PLUGIN_CONTINUE
}

public zp_user_infected_post ( Player, Infector, Nemesis )
{
    g_iJumpingNadeCount [ Player ] = 0
}

public zp_user_humanized_post ( Player, Survivor )
{
    if ( Survivor )
    {
        g_iJumpingNadeCount [ Survivor ] = 0
    }
}

public EV_CurWeapon ( Player )
{
    if ( !is_user_alive ( Player ) || !zp_get_user_zombie ( Player ) )
        return PLUGIN_CONTINUE
    
    g_iCurrentWeapon [ Player ] = read_data ( 2 )
    
    if ( g_iJumpingNadeCount [ Player ] > 0 && g_iCurrentWeapon [ Player ] == CSW_SMOKEGRENADE )
    {
        set_pev ( Player, pev_viewmodel2, g_ViewModel )
        set_pev ( Player, pev_weaponmodel2, g_WorldModel )
    }
    
    return PLUGIN_CONTINUE
}

public EV_NewRound ( )
{
    arrayset ( g_iJumpingNadeCount, 0, 33 )
}

public EV_DeathMsg ( )
{
    new iVictim = read_data ( 2 )
    
    if ( !is_user_connected ( iVictim ) )
        return
    
    g_iJumpingNadeCount [ iVictim ] = 0
}

public fw_SetModel ( Entity, const Model [ ] )
{
    if ( Entity < 0 )
        return FMRES_IGNORED
    
    if ( pev ( Entity, pev_dmgtime ) == 0.0 )
        return FMRES_IGNORED
    
    new iOwner = entity_get_edict ( Entity, EV_ENT_owner )    
    
    if ( g_iJumpingNadeCount [ iOwner ] >= 1 && equal ( Model [ 7 ], "w_sm", 4 ) )
    {
        // Reset any other nade
        set_pev ( Entity, pev_nade_type, 0 )
        
        set_pev ( Entity, pev_nade_type, NADE_TYPE_JUMPING )
        
        g_iJumpingNadeCount [ iOwner ]--
        
        entity_set_model ( Entity, g_WorldModel )
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}

public fw_ThinkGrenade ( Entity )
{
    if ( !pev_valid ( Entity ) )
        return HAM_IGNORED
    
    static Float:dmg_time
    pev ( Entity, pev_dmgtime, dmg_time )
    
    if ( dmg_time > get_gametime ( ) )
        return HAM_IGNORED
    
    if ( pev ( Entity, pev_nade_type ) == NADE_TYPE_JUMPING )
    {
        jumping_explode ( Entity )
        return HAM_SUPERCEDE
    }
    return HAM_IGNORED
}

public jumping_explode ( Entity )
{
    if ( Entity < 0 )
        return
    
    static Float:flOrigin [ 3 ]
    pev ( Entity, pev_origin, flOrigin )
    
    engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 )
    write_byte ( TE_SPRITE ) 
    engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
    engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
    engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
    write_short ( g_iExplo )
    write_byte ( 35 )
    write_byte ( 186 )
    message_end ( )
    
    new iOwner = entity_get_edict ( Entity, EV_ENT_owner )
    
    emit_sound ( Entity, CHAN_WEAPON, g_SoundBombExplode[random_num(0, sizeof g_SoundBombExplode-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
    
    for ( new i = 1; i < g_MaxPlayers; i++ )
    {
        if ( !is_user_alive  ( i ) )
            continue
        
        // bugfix!!!!    
        if ( zp_get_user_zombie ( i ) )
            continue
        
        if ( iOwner != i )
            continue
        
        // Debug!
        //client_print ( iOwner, print_chat, "Owner of Smoke Grenade!" )    
        
        new Float:flVictimOrigin [ 3 ]
        pev ( i, pev_origin, flVictimOrigin )
        
        new Float:flDistance = get_distance_f ( flOrigin, flVictimOrigin )    
        
        if ( flDistance <= RADIUS )
        {
            static Float:flSpeed
            flSpeed = get_pcvar_float ( cvar_speed )
            
            static Float:flNewSpeed
            flNewSpeed = flSpeed * ( 1.0 - ( flDistance / RADIUS ) )
            
            static Float:flVelocity [ 3 ]
            get_speed_vector ( flOrigin, flVictimOrigin, flNewSpeed, flVelocity )
            
            set_pev ( i, pev_velocity,flVelocity )
        }
    }
    
    engfunc ( EngFunc_RemoveEntity, Entity )
}        

public AmmoPickup ( Player, AmmoID, AmmoAmount )
{
    message_begin ( MSG_ONE, g_msgAmmoPickup, _, Player )
    write_byte ( AmmoID )
    write_byte ( AmmoAmount )
    message_end ( )
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
    new_velocity[0] = origin2[0] - origin1[0]
    new_velocity[1] = origin2[1] - origin1[1]
    new_velocity[2] = origin2[2] - origin1[2]
    new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    new_velocity[0] *= num
    new_velocity[1] *= num
    new_velocity[2] *= num
    
    return 1;
}
Sa il modificati in asa fel incat sa primesti bomba direct in mana, free cand esti transformat in zombie si sa nu mai ia DMG .

Multumesc
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
RoyalServer 2
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

25 Sep 2013, 03:58

Nimeni ? :-?
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
copil_zapacit
Membru, skill +1
Membru, skill +1
Posts: 159
Joined: 25 Feb 2013, 01:52
Detinator Steam: Da
Location: dragasani
Has thanked: 1 time
Been thanked: 3 times
Contact:

25 Sep 2013, 05:01

eu stiu dar nu te pot ajuta pentru ca nu am fost aceptat ca scriptar acestui forum ;)
Last edited by munir on 25 Sep 2013, 16:26, edited 1 time in total.
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

25 Sep 2013, 16:12

copil_zapacit wrote:eu stiu dar nu te pot ajuta pentru ca nu am fost aceptat ca scriptar acestui forum ;)
Munceste sa poti devenii scriptar , nimeni nu a devenit scriptar mai ales aici pe ochi frumosi . Uitate la Askhanar cu 1525 de posturi , uitate la falcao cu 2509 de posturi , etc.... Vezi, ei au muncit sa devina scriptari . Tu ai 31 de posturi ... vrei sa fi scriptar? De unde stiu administratorii ca meriti daca tu nu ajuti pe nimeni? :)) :-?
Fara munca nu rezolvi nimic , mai ales aici !!
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

26 Sep 2013, 21:05

Chiar nimeni ? :-?
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
CryWolf
Administrator
Administrator
Posts: 6505
Joined: 07 Aug 2008, 16:33
Detinator Steam: Da
Reputatie: Administrator
Fost Scripter
Manager CS2.eXtream.Ro
Fost Detinator ZM.eXtream.Ro
Fost manager CS.eXtream.Ro
Fost manager CSGO.eXtream.Ro
Fost manager global
Location: Botosani
Discord: crywolf1989
Has thanked: 202 times
Been thanked: 850 times
Contact:

27 Sep 2013, 09:35

Deci sa scot din meniu si o pun sa iti apara in mana cand esti transformat ? infectat de playeri sau si pentru primul zombie ? si la nemesis etc ?
NU IMI MAI DA-TI PM CU CERERE AJUTOR/SAMD, FOLOSITI FORUMUL, CITESC MAJORITATEA TOPICURILOR.
www.dark-arena.com , SERVERE CS / CS2 / L4D AU REVENIT ONLINE.
www.diasporaiptv.ro - SERVICII PREMIUM IPTV

Image

Image
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

27 Sep 2013, 17:59

CryWolf wrote:Deci sa scot din meniu si o pun sa iti apara in mana cand esti transformat ? infectat de playeri sau si pentru primul zombie ? si la nemesis etc ?
Exact :)
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

29 Sep 2013, 18:21

Hai ca nu las topicul jos :))
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

01 Oct 2013, 13:50

Hai sus :))
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

03 Oct 2013, 00:48

hopa sus
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
User avatar
cyby
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 1777
Joined: 16 Jul 2011, 21:46
Detinator Steam: Da
Detinator server CS: Da
Reputatie: Scripter eXtreamCS
Fost Moderator ajutator
Has thanked: 146 times
Been thanked: 396 times

03 Oct 2013, 00:56

| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < engine >
#include < fakemeta >
#include < fun >
#include < hamsandwich >
#include < zombieplague >

#define Plugin    "[ZP] Extra Item: Jumping Zombie"
#define Version    "1.0"
#define Author    "NiHiLaNTh"

// === Customization starts below! ===
new const g_PlayerModel [ ] = "models/p_zombibomb.mdl"
new const g_ViewModel [ ] = "models/v_zombibomb_pc_zombi.mdl"
new const g_WorldModel [ ] = "models/w_zombibomb.mdl"

// You can add more than 1 sound!
new const g_SoundGrenadeBuy [ ] [ ] = { "zombie_plague/zombi_bomb_deploy.wav" }
new const g_SoundAmmoPurchase [ ] [ ] = { "items/9mmclip1.wav" }
new const g_SoundBombExplode [ ] [ ] = { "zombie_plague/zombi_bomb_exp.wav" }

new const g_szItemName [ ] = "Zombie Bomb" // Name
new const g_iItemPrice = 5 // Price

#define MAXCARRY    5 // How many grenades 1 player can hold at the same time
#define RADIUS        350.0 // Affect radius
// === Customization ends above! ===

#define MAXPLAYERS        32
#define pev_nade_type        pev_flTimeStepSound
#define NADE_TYPE_JUMPING    26517
#define AMMOID_SM        13

new g_iExplo

new g_iNadeID

new g_iJumpingNadeCount [ MAXPLAYERS+1 ]
new g_iCurrentWeapon [ MAXPLAYERS+1 ]

new cvar_speed

new g_MaxPlayers
new g_msgAmmoPickup

public plugin_precache ( )
{
    precache_model ( g_PlayerModel )
    precache_model ( g_ViewModel )
    precache_model ( g_WorldModel )
    
    new i
    for ( i = 0; i < sizeof g_SoundGrenadeBuy; i++ )
        precache_sound ( g_SoundGrenadeBuy [ i ] )
    for ( i = 0; i < sizeof g_SoundAmmoPurchase; i++ )
        precache_sound ( g_SoundAmmoPurchase [ i ] )
    for ( i = 0; i < sizeof g_SoundBombExplode; i++ )
        precache_sound ( g_SoundBombExplode [ i ] )
    
    g_iExplo = precache_model ( "sprites/zombiebomb_exp.spr" )
}

public plugin_init ( )
{
    register_plugin ( Plugin, Version, Author )
    
    g_iNadeID = zp_register_extra_item ( g_szItemName, g_iItemPrice, ZP_TEAM_ZOMBIE )
    
    register_event ( "CurWeapon", "EV_CurWeapon", "be", "1=1" )
    register_event ( "HLTV", "EV_NewRound", "a", "1=0", "2=0" )
    register_event ( "DeathMsg", "EV_DeathMsg", "a" )
    
    register_forward ( FM_SetModel, "fw_SetModel" )
    RegisterHam ( Ham_Think, "grenade", "fw_ThinkGrenade" )
    
    cvar_speed = register_cvar ( "zp_zombiebomb_knockback", "10000" )
    
    g_msgAmmoPickup = get_user_msgid ( "AmmoPickup" )
    
    g_MaxPlayers = get_maxplayers ( )
}

public client_connect ( Player )
{
    g_iJumpingNadeCount [ Player ] = 0
}

public zp_extra_item_selected ( Player, Item )
{
    if ( Item == g_iNadeID )
    {
        if ( g_iJumpingNadeCount [ Player ] >= MAXCARRY )
        {
            client_print ( Player, print_chat, "[ZP] Cannot hold mode grenades!" )
            return ZP_PLUGIN_HANDLED
        }
        
        new iBpAmmo = cs_get_user_bpammo ( Player, CSW_SMOKEGRENADE )
        
        if ( g_iJumpingNadeCount [ Player ] >= 1 )
        {
            cs_set_user_bpammo ( Player, CSW_SMOKEGRENADE, iBpAmmo+1 )
            
            emit_sound ( Player, CHAN_ITEM, g_SoundAmmoPurchase[random_num(0, sizeof g_SoundAmmoPurchase-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
            
            AmmoPickup ( Player, AMMOID_SM, 1 )
            
            g_iJumpingNadeCount [ Player ]++
        }
        else
        {
            give_item ( Player, "weapon_smokegrenade" )
            
            emit_sound ( Player, CHAN_ITEM, g_SoundGrenadeBuy[random_num(0, sizeof g_SoundGrenadeBuy-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
            
            AmmoPickup ( Player, AMMOID_SM, 1 )
            
            g_iJumpingNadeCount [ Player ] = 1
        }
    }
    return PLUGIN_CONTINUE
}

public zp_user_infected_post ( Player, Infector, Nemesis )
{
	if(!Nemesis)
	{
		give_item ( Player, "weapon_smokegrenade" )
		
		emit_sound ( Player, CHAN_ITEM, g_SoundGrenadeBuy[random_num(0, sizeof g_SoundGrenadeBuy-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
		
		AmmoPickup ( Player, AMMOID_SM, 1 )
		
		g_iJumpingNadeCount [ Player ] = 1
	}
}

public zp_user_humanized_post ( Player, Survivor )
{
    if ( Survivor )
    {
        g_iJumpingNadeCount [ Survivor ] = 0
    }
}

public EV_CurWeapon ( Player )
{
    if ( !is_user_alive ( Player ) || !zp_get_user_zombie ( Player ) )
        return PLUGIN_CONTINUE
    
    g_iCurrentWeapon [ Player ] = read_data ( 2 )
    
    if ( g_iJumpingNadeCount [ Player ] > 0 && g_iCurrentWeapon [ Player ] == CSW_SMOKEGRENADE )
    {
        set_pev ( Player, pev_viewmodel2, g_ViewModel )
        set_pev ( Player, pev_weaponmodel2, g_WorldModel )
    }
    
    return PLUGIN_CONTINUE
}

public EV_NewRound ( )
{
    arrayset ( g_iJumpingNadeCount, 0, 33 )
}

public EV_DeathMsg ( )
{
    new iVictim = read_data ( 2 )
    
    if ( !is_user_connected ( iVictim ) )
        return
    
    g_iJumpingNadeCount [ iVictim ] = 0
}

public fw_SetModel ( Entity, const Model [ ] )
{
    if ( Entity < 0 )
        return FMRES_IGNORED
    
    if ( pev ( Entity, pev_dmgtime ) == 0.0 )
        return FMRES_IGNORED
    
    new iOwner = entity_get_edict ( Entity, EV_ENT_owner )    
    
    if ( g_iJumpingNadeCount [ iOwner ] >= 1 && equal ( Model [ 7 ], "w_sm", 4 ) )
    {
        // Reset any other nade
        set_pev ( Entity, pev_nade_type, 0 )
        
        set_pev ( Entity, pev_nade_type, NADE_TYPE_JUMPING )
        
        g_iJumpingNadeCount [ iOwner ]--
        
        entity_set_model ( Entity, g_WorldModel )
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}

public fw_ThinkGrenade ( Entity )
{
    if ( !pev_valid ( Entity ) )
        return HAM_IGNORED
    
    static Float:dmg_time
    pev ( Entity, pev_dmgtime, dmg_time )
    
    if ( dmg_time > get_gametime ( ) )
        return HAM_IGNORED
    
    if ( pev ( Entity, pev_nade_type ) == NADE_TYPE_JUMPING )
    {
        jumping_explode ( Entity )
        return HAM_SUPERCEDE
    }
    return HAM_IGNORED
}

public jumping_explode ( Entity )
{
    if ( Entity < 0 )
        return
    
    static Float:flOrigin [ 3 ]
    pev ( Entity, pev_origin, flOrigin )
    
    engfunc ( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 )
    write_byte ( TE_SPRITE ) 
    engfunc ( EngFunc_WriteCoord, flOrigin [ 0 ] )
    engfunc ( EngFunc_WriteCoord, flOrigin [ 1 ] )
    engfunc ( EngFunc_WriteCoord, flOrigin [ 2 ] + 45.0 )
    write_short ( g_iExplo )
    write_byte ( 35 )
    write_byte ( 186 )
    message_end ( )
    
    new iOwner = entity_get_edict ( Entity, EV_ENT_owner )
    
    emit_sound ( Entity, CHAN_WEAPON, g_SoundBombExplode[random_num(0, sizeof g_SoundBombExplode-1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM )
    
    for ( new i = 1; i < g_MaxPlayers; i++ )
    {
        if ( !is_user_alive  ( i ) )
            continue
        
        // bugfix!!!!    
        if ( zp_get_user_zombie ( i ) )
            continue
        
        if ( iOwner != i )
            continue
        
        // Debug!
        //client_print ( iOwner, print_chat, "Owner of Smoke Grenade!" )    
        
        new Float:flVictimOrigin [ 3 ]
        pev ( i, pev_origin, flVictimOrigin )
        
        new Float:flDistance = get_distance_f ( flOrigin, flVictimOrigin )    
        
        if ( flDistance <= RADIUS )
        {
            static Float:flSpeed
            flSpeed = get_pcvar_float ( cvar_speed )
            
            static Float:flNewSpeed
            flNewSpeed = flSpeed * ( 1.0 - ( flDistance / RADIUS ) )
            
            static Float:flVelocity [ 3 ]
            get_speed_vector ( flOrigin, flVictimOrigin, flNewSpeed, flVelocity )
            
            set_pev ( i, pev_velocity,flVelocity )
        }
    }
    
    engfunc ( EngFunc_RemoveEntity, Entity )
}        

public AmmoPickup ( Player, AmmoID, AmmoAmount )
{
    message_begin ( MSG_ONE, g_msgAmmoPickup, _, Player )
    write_byte ( AmmoID )
    write_byte ( AmmoAmount )
    message_end ( )
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speed, Float:new_velocity[3])
{
    new_velocity[0] = origin2[0] - origin1[0]
    new_velocity[1] = origin2[1] - origin1[1]
    new_velocity[2] = origin2[2] - origin1[2]
    new Float:num = floatsqroot(speed*speed / (new_velocity[0]*new_velocity[0] + new_velocity[1]*new_velocity[1] + new_velocity[2]*new_velocity[2]))
    new_velocity[0] *= num
    new_velocity[1] *= num
    new_velocity[2] *= num
    
    return 1;
}
93.114.82.17:27015 - Monster Invasion CO-OP Mod
User avatar
AZzeL
Membru, skill +2
Membru, skill +2
Posts: 981
Joined: 02 Oct 2012, 15:24
Detinator Steam: Da
CS Status: Invat ingerasii sa moara !
Detinator server CS: VALCEA.FIREON.RO
Location: Valcea
Has thanked: 64 times
Been thanked: 27 times
Contact:

03 Oct 2013, 16:53

Multumesc cyby dar nu arunca oamenii din locul unde stau .... doar explodeaza si atat. Trebuie sa ii si arunce .
[ EntrySoft Hosting SRL ( Reducere 20% prin codul AZZEL20 ) ]
[ MxHost™ ]
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests