Raised This Month: $ Target: $400
 0% 

Run time error 4 (Done)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-30-2013 , 18:02   Re: Run time error 4
Reply With Quote #1

Quote:
Originally Posted by YamiKaitou View Post
Well, make g_Knife larger
new g_Knife[33]

What value should i put then?
__________________
Jhob94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2013 , 18:15   Re: Run time error 4
Reply With Quote #2

Quote:
Originally Posted by Jhob94 View Post
new g_Knife[33]

What value should i put then?
Increasing it is a solution but is likely not the right solution (for it to be "complete" this way you would need to make it the same size as the number of entities that the game can load). It usually happens when an entity is doing the damage where that entity has some entity number greater than 32. Most people that come across this problem just need to filter those entities out.
__________________
fysiks is online now
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-30-2013 , 18:36   Re: Run time error 4
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
Most people that come across this problem just need to filter those entities out.
How?
__________________
Jhob94 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2013 , 19:50   Re: Run time error 4
Reply With Quote #4

Quote:
Originally Posted by Jhob94 View Post
How?
The same way you do it for anything else. Check if it's a value that you want, if not, don't run the code.

Also, this is an extremely common question here so you can find many threads that talk about it.
__________________

Last edited by fysiks; 10-30-2013 at 19:51.
fysiks is online now
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-31-2013 , 01:43   Re: Run time error 4
Reply With Quote #5

Your code is fine, can't throw a bound error on g_Knife[attacker] if g_Knife size is 33 and if you check is_user_connected(attacker) first.
I'm pretty sure the error is somewhere else or that you think you are using that code but you are wrong.

Since you can't give us the exact line it is extremly difficult to say.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:19.


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