This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

To many precaches


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 02-11-2013 , 10:32   To many precaches
Reply With Quote #1

When registering class via native plugin precaches sounds but it does it more times than it should and deletes a first letter.

Child Plugin
PHP Code:
new const r_hunter_pain[ ] = { "pain1.wav""pain2.wav" }

public 
plugin_precache( ) {
    
r_hunterclass swarm_register_zombier_hunter_painsizeofr_hunter_pain ) );    

Include
PHP Code:
native swarm_register_zombie( const pain[ ], amountpain ); 
Main Plugin
PHP Code:
public native_register_zombie( const pain[ ], amountpain ) {
    new 
bufferis100 ];
    for( new 
hi 0hi amountpainhi++ ) {
        
formatexbufferischarsmaxbufferis ), "resident_swarm/zombies/pain/%s"painhi ] );
        
engfuncEngFunc_PrecacheSoundbufferis );
    }

Error output
Code:
Warning:  Unable to open sound/resident_swarm/zombies/pain/pain1.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/ain1.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/in1.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/n1.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/1.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/pain2.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/ain2.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/in2.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/n2.wav for transfer
Warning:  Unable to open sound/resident_swarm/zombies/pain/2.wav for transfer
DoviuX is offline
Send a message via Skype™ to DoviuX
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-11-2013 , 11:07   Re: To many precaches
Reply With Quote #2

const pain[][]
__________________
Arkshine is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 02-11-2013 , 11:11   Re: To many precaches
Reply With Quote #3

Then I get this error in console
Code:
L 02/11/2013 - 18:09:21: [AMXX] Displaying debug trace (plugin "a_resident_swarm.amxx")
L 02/11/2013 - 18:09:21: [AMXX] Run time error 5: memory access 
L 02/11/2013 - 18:09:21: [AMXX]    [0] a_resident_swarm.sma::native_register_zombie (line 457)
L 02/11/2013 - 18:09:21: Unhandled dynamic native error
L 02/11/2013 - 18:09:21: [AMXX] Displaying debug trace (plugin "a_hunter_class.amxx")
L 02/11/2013 - 18:09:21: [AMXX] Run time error 10: native error (native "swarm_register_zombie")
L 02/11/2013 - 18:09:21: [AMXX]    [0] a_hunter_class.sma::plugin_precache (line 31)
line 457:
PHP Code:
formatexbufferischarsmaxbufferis ), "resident_swarm/zombies/pain/%s"painhi ] ); 

Last edited by DoviuX; 02-11-2013 at 11:11.
DoviuX is offline
Send a message via Skype™ to DoviuX
Old 02-11-2013, 15:54
DoviuX
This message has been deleted by DoviuX.
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 02-11-2013 , 15:57   Re: To many precaches
Reply With Quote #4

maybe the number of arrays ( 100 ) ?
TheDS1337 is online now
Old 02-11-2013, 16:02
Unkolix
This message has been deleted by YamiKaitou. Reason: you are not a moderator
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 02-12-2013 , 16:55   Re: To many precaches
Reply With Quote #5

PHP Code:
r_hunterclass swarm_register_zombier_hunter_pain
because sizeof take text length inside of r_hunter_pain

Last edited by .Dare Devil.; 02-12-2013 at 16:56.
.Dare Devil. 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:00.


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