AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem with RS (https://forums.alliedmods.net/showthread.php?t=147547)

hh2 01-10-2011 15:01

Problem with RS
 
Hi, I created me roundsound and i have a problem.
Once you play the sounds, not once, found in the logs error and i use debug.
Info from debug:
Code:

L 01/10/2011 - 5:20:31 p.m.: [AMXX] Displaying debug trace (plugin "roundsound.amxx)
 L 01/10/2011 - 5:20:31 p.m.: [AMXX] Run time error 4: index out of bounds
 L 01/10/2011 - 5:20:31 p.m.: [AMXX] [0] roundsound.sma: plugin_precache (line 38)

Line 38:
Code:

precache_sound (sounds_t [i]);
Fragment code:
PHP Code:

new const sounds_ct [] [] = {
 
"sound/1-10.mp3"
 "sound/2-10.mp3"
 "sound/3-10.mp3"
 "sound/4-10.mp3"
 "sound/5-10.mp3"
 
}

 new const 
sounds_t [] [] = {
 
"sound/6-10.mp3"
 "sound/7-10.mp3"
 "sound/8-10.mp3"
 "sound/9-10.mp3"
 "sound/10-10.mp3"
 
}

 Public 
plugin_precache ()
 {
 new 
iu;

 for (
0<sizeof sounds_ct+ +)
 {
 
precache_generic (sounds_ct [i]);
 
precache_sound (sounds_ct [i]);
 }
 for (
0<sizeof sounds_t+ +)
 {
 
precache_generic (sounds_t [u]);
 
precache_sound (sounds_t [i]);
 }
 } 

Please, help me, if they have any information needed, please write.

lucas_7_94 01-10-2011 15:11

Re: Problem with RS
 
can you post the whole code ?

hh2 01-11-2011 09:28

Re: Problem with RS
 
Is it required?
This code, which i placed, should be sufficient.

Elusive138 01-11-2011 09:59

Re: Problem with RS
 
PHP Code:

sounds_t [i

==>
PHP Code:

sounds_t [u


hh2 01-11-2011 10:21

Re: Problem with RS
 
How i not see single letter.
Very thanks for help.

lucas_7_94 01-11-2011 10:35

Re: Problem with RS
 
Code:
enum _:SOUNDS_WIN {     TERRORIST,     COUNTER } new const szSounds[5][SOUNDS_WIN][] = {     { "sound/1-10.mp3", "sound/6-10.mp3"  },     { "sound/2-10.mp3", "sound/7-10.mp3"  },     { "sound/3-10.mp3", "sound/8-10.mp3"  },     { "sound/4-10.mp3", "sound/9-10.mp3"  },     { "sound/5-10.mp3", "sound/10-10.mp3" } } public plugin_precache() {     for(new i = 0 ; i < sizeof szSounds; i++)     {         precache_sound(szSounds[i][TERRORIST])         precache_sound(szSounds[i][COUNTER])         //server_print("%d %s %s" , i , szSounds[i][TERRORIST], szSounds[i][COUNTER])     } }


All times are GMT -4. The time now is 02:09.

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