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

Few questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EvoLutionCRO
New Member
Join Date: May 2012
Location: Varaždin, Croatia
Old 08-18-2013 , 10:22   Few questions
Reply With Quote #1

Hello,

I have few scripting questions:

Spawn boxes on map as entity

Is it possible to spawn boxes which look like ones on the image below as an entity on specific coordinates?



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)

Code examples would be useful..
-Thank you alot!
EvoLutionCRO is offline
Send a message via MSN to EvoLutionCRO Send a message via Skype™ to EvoLutionCRO
Old 08-18-2013, 10:38
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: troll, or posting random confusing code, or posting for posts count
EvoLutionCRO
New Member
Join Date: May 2012
Location: Varaždin, Croatia
Old 08-18-2013 , 16:39   Re: Few questions
Reply With Quote #2

After searching a bit, I couldn't find anything. Can you please provide me with some working example.
EvoLutionCRO is offline
Send a message via MSN to EvoLutionCRO Send a message via Skype™ to EvoLutionCRO
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 08-22-2013 , 04:40   Re: Few questions
Reply With Quote #3

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
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 08-22-2013 , 11:39   Re: Few questions
Reply With Quote #4

its possible to spawn boxes exactly like in your picture but, you will need a bit more knowledge and you will need each crate's model.
you will also need to know a crate's size ( mins, max ).

you can also set each crate's type using EV_INT_iuser1 ( just an example ).
and then when you touch it it'll act depending on its type.

you can also look at DeathRace plugin. ( it needs a created map< deathrace mod > and it replace crates.. )

Last edited by red_bull2oo6; 08-22-2013 at 11:41. Reason: misspeled something
red_bull2oo6 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 09:01.


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