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

index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 05-14-2019 , 05:11   index out of bounds
Reply With Quote #1

How can fix this error?

L 05/14/2019 - 11:57:59: [AMXX] Displaying debug trace (plugin "rush.amxx", version "1.0")
L 05/14/2019 - 11:57:59: [AMXX] Run time error 4: index out of bounds
L 05/14/2019 - 11:57:59: [AMXX] [0] text6LXJvq.sma::TakeDMG (line 366)

Code:
public hamTouchWeapon(id)
{
	return 4;
}
public TakeDMG(victim, idinflictor, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
{
	if (victim != attacker)
	{
		if (in_Duel[victim] && !in_Duel[attacker])

		{ 

			return 4; // This Line 

		}
	}
	return 1;
}

Last edited by Saint Sinner; 05-14-2019 at 05:19.
Saint Sinner is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-14-2019 , 05:34   Re: index out of bounds
Reply With Quote #2

You should check if players are connected


EDIT: Return 4; of?

Last edited by Fuck For Fun; 05-14-2019 at 12:15.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Saint Sinner
Senior Member
Join Date: Feb 2016
Old 05-14-2019 , 05:45   Re: index out of bounds
Reply With Quote #3

I added this one but still have error

Code:
if (victim == attacker || !is_user_alive(attacker) )
Saint Sinner is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-14-2019 , 12:21   Re: index out of bounds
Reply With Quote #4

why did you change == to != from your code above ?
use &&, otherwise it only checks the first one which is pretty much always true
__________________
<VeCo> 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 01:17.


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