Raised This Month: $ Target: $400
 0% 

need help understanding this.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FiVeTeNMontrail
Junior Member
Join Date: Aug 2006
Old 11-12-2007 , 21:59   need help understanding this.
Reply With Quote #1

i am trying to make a pluging so when you kill yourself like 4 times in one round, the server kicks you. It works but im trying to make it so when a new round starts, it resets everything. That is what im having trouble with. Which event would i use for a new round? I wasn't sure so i made it call 3 differen't events.. but when a new round starts, nothing is printed on the screen like i wanted it to. Any clue?

Code:
#include <amxmodx> 
#include <amxmisc> 
#include <engine>
#include <core>
new attacker
new Float:countup[32]
new Float:countupleft[32]
public plugin_init()
{
 register_plugin("Anti-Death Kicker","1.0","FiVeTeN") 
 register_event("Damage","tally","b")
 register_event("EndRound","endRound","a")
 register_event("RoundStat","roundStat","a")
 register_event("RndRes","roundRes","a")
}
public tally(id)
{
 attacker=get_user_attacker(id)
 if(is_user_alive(id)==0)
 {
  if(attacker>32)
  {
  countup[id]=countup[id]+1
  if(countup[id]==2)
  {
   client_print(id,print_chat,"[AMXX] Careful! You have 4 suicides left.",countupleft[id]);
  }
  else if(countup[id]==4)
  {
   client_print(id,print_chat,"[AMXX] Careful! You have 3 suicides left.",countupleft[id]);
  }
  else if(countup[id]==6)
  {
   client_print(id,print_chat,"[AMXX] Careful! You have 2 suicides left.",countupleft[id]);
  }
  else if(countup[id]==8)
  {
   client_print(id,print_chat,"[AMXX] Careful! You have 1 suicides left.",countupleft[id]);
  }
 }
 if(attacker==id)
 {
  countup[id]=countup[id]+1
  if(countup[id]==2){
   client_print(id,print_chat,"[AMXX] Careful! You have 4 suicides left.",countupleft[id]);
  }else if(countup[id]==4){
   client_print(id,print_chat,"[AMXX] Careful! You have 3 suicides left.",countupleft[id]);
  }else if(countup[id]==6){
   client_print(id,print_chat,"[AMXX] Careful! You have 2 suicides left.",countupleft[id]);
  }else if(countup[id]==8){
   client_print(id,print_chat,"[AMXX] Careful! You have 1 suicides left.",countupleft[id]);
  }
 }
 
 
 if(countup[id]>9)
 {
  new userid = get_user_userid(id)  ;
  server_cmd("banid 10 #%d kick",userid);
  countup[id]=0.0;
  countupleft[id]=0.0;
 }
 }
 return PLUGIN_HANDLED
}
public endRound()
{
 client_print(0,print_chat,"Round Ended");
 return PLUGIN_HANDLED
}
public roundStat()
{
 client_print(0,print_chat,"Round Status");
 return PLUGIN_HANDLED
}
public roundRes()
{
 client_print(0,print_chat,"Round RES?");
 return PLUGIN_HANDLED
}
FiVeTeNMontrail is offline
 



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 01:20.


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