Zombie Panic! Source

Zombie Panic! Source

View Stats:
plugins no longer work after the last update!
Previously, there were plugins on my server reproducing the kill sounds, similar to quakesounds, after the update they stopped working, as well as quakesounds itself, I note that in other games these plugins work fine.

According to the creators of the plugins themselves, they say the same thing that the developers seem to intentionally kill the Sourcemod, everything should work, but even catching events does not help in this decision!

and yes, the plugins supposedly still work, even the sounds are downloaded from the server, and they can be played using the sm_play command, but nothing works through the plugin itself, not the kill sounds, not to saysounds, not the quakesounds
< >
Showing 1-15 of 16 comments
Jan 25, 2022 @ 8:53pm 
During the port to SDK2013 and in each game update, the authors of those plugins must update them coordinately. Both Sourcemod and Metamod have been updated to support the latest public build. We, as developers, have nothing to do with third-party plugins made by the community - they will eventually break in any future patch. This can happen in any game and the community must be the ones to update with the changes (hooks, funcs etc).

We've done everything we can in the past to contact the Sourcemod team to keep them informed about these changes. Community plugins is another history since the original author must keep their project up to dated. You can find a detailed post here.
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.
Originally posted by Patrick:
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.

I have a plugin, and one person helped me with it on alliedmods, it worked, just a new event appeared in the plugin that is not even in the list of zombie panic source events on wikipedia for help, there is only a hook player_death, and the person who helped me, there was player_feed in his line, and it saved me, the plugin now works, but now there are errors like invalid sample rate (0) and that the file is missing on the server, but I'm still working on it, you can add me to friends that I would have thrown you a complete example of the plugin.
Originally posted by Пошлый Винни:
Originally posted by Patrick:
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.

I have a plugin, and one person helped me with it on alliedmods, it worked, just a new event appeared in the plugin that is not even in the list of zombie panic source events on wikipedia for help, there is only a hook player_death, and the person who helped me, there was player_feed in his line, and it saved me, the plugin now works, but now there are errors like invalid sample rate (0) and that the file is missing on the server, but I'm still working on it, you can add me to friends that I would have thrown you a complete example of the plugin.

If you're coming from an older server version I'd do a fresh install along with latest SourceMod/MetaMod if you haven't already.

player_death doesn't seem to work so I use this instead:

HookEvent("player_hurt", Event_PlayerHurt, EventHookMode_Pre);

public Action:Event_PlayerHurt(Handle:event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(GetEventInt (event, "userid", 0)); if(GetEventInt(event, "health", 0) <= 0) { PrintToServer("%d is dead", client); } }

Edit: You may wish to join the ZPS discord as there is a lot of helpful info on there regarding SM etc.
Originally posted by Patrick:
Originally posted by Пошлый Винни:

I have a plugin, and one person helped me with it on alliedmods, it worked, just a new event appeared in the plugin that is not even in the list of zombie panic source events on wikipedia for help, there is only a hook player_death, and the person who helped me, there was player_feed in his line, and it saved me, the plugin now works, but now there are errors like invalid sample rate (0) and that the file is missing on the server, but I'm still working on it, you can add me to friends that I would have thrown you a complete example of the plugin.

If you're coming from an older server version I'd do a fresh install along with latest SourceMod/MetaMod if you haven't already.

player_death doesn't seem to work so I use this instead:

HookEvent("player_hurt", Event_PlayerHurt, EventHookMode_Pre);

public Action:Event_PlayerHurt(Handle:event, const char[] name, bool dontBroadcast) { int client = GetClientOfUserId(GetEventInt (event, "userid", 0)); if(GetEventInt(event, "health", 0) <= 0) { PrintToServer("%d is dead", client); } }

Edit: You may wish to join the ZPS discord as there is a lot of helpful info on there regarding SM etc.


I have a plugin with the sound of murder, but it still gives the invalid sample rate error, the sounds are on the server and downloaded, I rewrote the plugin, changed the frequency of the sound, changed the folder names, changed the file names until nothing helps, I'll throw the plugin below

#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
name = "carrierz Kill Sound",
version = "1.0",
}

public OnPluginStart()
{
HookEvent("player_feed", Death);
}

public OnMapStart()
{
AddFileToDownloadsTable("sound/custom/cookie_carrierzz.mp3");
AddToStringTable(FindStringTable("soundprecache"), "cookie_carrierzz.mp3");
}


public Death(Handle:event, const String:name[], bool:dontBroadcast)
{
decl String:str[32];
GetEventString(event, "weapon", str, sizeof(str));
if(strcmp(str, "carrierarms", true) == 0)
{
decl clients[MaxClients];
new total = 0;

for (new i=1; i<=MaxClients; i++)
{
if (IsClientInGame(i))
{
clients[total++] = i;
}
}
EmitSound(clients, total, "cookie_carrierzz.mp3");
}
}
Originally posted by Пошлый Винни:
I have a plugin with the sound of murder, but it still gives the invalid sample rate error, the sounds are on the server and downloaded, I rewrote the plugin, changed the frequency of the sound, changed the folder names, changed the file names until nothing helps, I'll throw the plugin below

