AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help on blocking things (https://forums.alliedmods.net/showthread.php?t=57072)

flyeni6 06-27-2007 16:17

need help on blocking things
 
i have this juggernaut code, it frm GHW JUGGERNAUT.
yea so anyways im runnning this with CSDM.
it sets the juggernaut T and the rest CT.
and what a new juggernaut is found, about 5 people get worldspawned on a new round. how can i stop that?
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fun>
new hm_jugg_health
new juggernautmodecvar
new juggernaut
new healthhealth3
public plugin_init()
{
 
register_plugin("Juggernaut","3.0","GHW_Chronic")
 
register_concmd("hm_jugg_mode","toggle_cmd",ADMIN_LEVEL_D," <1=on 0=off>")
 
juggernautmodecvar register_cvar("hm_jugg","1")
 
hm_jugg_health  register_cvar("hm_jugg_health","600")
 
 
set_task(0.1,"repeated_task",0,"",0,"b")
 
register_event("DeathMsg","juggdeath","a")
 
find_new_jn()
}
public 
repeated_task()
{
 new 
name[32]
 if(
get_pcvar_num(juggernautmodecvar) && is_user_alive(juggernaut))
 {
  
set_cvar_num("sv_autoteambalance",0)
  
set_cvar_num("mp_limitteams",0)
  
//set_cvar_num("mp_freezetime",0)
  
new players[32], num
  get_players
(players,num)
  for(new 
i=0;i<num;i++)
  {
   if(
cs_get_user_team(players[i])==CS_TEAM_T)
   {
    if(
players[i]!=juggernaut
     
cs_set_user_team(players[i],CS_TEAM_CT)
    else
    {
     if(
health3)
     {
      
set_user_health(juggernaut,health3)
      
health3 0
     
}
     else
     {
      new 
health2 get_user_health(juggernaut)
      if(
health2==100set_user_health(juggernaut,health)
      else if(
health2health health2
      
}
    }
   }
  }
  
cs_set_user_team(juggernaut,CS_TEAM_T)
  
cs_set_user_model(juggernaut"Halo_Red")
  
cs_set_user_plant(juggernaut,0,0)
  
get_user_name(juggernautname31)
  
set_hudmessage(02550, -1.00.0306.00.1)
  
show_hudmessage(0"Current Juggernaut: %s^nJuggernaut Health: %d",name,health)
 }
}
public 
find_new_jn()
{
 if(
get_pcvar_num(juggernautmodecvar))
 {
  new 
players[32], numplayer
  get_players
(players,num)
  for(new 
i=0;i<num;i++)
  {
   if(
cs_get_user_team(players[i])!=CS_TEAM_SPECTATOR && players[i]>juggernaut)
   {
    
player=players[i]
    break;
   }
  }
  if(!
player)
  {
   if(
players[0]) player=players[0]
   else if(
is_user_connected(juggernaut)) player juggernaut
   
}
  if(
player)
  {
   
health3 get_pcvar_num(hm_jugg_health)
   if(
is_user_connected(juggernaut)) set_user_rendering(juggernaut,kRenderFxNone,0,0,0,kRenderTransAlpha,255)
   
juggernaut=player
   set_user_rendering
(juggernaut,kRenderFxGlowShell,255,255,255,kRenderTransAlpha,70)
   new 
name[32]
   
get_user_name(juggernaut,name,31)
  }
  else
  {
   
juggernaut 0
   set_task
(5.0,"find_new_jn")
  }
 }
}
public 
juggdeath()
{
    if(
get_pcvar_num(juggernautmodecvar))
    {
        if(
read_data(2) == juggernaut)
        {
            new 
jugg read_data(1)   
            
juggernaut jugg
            set_user_health
(juggernautget_pcvar_num(hm_jugg_health))
            
// ...
        
}
 
        else if(
read_data(1) == juggernaut)
                    return 
PLUGIN_CONTINUE
    
}
 
    return 
PLUGIN_CONTINUE
}
public 
toggle_cmd(id,level,cid)
{
 if(!
cmd_access(id,level,cid,2))
 {
  return 
PLUGIN_HANDLED
 
}
 new 
arg1[32]
 
read_argv(1,arg1,31)
 if(
str_to_num(arg1))
 {
  
set_pcvar_num(juggernautmodecvar,1)
  
find_new_jn()
  
server_cmd("sv_restard 5")
 }
 else
 {
  
set_pcvar_num(juggernautmodecvar,0)
  
juggernaut 0
 
}
 return 
PLUGIN_HANDLED



flyeni6 06-28-2007 04:46

Re: need help on blocking things
 
ignore my first post. i've found out the problem: it is because there isn't enough spawn points for 17+ player on one team side.

how can i block this or add more spawn points to both sides of a map(t side and CT side)

fxfighter 06-28-2007 04:51

Re: need help on blocking things
 
To add more spawn points you wuld need hammer editor but it might be easyer to just move spawned players to origin next to the spawn.

flyeni6 06-28-2007 05:16

Re: need help on blocking things
 
no im trying to do this within the plugin.
any ideas?
thx for replying :)

hlstriker 06-28-2007 12:11

Re: need help on blocking things
 
This should work...

PHP Code:

// Make a counter-terrorist spawn
new ent create_entity("info_player_start");
entity_set_string(entEV_SZ_classname"info_player_start");
entity_set_origin(entFloat{1.01.01.0}); // Set the origin you want the spawn to be
entity_set_int(entEV_INT_solidSOLID_NOT);
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY);
entity_set_size(entFloat{1.01.01.0}, Float{1.01.01.0});

// Make a terrorist spawn
new ent create_entity("info_player_deathmatch");
entity_set_string(entEV_SZ_classname"info_player_deathmatch");
entity_set_origin(entFloat{1.01.01.0}); // Set the origin you want the spawn to be
entity_set_int(entEV_INT_solidSOLID_NOT);
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY);
entity_set_size(entFloat{1.01.01.0}, Float{1.01.01.0}); 


flyeni6 06-30-2007 18:07

Re: need help on blocking things
 
ok how can i make 10 new spawns no mater what map it is?


All times are GMT -4. The time now is 21:24.

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