Raised This Month: $ Target: $400
 0% 

Fixing Run Time Errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BigMac
Member
Join Date: Jul 2009
Old 06-11-2010 , 23:55   Re: Fixing Run Time Errors
Reply With Quote #1

PHP Code:
/* Formatright © 2009, ConnorMcLeod
 Team SemiClip is free software;
 you can redistribute it and/or modify it under the terms of the
 GNU General Public License as published by the Free Software Foundation.
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with Team SemiClip; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
new const VERSION[] = "0.0.2" // 22jan2010
const MAX_PLAYERS 32
new g_bAlive
#define MarkUserAlive(%1) g_bAlive |= 1<<(%1 & 31)
#define ClearUserAlive(%1) g_bAlive &= ~( 1<<(%1 & 31) )
#define IsAlive(%1)  g_bAlive &  1<<(%1 & 31)
new g_iTeam[MAX_PLAYERS+1]
new const 
g_szTeams[][] = {
 
"",
 
"TERRORIST",
 
"CT",
 
""
}
enum {
 
_T 1,
 
_CT
}
new 
g_iTeamSemiclip _T _CT
public plugin_init()
{
 
register_plugin("Team SemiClip"VERSION"ConnorMcLeod")
 
RegisterHam(Ham_Spawn"player""Ham_CBasePlayer_Spawn_Post"1)
 
RegisterHam(Ham_Killed"player""Ham_CBasePlayer_Killed_Post"1)
 
 
register_forward(FM_AddToFullPack"FM_client_AddToFullPack_Post"1)
 
RegisterHam(Ham_Player_PreThink"player""Ham_CBasePlayer_PreThink_Post"1)
 
register_concmd("team_semiclip""ConsoleCommand_TeamSemiclip"ADMIN_CFG)
}
public 
ConsoleCommand_TeamSemiclipid level cid )
{
 if( 
cmd_access(idlevelcid2) )
 {
  new 
szArg[2]
  
read_argv(1szArgcharsmax(szArg))
  
g_iTeamSemiclip clamp(str_to_num(szArg), 03)
 }
 return 
PLUGIN_HANDLED
}
public 
client_putinserverid )
{
 
ClearUserAlive(id)
}
public 
client_disconnectid )
{
 
ClearUserAlive(id)
}
public 
Ham_CBasePlayer_Spawn_Postid )
{
 if( 
is_user_alive(id) )
 {
  
MarkUserAlive(id)
  const 
XTRA_OFS_PLAYER 5
  
const m_iTeam 114
  g_iTeam
[id] = get_pdata_int(idm_iTeamXTRA_OFS_PLAYER)
 }
 else
 {
  
ClearUserAlive(id)
 }
}
public 
Ham_CBasePlayer_Killed_Postid )
{
 if( 
is_user_alive(id) )
 {
  
MarkUserAlive(id)
 }
 else
 {
  
ClearUserAlive(id)
 }
}
public 
FM_client_AddToFullPack_Post(eseiEntidhostflagsplayerpSet)
{
 if( 
player
 
&& id != iEnt
 
&& IsAlive(id)
 && 
g_iTeamSemiclip g_iTeam[id]
 && 
IsAlive(iEnt)
 && 
g_iTeam[id] == g_iTeam[iEnt]
 && 
get_orig_retval() )
 {
  
set_es(esES_SolidSOLID_NOT)
  
set_es(esES_RenderModekRenderTransAlpha)
  
set_es(esES_RenderAmt250)
 }
}
public 
Ham_CBasePlayer_PreThink_Post(id)
{
 if( 
IsAlive(id) == || !(g_iTeamSemiclip g_iTeam[id]) )
 {
  return
 }
 new 
iPlayers[MAX_PLAYERS], iNumiPlayer
 get_players
(iPlayersiNum"ae"g_szTeams[g_iTeam[id]])
 for(new 
ii<iNumi++)
 {
  
iPlayer iPlayers[i]
  if( 
id != iPlayer )
  {
   
entity_set_int(iPlayerEV_INT_solidSOLID_NOT)
  }
 }
}
public 
client_PostThink(id)
{
 if( 
IsAlive(id) == || !(g_iTeamSemiclip g_iTeam[id]) )
 {
  return
 }
 new 
iPlayers[MAX_PLAYERS], iNumiPlayer
 get_players
(iPlayersiNum"ae"g_szTeams[g_iTeam[id]])
 for(new 
ii<iNumi++)
 {
  
iPlayer iPlayers[i]
  if( 
id != iPlayer )
  {
   
entity_set_int(iPlayerEV_INT_solidSOLID_SLIDEBOX)
  }
 }

Sorry here you go
__________________
BigMac 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:55.


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