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

[Help] Drop Jetpack, for Survivor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-10-2014 , 19:08   [Help] Drop Jetpack, for Survivor
Reply With Quote #1

Hello, i really would like make this: if a player Buy Survivor and he already has a Jetpack, automatically drop his Jetpack & if is possible to remove jetpack so the survivor cant pickup again.

im using ZPA , and this Jetpack code

PHP Code:
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
#include < xs >
#include < zombie_plague_advance >

native get_user_jetpackiPlayer );
native user_drop_jetpackiPlayer );
native set_user_fueliPlayerFloatfFuel );
native set_user_rocket_timeiPlayerFloatfTime );
native set_user_jetpackiPlayeriJetpack );

new 
g_iJetpackgmsgSayTextboolg_bConnected33 ], g_cName33 ][ 32 ];


public 
zp_user_infect_attemptiPlayer )
    if( 
get_user_jetpackiPlayer ) )
        
user_drop_jetpackiPlayer );

public 
zp_user_infected_preiPlayer )
    if( 
get_user_jetpackiPlayer ) )
        
user_drop_jetpackiPlayer );

public 
zp_user_infected_postiPlayer )
    if( 
get_user_jetpackiPlayer ) )
        
user_drop_jetpackiPlayer );

public 
client_putinserveriPlayer )
{
    
g_bConnectediPlayer ] = true;

    
get_user_nameiPlayerg_cNameiPlayer ], 31 );
}

public 
client_disconnectiPlayer )
    
g_bConnectediPlayer ] = false;

public 
client_infochangediPlayer )
{
    static 
cInfo32 ];
    
get_user_infoiPlayer"name"cInfo31 );

    if( !
equalig_cNameiPlayer ], cInfo ) )
        
copyg_cNameiPlayer ], 31cInfo );
}

public 
plugin_init( )
{
    
g_iJetpack zp_register_extra_item"Jetpack + Bazooka"30ZP_TEAM_HUMAN );
    
gmsgSayText get_user_msgid"SayText" );
    
register_logevent"RoundStart"2"1=Round_Start" );
    
}

public 
zp_extra_item_selectediPlayeriItem )
{
    if( 
iItem == g_iJetpack )
    {
        if( 
get_user_jetpackiPlayer ) )
        {
            
DoSayTextMessageiPlayer"^x04[ZP]^x01 You already have a^x03 Jetpack!" );

            
zp_set_user_ammo_packsiPlayerzp_get_user_ammo_packsiPlayer ) + 30 );
        }

        else
        {
            
set_user_jetpackiPlayer);
            
set_user_fueliPlayer250.0 );

            
DoSayTextMessageiPlayer"^x04[ZP]^x01 Press^x03 CTRL+SPACE^x01 to fly!" );
            
DoSayTextMessageiPlayer"^x04[ZP]^x01 Press^x03 RIGHT CLICK^x01 to shoot!" );
            
            
        }
    }
}

public 
Rocket_TouchiOwneriRocket )
{
    if( 
g_bConnectediOwner ] )
    {
        static 
iPlayers32 ], iNumi;
        
get_playersiPlayersiNum"a" );

        for( 
0iNumi++ )
        {
            if( 
zp_get_user_zombieiPlayers] ) )
            {
                static 
FloatfDistanceFloatfDamage;
                
fDistance entity_rangeiPlayers], iRocket );

                if( 
fDistance 320.0 )
                {
                    
fDamage 1050.0 fDistance;
                
                    static 
FloatfVelocity];
                    
peviPlayers], pev_velocityfVelocity );
                    
xs_vec_mul_scalarfVelocity2.75fVelocity );
                    
fVelocity] *= 1.75;
                    
set_peviPlayers], pev_velocityfVelocity );
                    
                    if( 
floatget_user_healthiPlayers] ) ) - fDamage 0.0 )
                        
ExecuteHamBHam_TakeDamageiPlayers], iRocketiOwnerfDamageDMG_BLAST );
                        
                    else 
ExecuteHamBHam_KillediPlayers], iOwner);


                    
DoSayTextMessageiOwner"^x04[ZP]^x01 Damage to^x04 %s^x01 ::^x04 %0.0f^x01 damage"g_cNameiPlayers] ], fDamage );
                }
            }
        }
    }
}

public 
Jetpack_TouchiPlayer )
    return 
zp_get_user_zombieiPlayer ) ? PLUGIN_HANDLED PLUGIN_CONTINUE;

public 
RoundStart( )
{
    static 
iPlayers32 ], iNumi;
    
get_playersiPlayersiNum"a" );

    for( 
0iNumi++ )
        if( 
get_user_jetpackiPlayers] ) )
        
set_user_rocket_timeiPlayers], 0.0 );
}