Invalid sample rate generally occurs if the sound file itself is not correctly formatted for use in the engine. Your sound file must be 44100 GHz in order to play correctly in the engine. For non-looping sounds, .mp3 or .wav will work, but for looping sounds, only .wav files will work. So if you are still having trouble with your .mp3 file, try converting it to a .wav file instead and see if that fixes it and make sure the file has been converted to 44100 GHz sample rate. It sounds like the event you were hooking was correct and the sound was attempting to play, but when you play the file, it simply stops working due to not being the right sample rate for the engine. That or maybe the file isn't being cached properly?

Originally posted by Patrick:
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.

When did the hooks for these events stop working? Last I checked (which was sometime in late 2020) player_death was a working hook event, so it should still work unless the gamedata is incorrect or the function is missing for some reason. Also, are you and the OP referring to ZPS 2.4 or ZPS 3.1?
Originally posted by Silence:
Originally posted by Пошлый Винни:
I have a plugin with the sound of murder, but it still gives the invalid sample rate error, the sounds are on the server and downloaded, I rewrote the plugin, changed the frequency of the sound, changed the folder names, changed the file names until nothing helps, I'll throw the plugin below

Invalid sample rate generally occurs if the sound file itself is not correctly formatted for use in the engine. Your sound file must be 44100 GHz in order to play correctly in the engine. For non-looping sounds, .mp3 or .wav will work, but for looping sounds, only .wav files will work. So if you are still having trouble with your .mp3 file, try converting it to a .wav file instead and see if that fixes it and make sure the file has been converted to 44100 GHz sample rate. It sounds like the event you were hooking was correct and the sound was attempting to play, but when you play the file, it simply stops working due to not being the right sample rate for the engine. That or maybe the file isn't being cached properly?

Originally posted by Patrick:
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.

When did the hooks for these events stop working? Last I checked (which was sometime in late 2020) player_death was a working hook event, so it should still work unless the gamedata is incorrect or the function is missing for some reason. Also, are you and the OP referring to ZPS 2.4 or ZPS 3.1?

Silence,
the sound itself is played through the sm_play @all with admin command, and the error is an Invalid sampling rate (0), but now there is another error sv_starsound "sound name" is not pre-cached (numbers) previously, the plugin worked with the player_death event, now it works only with player_feed and this is only thanks to the person who helped me with this, despite the fact that the player_feed event is not in the zps at all, from where they are taken, it is not clear to me yet, but with the player_feed event, the plugin at least gives an error, and player_death does not cause anything at all in the game console writes who killed whom with what weapon, and the server console is empty, there is only information about the connected players, although this was not the case before the updates

if you look at my plugin, you will understand that I am trying to catch an event when a player kills another player in order to reproduce the sound, in the specific case with carrierarms, one person yesterday threw me his plugin that reproduces the sound when killing with a grenade and it works, but how to do it with other weapons we are still figuring out.

the same goes for the quakesounds plugin, it may also be rewritten for a new version, but I don't know anything about it

also, the downloaded sounds are played from the game menu even without being on the server through the command "play "custom/custom_explode.mp3" and they can be heard, so the problem is definitely not in the rates, but as if the game itself forbids playing sound
I got help on alliedmodders, the problem is solved. :steamhappy:
Gonna drop my two cents here, because why not.
Nice to see that you found a solution, btw.

