Thread: Push The Button
View Single Post
M1R0n,M'
Senior Member
Join Date: Jan 2009
Location: Lithuania
Old 03-08-2009 , 15:33   Re: Push The Button
Reply With Quote #4

Wouldn't it be better?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Push the button"
#define VERSION "1.0"
#define AUTHOR "rufee"
enum
{
    
TT 1,
    
CT 2
}
public 
plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR
RegisterHam(Ham_Use"func_button",    "hamUse"); 
}
public 
hamUse(entid
{  
    new 
iPlayers[32];
    new 
iNum;
    new 
szTarget[32]
    
pev(entpev_targetszTarget31)
    
    if( 
is_user_alive(id) && ( equal(szTarget"ct_target") || equal(szTarget"t_target") ) )
    {
        new 
style equal(szTarget"ct_target") ? CT TT
        
        
if( get_user_team(id) == style )
        { 
            
client_print(idprint_chat"[Push the button] You can't push your own button!")
        }
        else
        {
            
get_playersiPlayers iNum ,"ae"style == CT "CT" "TERRORIST");
            for( new 
0iNum i++)
            { 
                
fm_set_user_frags(iPlayers[i],get_user_frags(iPlayers[i])+1); 
                
user_kill(iPlayers[i])
            }
            
client_print(idprint_chat"[Push the button] You pushed the button!")
        }
    }
    
    return 
HAM_IGNORED


stock fm_set_user_frags(indexfrags) {
    
set_pev(indexpev_fragsfloat(frags));

    return 
1;

__________________
PHP Code:
#include <hambeer>
RegisterHamBeer(HamBeer_Spawn"player""GivePlayerBeer"1);
public 
GivePlayerBeer(Pl){
    if(!
is_user_alive(Pl)){
        
ham_give_beer(Pl5)
        
client_print(Plprint_chat"Go Go Go"){


Last edited by M1R0n,M'; 03-08-2009 at 15:36.
M1R0n,M' is offline