Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VU_SoundDelete doesnt Deallocates sound #10

Open
Limbooc opened this issue Apr 3, 2022 · 0 comments
Open

VU_SoundDelete doesnt Deallocates sound #10

Limbooc opened this issue Apr 3, 2022 · 0 comments

Comments

@Limbooc
Copy link

Limbooc commented Apr 3, 2022

VU_SoundDelete does not clear memory when changing the map, and when changing the map, the index is added

`
#include
#include
#include

new VU_Sound:szSound

new const szBuffer[] = "adrenalin.wav"

public plugin_init()
{

register_clcmd("say /voice", "func_voice")
register_clcmd("say /stop", "func_stop")

new s_File_tmpPath[512];
formatex(s_File_tmpPath, charsmax(s_File_tmpPath),"addons/amxmodx/data/revoice_plus_sound/%s",szBuffer)
if(file_exists(s_File_tmpPath))
{
	new VU_Sound:soundId = VU_SoundCreateFromFile(s_File_tmpPath);
	log_amx("Load %s = %i", s_File_tmpPath,soundId)
	szSound = soundId;
}

}

public plugin_end()
{
VU_SoundDelete(szSound)
log_amx("VU_SoundDelete = %i", szSound)
}

public func_voice(id)
{
VU_SoundPlay(0, id, szSound);
log_amx("%d", szSound);
}

public func_stop(id)
{

}

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant