Raised This Month: $ Target: $400
 0% 

[SOLVED But not sounds] Sounds and Show particles


Post New Thread Reply   
 
Thread Tools Display Modes
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-16-2015 , 11:11   Re: Sounds
Reply With Quote #11

Quote:
Originally Posted by Headline22 View Post
PHP Code:
public OnMapStart()
{
    
AddFileToDownloadsTable("sounds/sound1.mp3");
    
PrecacheSound("sound1.mp3");
}
 
public 
Action:Command_Something(clientargs)
{
    
EmitSoundToAll("sound1.mp3");
    return 
Plugin_Handled;

Doesn't works.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 07-16-2015 , 13:02   Re: Sounds
Reply With Quote #12

Quote:
Originally Posted by TheUnderTaker View Post
Doesn't works.


Yes it does, if it doesn't then your directories are wrong or something. Check your directories and fastDL

Instead of saying "Doesn't works." Try actually telling us what you are doing and give us information about it.

Last edited by headline; 07-16-2015 at 13:04.
headline is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-19-2015 , 15:23   Re: Sounds
Reply With Quote #13

BUMP
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 07-19-2015 , 15:32   Re: Sounds
Reply With Quote #14

Quote:
Originally Posted by Headline22 View Post
PHP Code:
public OnMapStart()
{
    
AddFileToDownloadsTable("sounds/sound1.mp3");
    
PrecacheSound("sound1.mp3");
}
 
public 
Action:Command_Something(clientargs)
{
    
EmitSoundToAll("sound1.mp3");
    return 
Plugin_Handled;

This wouldn't work as it's missing half the code necessary to be an actual plugin.

Try this:

PHP Code:
#include <sourcemod>
#pragma semicolon 1

public Plugin:myinfo = {
    
name "Test sound plugin for TheUnderTaker",
    
author "404: User Not Found",
    
description "Just a test!",
    
version "1.0",
    
url "http://www.unfgaming.net/404/sourcemod.html"
};

#define CUSTOM_SOUND "sounds/sound1.mp3"

public OnPluginStart()
{
    
RegConsoleCmd("sm_playsound"Command_PlaySound"Usage: sm_playsound");
}

public 
OnMapStart()
{
    
AddFileToDownloadsTable(CUSTOM_SOUND);
    
PrecacheSound(CUSTOM_SOUNDtrue);
}
 
public 
Action:Command_PlaySound(clientargs)
{
    
EmitSoundToAll(CUSTOM_SOUNDclient___1.0);
    return 
Plugin_Handled;

For more info on functions, I would check out https://sm.alliedmods.net/api/

Just hit up the search bar and punch in a function name, like EmitSoundToAll.

For example, here's the entry for EmitSoundToAll: https://sm.alliedmods.net/api/index....d=show&id=682&

The API pages are very useful when trying to figure out how to properly format a function.

Last edited by 404UserNotFound; 07-19-2015 at 15:33.
404UserNotFound is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-19-2015 , 15:44   Re: Sounds
Reply With Quote #15

Quote:
Originally Posted by abrandnewday View Post
This wouldn't work as it's missing half the code necessary to be an actual plugin.

Try this:

PHP Code:
#include <sourcemod>
#pragma semicolon 1

public Plugin:myinfo = {
    
name "Test sound plugin for TheUnderTaker",
    
author "404: User Not Found",
    
description "Just a test!",
    
version "1.0",
    
url "http://www.unfgaming.net/404/sourcemod.html"
};

#define CUSTOM_SOUND "sounds/sound1.mp3"

public OnPluginStart()
{
    
RegConsoleCmd("sm_playsound"Command_PlaySound"Usage: sm_playsound");
}

public 
OnMapStart()
{
    
AddFileToDownloadsTable(CUSTOM_SOUND);
    
PrecacheSound(CUSTOM_SOUNDtrue);
}
 
public 
Action:Command_PlaySound(clientargs)
{
    
EmitSoundToAll(CUSTOM_SOUNDclient___1.0);
    return 
Plugin_Handled;

For more info on functions, I would check out https://sm.alliedmods.net/api/

Just hit up the search bar and punch in a function name, like EmitSoundToAll.

For example, here's the entry for EmitSoundToAll: https://sm.alliedmods.net/api/index....d=show&id=682&

The API pages are very useful when trying to figure out how to properly format a function.
Tried, Compile error, added #include <sdktools>
Compiled correctly, didn't play sound
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-20-2015 , 02:33   Re: [MAYBE PAY] Sounds
Reply With Quote #16

Please guys I will maybe pay for it.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 07-20-2015 , 04:19   Re: Sounds
Reply With Quote #17

Quote:
Originally Posted by abrandnewday View Post
This wouldn't work as it's missing half the code necessary to be an actual plugin.
No shit.

I made and rewrote the plugin like 3 times via PM and he said neither of them work. He must be doing something incorrectly. I know for a fact they run fine...

I told him to check console, FastDL, error logs, the actual directories, sound file name, etc.
PHP Code:
#include <sourcemod>
#include <emitsoundany>

public Plugin:myinfo 
{
    
name "Sound Test",
    
author "Headline",
    
description "Playing A Sound",
    
version "1.0",
    
url "Allied-Gamers.com"
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_playsound"Command_PlaySound"Plays a sound");
}

public 
OnMapStart()
{
    
PrecacheSoundAny("gday.mp3");
    
AddFileToDownloadsTable("sound/gday.mp3");
}

public 
Action:Command_PlaySound(clientargs)
{
    if (
args != 0)
    {
        
ReplyToCommand(client"[SM] Usage : sm_playsound")
        return 
Plugin_Handled;
    }
    
EmitSoundToAllAny("gday.mp3");
    return 
Plugin_Handled;


Last edited by headline; 07-20-2015 at 04:23.
headline is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-20-2015 , 05:02   Re: Sounds
Reply With Quote #18

Quote:
Originally Posted by Headline22 View Post
No shit.

I made and rewrote the plugin like 3 times via PM and he said neither of them work. He must be doing something incorrectly. I know for a fact they run fine...

I told him to check console, FastDL, error logs, the actual directories, sound file name, etc.
PHP Code:
#include <sourcemod>
#include <emitsoundany>

public Plugin:myinfo 
{
    
name "Sound Test",
    
author "Headline",
    
description "Playing A Sound",
    
version "1.0",
    
url "Allied-Gamers.com"
};

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_playsound"Command_PlaySound"Plays a sound");
}

public 
OnMapStart()
{
    
PrecacheSoundAny("gday.mp3");
    
AddFileToDownloadsTable("sound/gday.mp3");
}

public 
Action:Command_PlaySound(clientargs)
{
    if (
args != 0)
    {
        
ReplyToCommand(client"[SM] Usage : sm_playsound")
        return 
Plugin_Handled;
    }
    
EmitSoundToAllAny("gday.mp3");
    return 
Plugin_Handled;

I told you in private, I tried, it said in chat "TEST PLUGIN PLAYED gday.wav" but didn't play, and i want 2 things,
1. It will really play the sound
2. No message of "X PLUGIN PLAYED x"

Not so hard.
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 07-20-2015 , 05:31   Re: Sounds
Reply With Quote #19

Quote:
Originally Posted by TheUnderTaker View Post
I told you in private, I tried, it said in chat "TEST PLUGIN PLAYED gday.wav" but didn't play, and i want 2 things,
1. It will really play the sound
2. No message of "X PLUGIN PLAYED x"

Not so hard.
You have probably no copied the exact path of the sound in the server files
__________________
Benoist3012 is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 07-20-2015 , 05:45   Re: Sounds
Reply With Quote #20

Quote:
Originally Posted by Benoist3012 View Post
You have probably no copied the exact path of the sound in the server files
Folder of sounds: C:\SteamCMD\steamapps\common\Team Fortress 2 Dedicated Server\tf\sounds
In plugin wrote: sounds/gday.mp3
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:04.


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