Raised This Month: $ Target: $400
 0% 

preventing player from getting extra frags


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
rufee
Junior Member
Join Date: Aug 2008
Location: Lithuania
Old 03-04-2009 , 14:01   preventing player from getting extra frags
Reply With Quote #1

i need some way to protect the player from pressing the button twice so that he doesnt get extra frags(score)
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "Push the button"
#define VERSION "1.0"
#define AUTHOR "rufee"
public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
RegisterHam(Ham_Use"func_button",    "hamUse"); 
}
public 
hamUse(ent,id
{
 new 
iPlayers[32];
 new 
iNum;
 new 
szTarget[32]
 
pev(entpev_targetszTarget31)
 if ( 
equal(szTarget"ct_target")) {
  if(
get_user_team(id) == 2){ 
 
client_print(idprint_chat"[Push the button]You can't push your own button!")
}
else
{
 
get_playersiPlayers iNum ,"ae" ,"CT" );
 for( new 
0iNum i++){ 
  
set_user_frags(iPlayers[i],get_user_frags(iPlayers[i])+1); 
 
user_kill(iPlayers[i])
 }
 
set_user_frags(id,get_user_frags(id)+1)
  
client_print(idprint_chat"[Push the button]You pushed the button!")
}
}
 if ( 
equal(szTarget"t_target")) {
if(
get_user_team(id) == 1){ 
 
client_print(idprint_chat"[Push the button]You can't push your own button!")
}
else
{
  
get_playersiPlayers iNum ,"ae" ,"TERRORIST" );
 for( new 
0iNum i++){
  
set_user_frags(iPlayers[i],get_user_frags(iPlayers[i])+1)
 
user_kill(iPlayers[i])
 }
 
set_user_frags(id,get_user_frags(id)+1)
  
client_print(idprint_chat"[Push the button]You pushed the button!")
 }
}

__________________

Last edited by rufee; 03-04-2009 at 14:06.
rufee is offline
 


Thread Tools
Display Modes

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 17:05.


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