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

Solved Index out


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-09-2019 , 14:01   Index out
Reply With Quote #1

Run time error 4: index out of bounds
Code:
new sounds[][] = 
{
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3",
	"Gas/XXX.mp3"
}
Code:
public plugin_precache()
{
	for( new i = 0; i <= 9; i++ )
		precache_sound( sounds[i] )
}
or should i use:
Quote:
for ( new i = 0 ; i < charsmax( sounds ) ; i++ )

Last edited by Fuck For Fun; 05-09-2019 at 16:55.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-09-2019 , 14:23   Re: Index out
Reply With Quote #2

i < sizeof(sounds)
__________________

Last edited by OciXCrom; 05-09-2019 at 14:23.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-09-2019 , 16:54   Re: Index out
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
i < sizeof(sounds)
thanks you.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
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 15:59.


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