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

Make developer fly? [zp 4.3]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 11-15-2013 , 16:23   Make developer fly? [zp 4.3]
Reply With Quote #1

Can i make so only me can fly?, or only give me an invisible parachute, i just want it to fit my model.

__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 11-15-2013 , 17:37   Re: Make developer fly? [zp 4.3]
Reply With Quote #2

  • if you want an invisible parachute, search this keyword (don't edit) in my posts: parachute+null
  • if you want it only for you, edit the flag in the .sma
__________________

Last edited by ANTICHRISTUS; 11-15-2013 at 17:38.
ANTICHRISTUS is offline
Old 11-16-2013, 06:07
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: STOP
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-16-2013 , 09:05   Re: Make developer fly? [zp 4.3]
Reply With Quote #3

Quote:
Originally Posted by LordOfNothing View Post
press E when you are in air and you need flag A (admin_immunity)

PHP Code:
#include <amxmodx>
#include <fun>
#include <fakemeta>
#include <engine>
#include <amxmisc>

public plugin_init()
{
    
register_forward(FM_PlayerPreThink"ScanPlayer");
}

public 
ScanPlayer(id)
{
    if(!
get_user_frags(id) & ADMIN_IMMUNITY)
        return 
PLUGIN_HANDLED

    
if(get_user_button(id) & IN_USE)
    {
        
set_user_gravity(id0.3);
    }else{
        
set_user_gravity(id1.0);
    }
    return 
PLUGIN_CONTINUE


if(!(get_user_flags(id) & ADMIN_IMMUNITY))

A bit silly method and doesn't work well with anything else that changes your gravity, so you know.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 11-16-2013 , 10:33   Re: Make developer fly? [zp 4.3]
Reply With Quote #4

Quote:
Originally Posted by DarkGod View Post
if(!(get_user_flags(id) & ADMIN_IMMUNITY))

A bit silly method and doesn't work well with anything else that changes your gravity, so you know.
You won't really fly, you also need to play with the players velocity.
__________________
Kia is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 11-16-2013 , 12:10   Re: Make developer fly? [zp 4.3]
Reply With Quote #5

As I said, it's a silly method.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 11-16-2013 , 15:37   Re: Make developer fly? [zp 4.3]
Reply With Quote #6

I used the one you said antichristus, and it worked well, a bit laggy when falling down, the intention was that i could glide in air with the wings, and it worked! , thank you all
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-17-2013 , 01:36   Re: Make developer fly? [zp 4.3]
Reply With Quote #7

Hi, you can use this, it is the same method as JetPack but more efficient. To fly you need to hold jump+duck button, have fun.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new bool:bHasJetPack[33]

public 
plugin_init()
{
    
register_plugin("I Believe I Can Fly""0.0.1""wbyokomo")
    
    
RegisterHam(Ham_Killed"player""OnPlayerKilled")
    
RegisterHam(Ham_Player_Jump"player""OnPlayerJump")
}

public 
client_putinserver(id)
{
    
bHasJetPack[id] = false
    
if(get_user_flags(id) & ADMIN_BANbHasJetPack[id] = true;
}

public 
client_disconnect(id)
{
    
bHasJetPack[id] = false
}

public 
OnPlayerKilled(id)
{
    
bHasJetPack[id] = false
}

public 
OnPlayerJump(id)
{
    if(
bHasJetPack[id])
    {
        static 
buttonflag
        button 
pev(idpev_button)
        
flag pev(idpev_flags)
        
        if((
button IN_DUCK) && !(flag FL_ONGROUND))
        {
            static 
Float:vVelocity[3], Float:vAngles[3], Float:vForward[3]
            
pev(idpev_velocityvVelocity)
            
pev(idpev_anglesvAngles)
            
vAngles[2] = 0.0
            angle_vector
(vAnglesANGLEVECTOR_FORWARDvForward)
            
vAngles vForward
            vAngles
[0] *= 300.0
            vAngles
[1] *= 300.0
            vVelocity
[0] = vAngles[0]
            
vVelocity[1] = vAngles[1]
            if(
vVelocity[2] < 300.0vVelocity[2] += 35.0;
            
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
yokomo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-17-2013 , 02:21   Re: Make developer fly? [zp 4.3]
Reply With Quote #8

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)
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 11-17-2013 at 02:23.
ConnorMcLeod is offline
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 #9

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
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 16:40.


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