AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   adding score when pressing func_button (https://forums.alliedmods.net/showthread.php?t=86684)

rufee 03-01-2009 07:32

adding score when pressing func_button
 
Hello
Can someone give me an example code on how to add score when a player presses a func_button
i cant seem to figure this out by my self :(\
Thanks in advance

xPaw 03-01-2009 07:36

Re: adding score when pressing func_button
 
PHP Code:

#include <hamsandwich>

public plugin_init()
    
RegisterHam(Ham_Use"func_button",    "fwdUseButton");

public 
fwdUseButtonentididactivatoruse_typeFloat:flValue ) {
    if( !
is_user_alive(id) || (use_type != 2) || (flValue != 1.0) )
        return 
HAM_IGNORED;
    
    
// player pressed func_button
    
    
return HAM_IGNORED;



rufee 03-01-2009 07:50

Re: adding score when pressing func_button
 
allright now lets say CT and T has its own button with target's ct_target, t_target how could i prevent actions done by button when pressed by its own team(player from CT presses CT button) ?
EDIT
found a way to do it :)


All times are GMT -4. The time now is 16:52.

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