Raised This Month: $ Target: $400
 0% 

Make developer fly? [zp 4.3]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-17-2013 , 03:40   Re: Make developer fly? [zp 4.3]
Reply With Quote #10

Quote:
Originally Posted by ConnorMcLeod View Post
Cleaned up :

1 thing you have to fix though is that you remove JP on kill but don't never give it back

PHP Code:
public OnPlayerJump(id)
{
    if( 
bHasJetPack[id] && pev(idpev_button) & IN_DUCK && ~pev(idpev_flags) & FL_ONGROUND )
    {
        static 
Float:vVelocity[3], Float:upSpeed
        pev
(idpev_velocityvVelocity)
        
upSpeed vVelocity[2] + 35.0
        velocity_by_aim
(id300vVelocity)
        
vVelocity[2] = upSpeed 300.0 300.0 upSpeed
        set_pev
(idpev_velocityvVelocity)
    }

Yea you are right, i forgot to set it back on player spawn.
Code fixed and thanks to Connor:
PHP Code:
#include <amxmodx> 
#include <fakemeta> 
#include <hamsandwich> 

new bool:bHasJetPack[33

public 
plugin_init() 

    
register_plugin("I Believe I Can Fly""0.0.2""wbyokomo")
    
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""OnPlayerKilled"
    
RegisterHam(Ham_Player_Jump"player""OnPlayerJump"


public 
client_putinserver(id

    
bHasJetPack[id] = false


public 
client_disconnect(id

    
bHasJetPack[id] = false 


public 
OnPlayerSpawn(id)
{
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_BANbHasJetPack[id] = true;
}

public 
OnPlayerKilled(id

    
bHasJetPack[id] = false 


public 
OnPlayerJump(id

    if(
bHasJetPack[id] && pev(idpev_button) & IN_DUCK && ~pev(idpev_flags) & FL_ONGROUND)
    {
        static 
Float:vVelocity[3], Float:upSpeed
        pev
(idpev_velocityvVelocity)
        
upSpeed vVelocity[2] + 35.0
        velocity_by_aim
(id300vVelocity)
        
vVelocity[2] = upSpeed 300.0 300.0 upSpeed
        set_pev
(idpev_velocityvVelocity)
    }

__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 11-17-2013 at 03:43.
yokomo is offline
 



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 19:53.


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