Raised This Month: $ Target: $400
 0% 

Few questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-22-2013 , 04:40   Re: Few questions
Reply With Quote #1

Quote:
Originally Posted by EvoLutionCRO View Post

Check if user isn't moving

Is there any way to trigger event if user hadn't moved (Jumped, ducked, went forward, backward, left or right) for 5 seconds and then trigger other event if user moves again (Note: camera moving doesn't affect events)
Search for the plugin BAD CAMPER For Checking NO Movement..
Plus I had this code You can use it if it looks useful to you

PHP Code:
public FM_CmdStart_Preplruc_handle )
{
    static 
bool:wasOnGround[33], bool:wasDuckingBeforeFalling[33];
    static 
buttonoldButtonsflags;
    
    
//button = pev( plr, pev_button );
    
button get_ucuc_handle UC_Buttons );
    
oldButtons pevplrpev_oldbuttons );
    
flags pevplrpev_flags );
    
    if( 
wasOnGround[plr] && !( flags FL_ONGROUND ) )
    {
        
wasDuckingBeforeFalling[plr] = bool:!!( oldButtons IN_DUCK );
    }
    else if( 
wasDuckingBeforeFalling[plr] && wasOnGround[plr] && flags FL_ONGROUND )
    {
        
wasDuckingBeforeFalling[plr] = false;
    }
    
    if( 
button IN_JUMP && !( oldButtons IN_JUMP ) )
    {
        if( 
wasOnGround[plr] )
        {
            
// detecting normal jumps
        
++g_iJumps[plr];
        if(
g_iJumps[plr]%3==0)
        { 
    
colored_print(0"^x04 Yeah Baby !! ^x03 You got 1 point for perfect jump :D");
    }        
}
        else
        {
            
// detecting bhops
            
            
static Float:velocity[3];
            
pevplrpev_velocityvelocity );
            
            if( !
velocity[2] )
            {
                
colored_print(0"^x04 Whoaaa Pro !! ^x03 You got 2 point for Bhop jump :P");
                if( 
button IN_DUCK )
                {
                    
// detecting duckbhops
        
colored_print(plr"^x04 PURE SKILL !! ^x03 You got 3 points for Perfect Duck Bhop xD ");
                }
            }
        }
    }
    else if( 
button IN_DUCK )
    {
        
        if( 
oldButtons IN_DUCK )
        {
            if( !
wasDuckingBeforeFalling[plr] && !wasOnGround[plr] && flags FL_ONGROUND )
            {
                
// detecting jumps or any cases where the user ducks in the air but does not release it on ground
        
colored_print(plr"^x04 GODLIKE !! ^x03 You got 4 points for Weird Duck Bhop");
            }
        }
        else
        {
            if( 
wasOnGround[plr] )
            {
                
// detecting normal ducks
        
++g_iDucks[plr];
        if(
g_iDucks[plr]%3==0)
        {
        
colored_print(plr"^x04 Dont Keep Ducking Idiot :/");
        }            
}
        }
    }
    
    
wasOnGround[plr] = bool:!!( flags FL_ONGROUND );

Use Colored_print Stock by Mercyless Or Just Remove those print commands.
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux 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 15:50.


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