Raised This Month: $ Target: $400
 0% 

No Base Camping


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
endeffects
Senior Member
Join Date: Nov 2007
Old 06-05-2009 , 15:57   No Base Camping
Reply With Quote #1

Hi guys, i modified a small plugin to get rid of the ct base campers
on assault maps but it don't works well.

the idea is that the plugin checks the positions of each ct for the first 100s
if the player moved over the half of the map the plugin stops the check
for the current round, if the player don't moved over this fenceline the player
get killed.

for sure this needs more improvements but for now i need
some help to get the basics to work. right now it seems like
that it can't calculate the middle of the map correctly and
maybe some more bugs are available too. any ideas whats wrong here?



Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>
#define MINNUM  2
new CTspawn_loc[3]
new Tspawn_loc[3]
new bool:bCrossedFenceLine[33]
new bool:PunishCampers = false
public plugin_init()
{
 register_plugin("No BaseCamp","1.0","")
 new mapname[32]
 get_mapname(mapname,31)
 
 register_logevent("change_status", 2, "1=Round_Start")
 
 set_task(0.1,"spawn_locs")
}
public client_putinserver(id)
{
 set_task(2.0,"prethink",id,"",0,"b")
 bCrossedFenceLine[id] = false
}
public client_disconnect(id)
{
 remove_task(id)
 bCrossedFenceLine[id] = false
}
 
public change_status()
{
 PunishCampers = false
 remove_task(199)
 
 for(new i=1;i<33;i++)
 {
  bCrossedFenceLine[i] = false
 }
 
 set_task(100.0,"start_punishment",199)
}
public start_punishment()
{
 PunishCampers = true
}
public prethink(id)
{
 //new  = get_timeleft()
 
 if( is_user_alive(id) || bCrossedFenceLine[id] == true )
 {
  new origin[3]
  get_user_origin(id,origin)
  new team[32]
  get_user_team(id,team,31)
  new teamnum=1
  if(containi(team,"CT")!=-1 || containi(team,"Counter")!=-1)
  {
   teamnum=2
  }
  //if( (get_distance(origin,CTspawn_loc)<get_distance(origin,Tspawn_loc) && teamnum==1) || (get_distance(origin,Tspawn_loc)<get_distance(origin,CTspawn_loc) && teamnum==2) )
  if( get_distance(origin,CTspawn_loc)>get_distance(origin,Tspawn_loc) && teamnum==1 )
  {
   bCrossedFenceLine[id] = true
  }
  if( PunishCampers == true ) 
  {
   if( bCrossedFenceLine[id] == true )
   {
    remove_task(id) 
   } else {
    user_kill(id) 
    remove_task(id) 
   }
  }
 } else {
  remove_task(id) 
 }
}
public spawn_locs()
{
 new ent1 = find_ent_by_class(0,"info_player_start")
 new ent2 = find_ent_by_class(0,"info_player_deathmatch")
 if(!ent1)
 {
  log_amx("No info_player_start found")
 }
 if(!ent2)
 {
  log_amx("No info_player_deathmatch found")
 }
 new Float:CTspawn_loc_F[3]
 new Float:Tspawn_loc_F[3]
 entity_get_vector(ent1,EV_VEC_origin,CTspawn_loc_F)
 entity_get_vector(ent2,EV_VEC_origin,Tspawn_loc_F)
 CTspawn_loc[0] = floatround(CTspawn_loc_F[0])
 CTspawn_loc[1] = floatround(CTspawn_loc_F[1])
 CTspawn_loc[2] = floatround(CTspawn_loc_F[2])
 Tspawn_loc[0] = floatround(Tspawn_loc_F[0])
 Tspawn_loc[1] = floatround(Tspawn_loc_F[1])
 Tspawn_loc[2] = floatround(Tspawn_loc_F[2])
}
__________________
Get rid of all these fake, spam, redirect servers
on your steam server list!

Last edited by endeffects; 06-05-2009 at 16:16.
endeffects is offline
endeffects
Senior Member
Join Date: Nov 2007
Old 06-07-2009 , 04:29   Re: No Base Camping
Reply With Quote #2

nobody an idea how to fix this? =(
__________________
Get rid of all these fake, spam, redirect servers
on your steam server list!
endeffects 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 14:02.


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