AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Flying script? (https://forums.alliedmods.net/showthread.php?t=204243)

LAMMPARD8_PRO 12-28-2012 20:21

Flying script?
 
Hello,
Since i started to learn pawn hard and my private plug-in maker is because of some reason out of the forums.. i have some bad situations to solve. I couldn't do anything, the information is 0, so i decide to ask here.

As we know the plug-in jetpack with comes with bazooka and 1393191239 things more, i couldn't see in the script function that will run the flying. You know ..ctrl+space and the player go to the sky.

Ive tried with PreThink with registered keys to set user gravity to 0 and from Post Think when the function is not in process (ctrl is not pressed) to set the players gravity to normal. But i got navigation problems :shock: Can you help me draw a simple script that if u press ctrl+space you flying and navigating like the Jetpack.. i hope the script is short and so i can use it in my function. Thanks. :)

twix_p 12-28-2012 20:29

Re: Flying script?
 
http://forums.alliedmods.net/showthread.php?p=213777

Jetpack Lite is more simplified.

PHP Code:


public client_PreThink(id) {

    if( !
is_user_alive(id)) {
        return 
PLUGIN_CONTINUE;
    }
    if(!(
get_user_button(id) & IN_JUMP)) {
        return 
PLUGIN_CONTINUE;
    }

    new 
Float:fAim[3] , Float:fVelocity[3];
    
VelocityByAim(id 500 fAim);

    
fVelocity[0] = fAim[0];
    
fVelocity[1] = fAim[1];
    
fVelocity[2] = fAim[2];

    
set_user_velocity(id fVelocity);

    
entity_set_int(id EV_INT_gaitsequence 6);

    
emit_sound(id CHAN_VOICE JP_SOUND 1.0 ATTN_NORM PITCH_NORM);

    if(
frame[id] >= 3) {
        
frame[id] = 0;
        
smoke_effect(id);
        
entity_set_string(id EV_SZ_weaponmodel "models/p_egon.mdl");
    }
    
frame[id]++;

    return 
PLUGIN_CONTINUE;



LAMMPARD8_PRO 12-28-2012 20:57

Re: Flying script?
 
Right, thanks. I did some corrects so i can use that. That is like the zp class crow btw same script way. Thanks.

AngeIII 12-29-2012 03:45

Re: Flying script?
 
inside Loop velocity and origins nothing more needed.


All times are GMT -4. The time now is 13:40.

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