Problem with playing Sound + StrContains doesn't works
Hello, this is my first time scripting for SourceMod.
I tried to make a joinsound for everyone, so I put my wav into sound/servername/ on the Server and on the Fastdownload in the same. Then here is the plugin: PHP Code:
I fixed it with this PrecacheSound Command, but now it dont play the Sound after joining and it dont show any errors. Please help me, if you can :D So here is my second problem: i check with StrContains if my Steamid exists in another String, that i read from a file. I printed the data of the file and my steamid to the server and my steamid was in the String like that: file: steamid;1;1;1;1 auth: steamid So StrContains should go on to the following commands, but it stops at StrContains..i dont know, why. Please help me :D Thanks and bye, n00bfilter. |
Re: Problem with playing Sound
OnClientPutInServer is ran before you're done Sending Info.
Try putting a timer there instead of playing the sound. Set the timer to 3 seconds, then play the sound. It should work then. |
Re: Problem with playing Sound + StrContains doesn't works
Okay, i'll try it. Can you look at my other problem, while I'm testing?
I edited it to the first post :D Thanks. Is is correct like this: PHP Code:
Okay the timer works, but it don't play the sound. :/ No error message. Why i know the timer works, but not the sound? I printed Test to the Server. Test was printend, sound wasnt played. :/ Please help me, for me it looks correct, so it must work :S |
Re: Problem with playing Sound + StrContains doesn't works
Hook the player_spawn event and check if the player is NOT alive. In that case, their view camera was just spawned, and they can see the map.
|
Re: Problem with playing Sound + StrContains doesn't works
Hello, i hooked the event like this:
PHP Code:
"n00bfilter<2><STEAM_0:0:14636098><Unassigned >" joined team "CT" test Also can you please look at my problem above? I'll post it here again: i check with StrContains if my Steamid exists in another String, that i read from a file. I printed the data of the file and my steamid to the server and my steamid was in the String like that: file: steamid;1;1;1;1 auth: steamid So StrContains should go on to the following commands, but it stops at StrContains..i dont know, why. Please help me :D Code: PHP Code:
|
Re: Problem with playing Sound + StrContains doesn't works
StrContaing retrun notes:
Code:
-1 on failure (no match found). Any other value indicates a position in the string where the match starts. PHP Code:
PHP Code:
|
Re: Problem with playing Sound + StrContains doesn't works
Okay, works. Thank you. Can you look at this sound-problem, too? :D
Thanks for StrContains. :P |
Re: Problem with playing Sound + StrContains doesn't works
Maybe your sound isn't set up right to work with half life 2? Try going to the HLSW website, and look up how to convert .wav files.
|
Re: Problem with playing Sound + StrContains doesn't works
Precache the sound during OnMapStart()
|
Re: Problem with playing Sound + StrContains doesn't works
The sound have to work for HL2, because it works at HLDJ.
It doesnt work like you said. This is what i have now: PHP Code:
|
Re: Problem with playing Sound + StrContains doesn't works
give us this zielen.wav
|
Re: Problem with playing Sound + StrContains doesn't works
Easy way of checking if the file is correct or not:
if(PrecacheSound("fairfailt/zielen.wav")) PrintToChatAll("Precached"); |
Re: Problem with playing Sound + StrContains doesn't works
Oh derp. Do your client's have the sound too?
|
Re: Problem with playing Sound + StrContains doesn't works
Idk. It should be. I put in in the fastDL: sound/zielen.wav.bz2
and i put it in the server: sound/zielen.wav How to get them download this? |
Re: Problem with playing Sound + StrContains doesn't works
stock AddFileToDownloadsTable(const String:filename[])
|
Re: Problem with playing Sound + StrContains doesn't works
Make sure you have it in your own sound folder, then test it again.
|
Re: Problem with playing Sound + StrContains doesn't works
Okay, thanks. It is downloading now, thanks DarkEnergy.
But i cant play it: when it should be played, this is displayed in the client console: (Soundpath etc.), file probably missing from disk/repository I am not good in english, but I think, i know what it tells me. But on client and server the sound exists. |
Re: Problem with playing Sound + StrContains doesn't works
that happens alot even though both the server and the client have the sound files (its client side). the only thing you can do is restarting ur client or try to reinstall your client
|
Re: Problem with playing Sound + StrContains doesn't works
So I should reinstall my Counter-Strike Source? Because restarting, is what I've done the last day again and again. Doesn't change anything. So i reinstall. Hm, okay..:/
|
Re: Problem with playing Sound + StrContains doesn't works
Okay, i reinstalled my CSS, but now its on every spawn.
What event is the team selection display? Can i get an event there? |
Re: Problem with playing Sound + StrContains doesn't works
remember this?
public OnClientPutInServer(client) { CreateTimer(3.0,ExecJoinsound) } public Action:ExecJoinsound(Handle:timer) { EmitSoundToAll("fairfailt/zielen.wav") } |
Re: Problem with playing Sound + StrContains doesn't works
Code:
public OnClientPostAdminCheck(client) |
Re: Problem with playing Sound + StrContains doesn't works
I don't think you even need to delay it in OnClientPutInServer. You should be able to play it then.
|
Re: Problem with playing Sound + StrContains doesn't works
No, because sometimes OnClientPutInServer runs before the client is fully in the game. Sometimes it runs while they are still sending info.
|
Re: Problem with playing Sound + StrContains doesn't works
It's going to consistently fire at a certain point every time. There is no "sometimes" it would either not work or always work. I would think it works. Has anyone tried it?
|
Re: Problem with playing Sound + StrContains doesn't works
Quote:
|
Re: Problem with playing Sound + StrContains doesn't works
In my experience, I always connect at slightly different times. Sometimes I hear the join sound, sometimes I don't. That is, until I put a 3 second timer on it. Then I heard it every time.
|
All times are GMT -4. The time now is 12:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.