DoSayTextMessageiTargetcMessage[ ], any: ... )
{
    static 
cBuffer192 ];
    
vformatcBuffer191cMessage);

    
message_beginMSG_ONE_UNRELIABLEgmsgSayText_iTarget );
    
write_byteiTarget );
    
write_stringcBuffer );
    
message_end( );

__________________

Last edited by ghost95v; 10-26-2014 at 00:42.
ghost95v is offline
Send a message via Skype™ to ghost95v
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-10-2014 , 21:57   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #2

Just try to put this code:
PHP Code:
public zp_user_humanized_preiPlayer )
    if( 
get_user_jetpackiPlayer ) )
        
user_drop_jetpackiPlayer ); 
zmd94 is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-11-2014 , 07:51   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #3

Quote:
Originally Posted by zmd94 View Post
Just try to put this code:
PHP Code:
public zp_user_humanized_preiPlayer )
    if( 
get_user_jetpackiPlayer ) )
        
user_drop_jetpackiPlayer ); 
Works ...But... this is Dropin jetpack and when is Armagddon round , or Plague round ... i would like to make to drop , when its only Survivor
, how can we , add a check , if is armageddon round, and plague round , to do not drop jetpack ?
__________________

Last edited by ghost95v; 10-11-2014 at 10:01.
ghost95v is offline
Send a message via Skype™ to ghost95v
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-11-2014 , 10:45   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #4

I solved a check if is Armageddone round, Survivors not drop Jetpack .. but , how can we make, for plague round too ,,, and , how to block pick up by survivor, when survivor try to pickup one in , ground

i added check to dont not drop, when its lnj_round.
PHP Code:
public zp_user_humanized_preiPlayer )
    if( 
get_user_jetpackiPlayer ) )
    if( 
zp_is_lnj_round () )
        return;
    else
    
user_drop_jetpackiPlayer ); 
__________________

Last edited by ghost95v; 10-11-2014 at 10:46.
ghost95v is offline
Send a message via Skype™ to ghost95v
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-11-2014 , 10:52   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #5

Just try to change this:
PHP Code:
public Jetpack_TouchiPlayer )
    return 
zp_get_user_zombieiPlayer ) ? PLUGIN_HANDLED PLUGIN_CONTINUE
--->
PHP Code:
public Jetpack_TouchiPlayer )
{
    if (
zp_get_user_zombieiPlayer ))
        return 
PLUGIN_HANDLED;
        
    if (
zp_get_user_survivoriPlayer ))
        return 
PLUGIN_HANDLED;
        
    return 
PLUGIN_CONTINUE;


Last edited by zmd94; 10-11-2014 at 12:31.
zmd94 is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-11-2014 , 12:09   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #6

not works, Still, Survivor can pickup the jetpack , and zombies too LOL
__________________

Last edited by ghost95v; 10-11-2014 at 12:12.
ghost95v is offline
Send a message via Skype™ to ghost95v
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-11-2014 , 12:32   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #7

Just try again. I have updated the code. ;)
zmd94 is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-11-2014 , 13:08   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #8

Quote:
Originally Posted by zmd94 View Post
Just try again. I have updated the code. ;)
Thank you , works perfectly ... but, how to add a check for "Plague round" too, to do not drop jetpacks, of survivors ? i added only lnj_round.

PHP Code:
public zp_user_humanized_preiPlayer )
    if( 
get_user_jetpackiPlayer ) )
    if( 
zp_is_lnj_round () )
        return;
    else
    
user_drop_jetpackiPlayer ); 
__________________

Last edited by ghost95v; 10-11-2014 at 13:09.
ghost95v is offline
Send a message via Skype™ to ghost95v
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-11-2014 , 13:52   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #9

Just try this code:
PHP Code:
public zp_user_humanized_preiPlayer )
{
    if( 
get_user_jetpackiPlayer ) )
    {
        if( !
zp_is_lnj_round () && !zp_is_plague_round())
        {
            
user_drop_jetpackiPlayer ); 
        }
    }

zmd94 is offline
ghost95v
Senior Member
Join Date: Apr 2014
Location: somewhere in universe
Old 10-11-2014 , 16:18   Re: [Help] Drop Jetpack, for Survivor
Reply With Quote #10

yes, thnx man. i was already done that, like this "if( zp_is_lnj_round () || zp_is_plague_round () )" .


Sorry, another question, about pickup.(we prevent surv pickup jetpack whole round). Exist a way to make Survivor to pickup the jetpack in round end ? (ex. to pickup, after the message "Win no one"etc... htis happens, event round_end, or zp_round_ended , i think )
__________________

Last edited by ghost95v; 10-11-2014 at 16:20.
ghost95v is offline
Send a message via Skype™ to ghost95v
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 04:04.


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