General > Developers Corner
ULX Coding Problem
JamminR:
Josephhabib, the others are right, we'll need to see code and errors if any.
We could guess all day.
* JamminR puts a Li-ion battery in the compartment of his mind-code-reading skillz, hoping it doesn't explode.My educated guess, without seeing your code -
Regarding your various sound doesn't play when it should, you likely don't have unique function names, or unique hook names, for one or more of the functions or hooks you copied.
Example, say you have one working function.
--- Code: ---function death_sound1_one ( player )
... code that plays sound ...
end
concommand.Add ( "run_func1", death_sound1_one )
--- End code ---
To run that, in console, you'd type "run_func1"
But then you copy and paste it.
Look below at the two spots I've commented with -- .. those spots must be different for the second function, or the first function would get called.
--- Code: ---function death_sound1_one ( player )
... code that plays sound ...
end
concommand.Add ( "run_func1", death_sound1_one )
function death_sound2_two ( player ) -- You'd have to change the function name!!
... code that plays sound ...
end
concommand.Add ( "run_func2", death_sound2_two ) -- You'd have to change both the command and the function.
--- End code ---
Hooks are the same way, if your command is using player say hooks
hook.add( PlayerSay , UNIQUE_name_1, "death_sound1_one" )
hook.add( PlayerSay, UNIQUE_name_2, "death_sound2_two" )
Make sure you are using unique command, function and hook names, or any could overwrite or call the other.
Navigation
[0] Message Index
[*] Previous page
Go to full version