Raised This Month: $51 Target: $400
 12% 

Solved Console Keeps Saying Index Out of Bounds


Post New Thread Reply   
 
Thread Tools Display Modes
asdian
Member
Join Date: Sep 2016
Location: Indonesia
Old 02-09-2023 , 19:26   Re: Console Keeps Saying Index Out of Bounds
Reply With Quote #11

Quote:
Originally Posted by jimaway View Post
Code:
id = pev(ent, pev_owner) if (!is_user_connected(id))     return
this somehow fixes the issue. from what i understand this "index" is referring to owner and the issue is that isn't checked wether owner is valid or not
asdian is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 02-10-2023 , 12:37   Re: Console Keeps Saying Index Out of Bounds
Reply With Quote #12

Why not use the offset m_pPlayer(41)? If you check by the owner of the gun it's gonna be inefficient in some cases.. unless you take care of that and also i always have this macro to check if the player is valid:
PHP Code:
#define IsPlayer(%0) ((0 < %0 < 33) && is_user_connected(%0)) 
To be more specific, you'd have to change the owner at AddItemToPlayer everytime to prevent that

Last edited by AnimalMonster; 02-10-2023 at 12:40.
AnimalMonster is offline
asdian
Member
Join Date: Sep 2016
Location: Indonesia
Old 02-11-2023 , 09:46   Re: Console Keeps Saying Index Out of Bounds
Reply With Quote #13

Quote:
Originally Posted by AnimalMonster View Post
Why not use the offset m_pPlayer(41)? If you check by the owner of the gun it's gonna be inefficient in some cases.. unless you take care of that and also i always have this macro to check if the player is valid:
PHP Code:
#define IsPlayer(%0) ((0 < %0 < 33) && is_user_connected(%0)) 
To be more specific, you'd have to change the owner at AddItemToPlayer everytime to prevent that
since i'm making plugins not for online, i think that's enough. thanks anyway
asdian 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 22:28.


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