Raised This Month: $ Target: $400
 0% 

func_water


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 14:33   func_water
Reply With Quote #1

Hello,

I need a small function that when players on terrorist team touch the entity func_water he are slapped 1 times all the 5 seconds.

Thanks
__________________
sooN is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-03-2009 , 14:37   Re: func_water
Reply With Quote #2

Use register_touch, check team, and use user_slap
__________________
xPaw is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 14:38   Re: func_water
Reply With Quote #3

Thanks ;) I try now
__________________
sooN is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 14:46   Re: func_water
Reply With Quote #4

PHP Code:
plugin_init()
{
register_touch("player""func_water""touch_world")
}

public 
touch_world(id)
{
    
user_slap(id1)

Don't run
__________________
sooN is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-03-2009 , 14:47   Re: func_water
Reply With Quote #5

register_touch( "player", "func_water", "myfunction" );

And in the callback, checking if player is a terro.


Edit : It should work in your post. Otherwise, try to reverse in register_touch().
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-03-2009 , 14:49   Re: func_water
Reply With Quote #6

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

public plugin_init( ) {
    
register_touch"func_water""player""FwdTouchWater" );
}

public 
FwdTouchWateriEntityid ) {
    if( 
get_user_teamid ) == )
        
user_slapid );

__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-03-2009 , 14:57   Re: func_water
Reply With Quote #7

You should add a cool down, touch can be called multiple times in a short time.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 15:32   Re: func_water
Reply With Quote #8

PHP Code:
public FwdTouchWateriEntityid 
{
    if( 
get_pdata_int(id,114) == )
    {
        
user_slapid );
    }

I have one error : Error: Number of arguments does not match definition on line 41

Line 41 = user_slap( id );
__________________

Last edited by sooN; 07-03-2009 at 15:33. Reason: error
sooN is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 07-03-2009 , 15:36   Re: func_water
Reply With Quote #9

user_slap ( index, power, [ rnddir ] )
__________________
xPaw is offline
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 21:08   Re: func_water
Reply With Quote #10

PHP Code:
public plugin_init()
{
    
register_touch("func_water""player""FwdTouchWater")

public 
FwdTouchWater(iEntityid
{
    if( 
get_pdata_int(id,114) == )
    {
        
user_slap(id1)
    }

Don't run When i go to the water i'm not slapped.
__________________
sooN is offline
Reply


Thread Tools
Display Modes

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:36.


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