Raised This Month: $32 Target: $400
 8% 

Solved Out-of-bound array index


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 07-19-2019 , 04:16   Out-of-bound array index
Reply With Quote #1

Hello,

I have a problem with this code. Sometimes I get more than one iTarget[client] value or get a different number which causes an error:
PHP Code:
:TimerHud
L 07
/19/2019 10:00:00: [SMException reportedOut-of-bound array index (index 303limit 66); (Line 47
#Line 47
PHP Code:
GetEntPropVector (iTarget [client], Prop_Data"m_vecAbsVelocity"fClient[iTarget[client]]); 
Thanks for answers.
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!

Last edited by Fastmancz; 07-19-2019 at 06:14.
Fastmancz is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 07-19-2019 , 04:47   Re: [CS:GO] The value of m_hObserverTarget does'n work
Reply With Quote #2

It means that fClient[iTarget[client]] is out of bounds of array. So you just need to check this before line 47.
PHP Code:
if(iTarget[client]>MaxClients || iTarget[client] <= 0)
{
    return;

__________________
impossible_cc is offline
Fastmancz
Senior Member
Join Date: Jul 2013
Location: Czech Republic
Old 07-19-2019 , 06:14   Re: Out-of-bound array index
Reply With Quote #3

Thanks!
__________________


Main owner of the CMGPORTAL.CZ.
---------------------------------------
My plugins:
[CS:GO] Panorama - Timeleft
[CS:GO] JailBreak - Be quiet, please!
Fastmancz 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 23:01.


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