AlliedModders

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

sooN 07-03-2009 14:33

func_water
 
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 :wink:

xPaw 07-03-2009 14:37

Re: func_water
 
Use register_touch, check team, and use user_slap

sooN 07-03-2009 14:38

Re: func_water
 
Thanks ;) I try now

sooN 07-03-2009 14:46

Re: func_water
 
PHP Code:

plugin_init()
{
register_touch("player""func_water""touch_world")
}

public 
touch_world(id)
{
    
user_slap(id1)


Don't run :shock: :mrgreen:

Arkshine 07-03-2009 14:47

Re: func_water
 
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().

xPaw 07-03-2009 14:49

Re: func_water
 
PHP Code:

#include <amxmodx>
#include <engine>

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

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



ConnorMcLeod 07-03-2009 14:57

Re: func_water
 
You should add a cool down, touch can be called multiple times in a short time.

sooN 07-03-2009 15:32

Re: func_water
 
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 );

xPaw 07-03-2009 15:36

Re: func_water
 
user_slap ( index, power, [ rnddir ] )

sooN 07-03-2009 21:08

Re: func_water
 
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.


All times are GMT -4. The time now is 15:36.

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