Originally posted by Пошлый Винни:
EmitSound(clients, total, "cookie_carrierzz.mp3");
This right here was the reason why sound didn't play, normally when using the "EmitSound" you must include a full path to your sound file, not just a name
(in this case it's "sound/custom/cookie_carrierzz.mp3"),
otherwise the game will attempt to find and play sound in "../zps/sound/cookie_carrerzz.mp3",
not in "../zps/sound/custom/cookie_carrierzz.mp3".

Even on SourceMod wiki it says that you must link a file "relative to sound folder"

"Invalid sampling rate (0)" error means that the file simply does not exist.
Originally posted by Пошлый Винни:
I got help on alliedmodders, the problem is solved. :steamhappy:

I'm glad you found a solution to your problem. You should probably share what the solution was so that others who are having a similar problem like you did know what to do next time, though that is up to you. Either way, good luck with your plugins/server!

Originally posted by Reborn:
"Invalid sampling rate (0)" error means that the file simply does not exist.

Its so obvious that I'm disappointed I missed this... I was too pre-occupied by SM being "broken" and looking up/comparing offsets that I didn't pay attention to this specific error. Glad someone caught that.
Originally posted by Silence:
Originally posted by Patrick:
A lot of the SourceMod event hooks for ZPS don't work anymore so you will need use alternatives, if you list the ones you're using I might be able to help.

When did the hooks for these events stop working? Last I checked (which was sometime in late 2020) player_death was a working hook event, so it should still work unless the gamedata is incorrect or the function is missing for some reason. Also, are you and the OP referring to ZPS 2.4 or ZPS 3.1?

3.1

Just off the top of my head, player_death, angelscript_callevent, round_begin, round_win, game_round_restart and ambient_as don't work anymore, either giving an error or just simply not called by ZPS.

For anyone needing alternatives to those commands here are a few workarounds:

player_death = use player_hurt pre-hook and check for 0 health after damage.
round_ = use clientsound hook and check if sound string string contains Round_Starting, Round_End, Round_End.Human, Round_End.Zombie, Round_End.Stalemate, match begins ~10s after Round_Starting sound.

I don't know if this works for all functions but using the linux server server_srv.so file to find virtual offsets I think most of the ZPS angelscript API can be accessed but I've only tried the ones the devs said they made virtual, no idea if the ones not listed will work, the game.zpanic.txt needs an update though.
Originally posted by Patrick:
Originally posted by Silence:


When did the hooks for these events stop working? Last I checked (which was sometime in late 2020) player_death was a working hook event, so it should still work unless the gamedata is incorrect or the function is missing for some reason. Also, are you and the OP referring to ZPS 2.4 or ZPS 3.1?

3.1

Just off the top of my head, player_death, angelscript_callevent, round_begin, round_win, game_round_restart and ambient_as don't work anymore, either giving an error or just simply not called by ZPS.

For anyone needing alternatives to those commands here are a few workarounds:

player_death = use player_hurt pre-hook and check for 0 health after damage.
round_ = use clientsound hook and check if sound string string contains Round_Starting, Round_End, Round_End.Human, Round_End.Zombie, Round_End.Stalemate, match begins ~10s after Round_Starting sound.

I don't know if this works for all functions but using the linux server server_srv.so file to find virtual offsets I think most of the ZPS angelscript API can be accessed but I've only tried the ones the devs said they made virtual, no idea if the ones not listed will work, the game.zpanic.txt needs an update though.

the player_death event no longer works with sounds in the zps and causes errors, however, with the player_feed event, which is not even on wikipedia, for some reason it works, personally, this is the only thing that helped me

round_start and joining the game as events also no longer work in the game, and cause the same errors invalid sample rate, or not precached (xxxx nubmers xxxx) just something changed and the creators of the plugins had to rewrite everything from scratch, it can even be noticed from the sp files if you open them through source pawn
Originally posted by Patrick:
3.1

Just off the top of my head, player_death, angelscript_callevent, round_begin, round_win, game_round_restart and ambient_as don't work anymore, either giving an error or just simply not called by ZPS.

For anyone needing alternatives to those commands here are a few workarounds:

player_death = use player_hurt pre-hook and check for 0 health after damage.
round_ = use clientsound hook and check if sound string string contains Round_Starting, Round_End, Round_End.Human, Round_End.Zombie, Round_End.Stalemate, match begins ~10s after Round_Starting sound.

I don't know if this works for all functions but using the linux server server_srv.so file to find virtual offsets I think most of the ZPS angelscript API can be accessed but I've only tried the ones the devs said they made virtual, no idea if the ones not listed will work, the game.zpanic.txt needs an update though.

I looked over the gamedata on the latest versions of Sourcemod for ZPS and compared the information with the vtables from the latest version of the server_srv.so file that I get from ZPS SteamDB[steamdb.info] and so far I have not found any difference between the gamedata offsets for sdktools and sdkhooks that were uploaded and what I found via the vtable dumper. With that said, there is the possibility that the Windows offsets are wrong/off despite the best effort of the automated tool, so its very possible a number of functions for sdktools and sdkhooks simply do not work on windows and need to be found manually (this can sometimes happen with offsets as some of them might be off by 1 or 2 due to various new or changed functions specific to windows).

With that said, player_death is a common event to many source games and is not explicitly listed in either of the game.zpanic.txt gamedata files for sdktools and sdkhooks. Its very possible that player_death is just broken or it functions/behaves differently than before, which might be the case assuming the offsets/signatures for windows are incorrect. Unfortunately, I do not have a setup for testing ZPS server stuff anymore, so I cannot verify anything at this time. If I have time later, I'll see about checking out the gamedata again to see if it works, but I make no promises as I don't have as much time as I used to.

Regardless, if you or someone else knows that the offsets are wrong and have a working/updated set of offsets for both Windows and Linux versions of ZPS, I would encourage the sharing of that information with Sourcemod via merge request on Github, if possible. This can only help the rest of the ZPS community who either run servers or wish to run servers in the future since knowledge about offsets/signatures is not as commonplace as it once was, so most people won't know why something like Sourcemod doesn't work out of the box.
I've updated https://wiki.alliedmods.net/Zombie_Panic!_Source_Events with the latest info I found in modevents.res Should be bit more helpful for Plugin Devs.

If you take a look inside the mentioned file you will notice some events which are not listed there that is because they are no longer called by the game so I left them out as there is no point in listing something which will never be called in the first place.
Originally posted by XeroX:
I've updated https://wiki.alliedmods.net/Zombie_Panic!_Source_Events with the latest info I found in modevents.res Should be bit more helpful for Plugin Devs.

If you take a look inside the mentioned file you will notice some events which are not listed there that is because they are no longer called by the game so I left them out as there is no point in listing something which will never be called in the first place.

Thank you, that's what I meant, there were no such events on Wikipedia.
< >
Showing 1-15 of 16 comments
Per page: 1530 50