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

Runtime error 4: index out of bounds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-04-2020 , 16:35   Runtime error 4: index out of bounds
Reply With Quote #1

I am getting runtime error 4 on this simple part of code.
Can anyone help me to fix it ?
Code:
// Current Weapon info
public message_cur_weapon(id)
{
	// Not alive or zombie
	if (!g_isalive[id] || g_zombie[id])
		return;
	
	if (g_sniper[id])
		return;
	
	if (b_uAmmo[id])
	{
		//set_pdata_int(get_pdata_cbase(id, 373), 51, 100, 4)
		
		// HUD should show full clip all the time
		set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon])
	}
}
Error on this line : if (!g_isalive[id] || g_zombie[id])
Abhinash is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-04-2020 , 16:58   Re: Runtime error 4: index out of bounds
Reply With Quote #2

Show how the variables are defined.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 08-04-2020 , 18:41   Re: Runtime error 4: index out of bounds
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
Show how the variables are defined.
Every variable defined with value 33.
But, I fixed it.
Actually, the message function was not working without 3 variables, i.e. msg_id, msg_dest, msg_ent.

I wonder, what the difference between CurWeapon event vs CurWeapon message
Abhinash 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:24.


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