Raised This Month: $ Target: $400
 0% 

adding score when pressing func_button


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
rufee
Junior Member
Join Date: Aug 2008
Location: Lithuania
Old 03-01-2009 , 07:32   adding score when pressing func_button
Reply With Quote #1

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
rufee is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 03-01-2009 , 07:36   Re: adding score when pressing func_button
Reply With Quote #2

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;

__________________
xPaw is offline
rufee
Junior Member
Join Date: Aug 2008
Location: Lithuania
Old 03-01-2009 , 07:50   Re: adding score when pressing func_button
Reply With Quote #3

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

Last edited by rufee; 03-02-2009 at 11:12.
rufee 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 16:52.


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