Raised This Month: $ Target: $400
 0% 

cant catch landing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
avril-lavigne
Banned
Join Date: Apr 2009
Old 07-31-2011 , 22:01   cant catch landing
Reply With Quote #1

I have two sounds - jump & landing

I cant get the landing sound to work
Ive tried fakemeta
engine
many many ways/hours to cath FL_onground //

with oldbutton /buttons
with pev .
other ways

pls give some working code to emit_sound on touch the ground
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-01-2011 , 06:18   Re: cant catch landing
Reply With Quote #2

and one more

how to properly kill task by its ID
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
eXtrem
Member
Join Date: Jul 2011
Old 08-01-2011 , 06:21   Re: cant catch landing
Reply With Quote #3

Quote:
Originally Posted by avril-lavigne View Post
and one more

how to properly kill task by its ID
remove_task( id ) ?
eXtrem is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-01-2011 , 06:33   Re: cant catch landing
Reply With Quote #4

set_task(1.0,"show_hudquad",123,"",0,"b")
return PLUGIN_CONTINUE;

}

public show_hudquad(id) {
set_hudmessage(200, 100, 0, 0.05 , 0.85, 0, 6.0, 8.0, 0.1, 0.1, -1)
show_hudmessage(id," Quad")
}

I know but I have error Host_Error: UserMsg: Not Present on Client 235


public hook_Death()
{
new victim = read_data(2);
if(g_quad_owner == victim)
{
quad_disable
remove_task(123) // kill hud task if the owner is dead and stupid xD
}

return PLUGIN_CONTINUE;
}
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-01-2011 , 07:11   Re: cant catch landing
Reply With Quote #5

Use [code] or [php] tags around code.

Quote:
Originally Posted by avril-lavigne View Post
I know but I have error Host_Error: UserMsg: Not Present on Client 235
That error is not related to that code.
__________________
Hunter-Digital is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-01-2011 , 07:19   Re: cant catch landing
Reply With Quote #6

yes, probably with ent touch.Ill try again (

what about LANDING SOUND ????
give me some WORKING code
I tried all variants with engine / fakemeta
pev FL_ONGROUND

but sound dont work, it works from cs, but not from my plugin (
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-02-2011 , 10:46   Re: cant catch landing
Reply With Quote #7

Not sure what your intentions are or if this is what you're looking for but I figured I would take a stab at it without using prethink (which may be the best way). Are you trying to hook every time a player lands or only if he lands hard and takes damage? If the first, then my code will work 95% of the time. The only downfall is I am able to avoid the sound if I'm standing on a ledge and press a move button only briefly resulting in the player falling off and landing. If you are only looking to hook when falling from a distance and where damage is taken then you can do this easily by hooking FM_EmitSound.

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

new const Version[] = "0.1";

new const 
g_szLandSound[] = "player/sprayer.wav";

const 
BUTTONS = ( IN_FORWARD IN_BACK IN_MOVELEFT IN_MOVERIGHT IN_JUMP );
new 
g_OffGround g_LandEntity g_iMaxPlayers;

public 
plugin_init() 
{
    
register_plugin"Hook Landing" Version "bugsy" );
    
register_forwardFM_CmdStart "fw_FMCmdStart" );
    
g_iMaxPlayers get_maxplayers();
}

public 
fw_FMCmdStartid uc_handle seed )
{
    if ( ( 
get_ucuc_handle UC_Buttons ) | pevid pev_oldbuttons ) ) & BUTTONS )
    {
        if ( !( 
pevid pev_flags ) & FL_ONGROUND ) )
        {
            
g_OffGround |= ( << ( id 31 ) );

            if ( !
g_LandEntity )
                
CreateLandEntity();

            
entity_set_floatg_LandEntity EV_FL_nextthink get_gametime() + 0.01 );
        }
    }
}

public 
LandEntityThinkiEntity )
{
    for ( new 
id id <= g_iMaxPlayers id++ )
    {
        if ( 
g_OffGround & ( << ( id 31 ) ) )
        {
            if ( 
pevid pev_flags ) & FL_ONGROUND )
            {
                
emit_soundid CHAN_BODY g_szLandSound VOL_NORM ATTN_NORM PITCH_NORM );
                
                
g_OffGround &= ~( << ( id 31 ) );
                
                if ( !
g_OffGround )
                    break;
            }
        }
    }
    
    if ( 
g_OffGround )
        
entity_set_floatg_LandEntity EV_FL_nextthink get_gametime() + 0.01 );
}

CreateLandEntity()
{
    
g_LandEntity create_entity"info_target" );
    
entity_set_stringg_LandEntity EV_SZ_classname "land_entity" );
    
register_think"land_entity" "LandEntityThink" );    

__________________

Last edited by Bugsy; 08-02-2011 at 19:44.
Bugsy is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-02-2011 , 11:16   Re: cant catch landing
Reply With Quote #8

thanks bugsy I Know how to play sound on damage/landing.
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc

Last edited by avril-lavigne; 08-02-2011 at 11:27.
avril-lavigne is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-02-2011 , 11:27   Re: cant catch landing
Reply With Quote #9

Bugsy you are my hero it works exactly as I need ( I have added my jump sound.) thanks!!!!!
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-02-2011 , 21:22   Re: cant catch landing
Reply With Quote #10

Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

#define PLUGIN  "Test"
#define AUTHOR  "Jim"
#define VERSION  "1.0"

public plugin_init()
{
  register_plugin(PLUGIN, VERSION, AUTHOR)
}

public client_PostThink(id)
{
  if(is_user_alive(id) && pev(id, pev_flags) & FL_ONGROUND && get_pdata_float(id, 255) > 0)
  {
    client_print(id, print_chat, "landing!");
  }
}
if you want a "former" landing, you should use this, change 0 to 350.0
#define PLAYER_FALL_PUNCH_THRESHHOLD (float)350 // won't punch player's screen/make scrape noise unless player falling at least this fast.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 03:26.


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