Raised This Month: $ Target: $400
 0% 

double switch


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 05-25-2009 , 11:00   double switch
Reply With Quote #1

would it be wrong to do this double switch in a touch func.


PHP Code:
register_touch(PLAYERPLAYER"func_touch"
PHP Code:
public func_touch(idother)
{
 if(
get_pcvar_num(p_enable) && is_on_team[id] == is_on_team[other]) 
 {
  
entity_set_int(idEV_INT_solidSOLID_NOT
  
entity_set_int(otherEV_INT_solidSOLID_NOT)
 
  switch(
task_is_running[id]) 
  { 
   case 
0
   { 
    
set_task(0.2"btn"id
    
task_is_running[id] = 
   
}
  }
  switch(
task_is_running[other]) 
  { 
   case 
0
   { 
    
set_task(0.2"btn"other
    
task_is_running[other] = 
   

  } 
 }

or how else to handle it?

This is the full code:

PHP Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <amxmodx>
#include <engine>
#include <dodx>
////////////////////////////////////////////////////////////////////////////////////////////////////
#define P "DoD None Solid Mates"
#define V "v1.0 by Dr.G"
#define A "AMXX DoD Team"
////////////////////////////////////////////////////////////////////////////////////////////////////
new const PLAYER[] = "player" ; new p_enableis_on_team[33], task_is_running[33]
////////////////////////////////////////////////////////////////////////////////////////////////////
public plugin_init() 
{
 
register_plugin(PVA
 
register_cvar("dod_nsm_stats"VFCVAR_SERVER|FCVAR_SPONLY)
 
 
p_enable register_cvar("dod_nsm","1")
 
 
register_touch(PLAYERPLAYER"func_touch"
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public dod_client_changeteam(idteamoldteam

 
is_on_team[id] = team 
 
 
if(is_on_team[id] == 3
  
is_on_team[id] = 
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public func_touch(idother)
{
 if(
get_pcvar_num(p_enable) && is_on_team[id] == is_on_team[other]) 
 {
  
entity_set_int(idEV_INT_solidSOLID_NOT
  
entity_set_int(otherEV_INT_solidSOLID_NOT)
 
  switch(
task_is_running[id]) 
  { 
   case 
0
   { 
    
set_task(0.2"btn"id
    
task_is_running[id] = 
   
}
  }
  switch(
task_is_running[other]) 
  { 
   case 
0
   { 
    
set_task(0.2"btn"other
    
task_is_running[other] = 
   

  } 
 }
}
////////////////////////////////////////////////////////////////////////////////////////////////////
public btn(id

 
task_is_running[id] = 
 entity_set_int
(idEV_INT_solidSOLID_BBOX)
 
/*
 new name[32]
 get_user_name(id, name, 31)
 client_print(0, 3, "--> %s is solid", name)
 */
}
//////////////////////////////////////////////////////////////////////////////////////////////////// 
__________________
Dr.G 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 01:30.


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