AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   EmitSoundAny Without INC (https://forums.alliedmods.net/showthread.php?t=266220)

thecount 07-12-2015 21:42

EmitSoundAny Without INC
 
Original Post: HERE

I decided to post this for the scripters that don't want to require a custom .inc file for their plugin to compile. Just add these functions to your code and use them as you normally would. Not all functions are required, BUT the variable and OnPluginStart() below ARE required.

PHP Code:

#include <sourcemod>
#include <sdktools>
new bool:sound_req;

public 
OnPluginStart(){
    new 
EngineVersion:engi GetEngineVersion();if(engi == Engine_CSGO || engi == Engine_DOTA){sound_req true;}else{sound_req false;}


Functions:
Spoiler

Powerlord 07-12-2015 23:02

Re: EmitSoundAny Without INC
 
The entire point of putting it in an .inc file is so that you didn't have to put the code into every plugin.

friagram 07-12-2015 23:07

Re: EmitSoundAny Without INC
 
Lol.

I try to use playgamesound client command whenever, since the files dont have to be precached and its generally easier on the server.

thecount 07-12-2015 23:16

Re: EmitSoundAny Without INC
 
Quote:

Originally Posted by friagram (Post 2319100)
Lol.

I try to use playgamesound client command whenever, since the files dont have to be precached and its generally easier on the server.

Yeah but other players can't hear it as a source across map.

Quote:

Originally Posted by Powerlord (Post 2319099)
The entire point of putting it in an .inc file is so that you didn't have to put the code into every plugin.


I hate custom inc files lol. I'm not saying this is the best way to go, but it is here for when you want others to be able to compile it on default compiler.

Another reason I did this was because the inc file from the page was giving me errors when I tried compiling. *shrug*

KissLick 07-13-2015 04:53

Re: EmitSoundAny Without INC
 
Quote:

Originally Posted by thecount (Post 2319103)
I hate custom inc files lol. I'm not saying this is the best way to go, but it is here for when you want others to be able to compile it on default compiler.

The point of include files is code reusability, I would totally hate to made this code everytime I make a plugin with files...
Yes, default forum compiler can't compile plugins with custom includes, but there is spider and I guess, it will replace the current one.

thecount 07-13-2015 11:19

Re: EmitSoundAny Without INC
 
Ok well I was getting errors when compiling so I just took the inc file apart and thought I might as well post it incase someone else finds it useful. That is all that happened. Good day.

Potato Uno 07-15-2015 13:32

Re: EmitSoundAny Without INC
 
You guys make the OP feel like "gee guys sorry that I tried to HELP"...

Powerlord 07-15-2015 13:48

Re: EmitSoundAny Without INC
 
Quote:

Originally Posted by Potato Uno (Post 2320003)
You guys make the OP feel like "gee guys sorry that I tried to HELP"...

You realize that all he's done is copy code from one of my include files and tell people to stick it directly into their plugin, right?

Something they could already do if they didn't want to rely on an external .inc file.

thecount 07-15-2015 14:36

Re: EmitSoundAny Without INC
 
Quote:

Originally Posted by Powerlord (Post 2320009)
You realize that all he's done is copy code from one of my include files and tell people to stick it directly into their plugin, right?

Something they could already do if they didn't want to rely on an external .inc file.

I didn't copy and paste but someone can delete this thread if it bothers you that much, prick.

Potato Uno 07-20-2015 23:57

Re: EmitSoundAny Without INC
 
Quote:

Originally Posted by thecount (Post 2320031)
I didn't copy and paste but someone can delete this thread if it bothers you that much, prick.

Hey now let's not resort to name calling.


All times are GMT -4. The time now is 18:33.

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