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:42   Fixing Run Time Errors
Reply With Quote #1

HTML Code:
[AMXX][0] team_semiclip.sma::client_PostThink (line 156)
[AMXX] Displaying debug trace (plugin "semiclip.amxx")
[AMXX] Run time error 4: index out of bounds 
[AMXX][0] team_semiclip.sma::Ham_CBasePlayer_PreThink_Post (line 136)
[AMXX] Displaying debug trace (plugin "semiclip.amxx")
[AMXX] Run time error 4: index out of bounds 
PHP Code:
#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)
  }
 }

Thanks
__________________
BigMac is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-11-2010 , 23:50   Re: Fixing Run Time Errors
Reply With Quote #2

Did you change something before these errors happened? BTW, The code you posted is only 125 lines long so those line numbers don't help much at all.
__________________
fysiks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-11-2010 , 23:57   Re: Fixing Run Time Errors
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Did you change something before these errors happened?
It was written by Connor so at one point it worked.

Quote:
Originally Posted by fysiks View Post
BTW, The code you posted is only 125 138 lines long so those line numbers don't help much at all.
__________________

Last edited by fysiks; 06-12-2010 at 00:00.
fysiks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2010 , 00:22   Re: Fixing Run Time Errors
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Did you change something before these errors happened?
Why do you keep ignoring my question??????

You changed three things. Two of which should never be touched (g_szTeams, m_iTeam).
__________________
fysiks is offline
BigMac
Member
Join Date: Jul 2009
Old 06-11-2010 , 23:55   Re: Fixing Run Time Errors
Reply With Quote #5

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
BigMac
Member
Join Date: Jul 2009
Old 06-12-2010 , 00:02   Re: Fixing Run Time Errors
Reply With Quote #6

/* 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_TeamSemiclip( id , level , cid )
{
if( cmd_access(id, level, cid, 2) )
{
new szArg[2]
read_argv(1, szArg, charsmax(szArg))
g_iTeamSemiclip = clamp(str_to_num(szArg), 0, 3)
}
return PLUGIN_HANDLED
}
public client_putinserver( id )
{
ClearUserAlive(id)
}
public client_disconnect( id )
{
ClearUserAlive(id)
}
public Ham_CBasePlayer_Spawn_Post( id )
{
if( is_user_alive(id) )
{
MarkUserAlive(id)
const XTRA_OFS_PLAYER = 5
const m_iTeam = 114
g_iTeam[id] = get_pdata_int(id, m_iTeam, XTRA_OFS_PLAYER)
}
else
{
ClearUserAlive(id)
}
}
public Ham_CBasePlayer_Killed_Post( id )
{
if( is_user_alive(id) )
{
MarkUserAlive(id)
}
else
{
ClearUserAlive(id)
}
}
public FM_client_AddToFullPack_Post(es, e, iEnt, id, hostflags, player, pSet)
{
if( player
&& id != iEnt
&& IsAlive(id)
&& g_iTeamSemiclip & g_iTeam[id]
&& IsAlive(iEnt)
&& g_iTeam[id] == g_iTeam[iEnt]
&& get_orig_retval() )
{
set_es(es, ES_Solid, SOLID_NOT)
set_es(es, ES_RenderMode, kRenderTransAlpha)
set_es(es, ES_RenderAmt, 250)
}
}
public Ham_CBasePlayer_PreThink_Post(id)
{
if( IsAlive(id) == 0 || !(g_iTeamSemiclip & g_iTeam[id]) )
{
return
}
new iPlayers[MAX_PLAYERS], iNum, iPlayer <---- Line 136
get_players(iPlayers, iNum, "ae", g_szTeams[g_iTeam[id]])
for(new i; i<iNum; i++)
{
iPlayer = iPlayers[i]
if( id != iPlayer )
{
entity_set_int(iPlayer, EV_INT_solid, SOLID_NOT)
}
}
}
public client_PostThink(id)
{
if( IsAlive(id) == 0 || !(g_iTeamSemiclip & g_iTeam[id]) )
{
return
}
new iPlayers[MAX_PLAYERS], iNum, iPlayer LINE <--- 156
get_players(iPlayers, iNum, "ae", g_szTeams[g_iTeam[id]])
for(new i; i<iNum; i++)
{
iPlayer = iPlayers[i]
if( id != iPlayer )
{
entity_set_int(iPlayer, EV_INT_solid, SOLID_SLIDEBOX)
}
}
}
__________________
BigMac is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-12-2010 , 00:07   Re: Fixing Run Time Errors
Reply With Quote #7

Are you going to answer my freaking question?

Quote:
Originally Posted by BigMac View Post
Code:
new iPlayers[MAX_PLAYERS], iNum, iPlayer <---- Line 136 
new iPlayers[MAX_PLAYERS], iNum, iPlayer LINE <--- 156
Nope, not possible, try again.
__________________
fysiks is offline
BigMac
Member
Join Date: Jul 2009
Old 06-12-2010 , 00:07   Re: Fixing Run Time Errors
Reply With Quote #8

Heres the sma i think the lines got mess up when posting
Attached Files
File Type: sma Get Plugin or Get Source (team_semiclip.sma - 751 views - 3.5 KB)
__________________
BigMac is offline
BigMac
Member
Join Date: Jul 2009
Old 06-12-2010 , 00:10   Re: Fixing Run Time Errors
Reply With Quote #9

Yea i got the plugin from here

http://forums.alliedmods.net/showthr...t=69728&page=8


And sorry it was this line

get_players(iPlayers, iNum, "ae", g_szTeams[g_iTeam[id]]) <------- both of them

O and btw Thanks for the fast repiles Sorry my English isnt perfect
__________________

Last edited by BigMac; 06-12-2010 at 00:21.
BigMac is offline
BigMac
Member
Join Date: Jul 2009
Old 06-12-2010 , 00:27   Re: Fixing Run Time Errors
Reply With Quote #10

Nothing i run it like it was before i change anything and still got them Now i just want to fix it
__________________
BigMac is offline
Reply


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 14:55.


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