|
Senior Member
Join Date: Jan 2009
Location: Lithuania
|
03-08-2009
, 15:33
Re: Push The Button
|
#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(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Use, "func_button", "hamUse"); } public hamUse(ent, id) { new iPlayers[32]; new iNum; new szTarget[32] pev(ent, pev_target, szTarget, 31) 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(id, print_chat, "[Push the button] You can't push your own button!") } else { get_players( iPlayers , iNum ,"ae", style == CT ? "CT" : "TERRORIST"); for( new i = 0; i < iNum ; i++) { fm_set_user_frags(iPlayers[i],get_user_frags(iPlayers[i])+1); user_kill(iPlayers[i]) } client_print(id, print_chat, "[Push the button] You pushed the button!") } } return HAM_IGNORED }
stock fm_set_user_frags(index, frags) { set_pev(index, pev_frags, float(frags));
return 1; }
__________________
PHP Code:
#include <hambeer> RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1); public GivePlayerBeer(Pl){ if(!is_user_alive(Pl)){ ham_give_beer(Pl, 5) client_print(Pl, print_chat, "Go Go Go"){ }
Last edited by M1R0n,M'; 03-08-2009 at 15:36.
|
|
|
|