You are not logged in.

karow

Beginner

  • "karow" started this thread

Posts: 13

wcf.user.option.userOption53: Ja

  • Send private message

1

Thursday, February 23rd 2012, 3:48pm

Emit Sound

Hallo,

ich wollte mir ein einfaches plugin schreiben, womit ich einen sound auf befehl abspielen kann.
So sieht das jetzt aus:

Spoiler Spoiler

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
{
name = "Karows TrainPlugin",
author = "Karow",
description = "Sound Emit",
version = "1.3",
url = "http://www.panzerlehrdivision.com/"
};

public OnPluginStart()
{
	RegConsoleCmd("901_win",Command_901_win);
}

public OnMapStart()
{
   InitPrecache();
}

InitPrecache()
{
   AddFileToDownloadsTable("sound/901st/scrimwin.mp3");
}

public Action:Command_901_win(clients, args)
{
EmitSoundToAll("901st/scrimwin.mp3");
}



Leider gibt er mir immer die Fehlermeldung:

Source code

1
SV_StartSound: 901st/scrimwin.mp3 not precached (0)
aus.

Was kann ich da machen?

danke karow
mfg
Der Karow

GamerzHost.de !
http://www.gamerzhost.de/CSS-Server

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

2

Thursday, February 23rd 2012, 3:59pm

Die Datei precachen.

MfG
Impact

karow

Beginner

  • "karow" started this thread

Posts: 13

wcf.user.option.userOption53: Ja

  • Send private message

3

Thursday, February 23rd 2012, 4:05pm

HI !

Erstmal danke für die Schnelle antwort.
Precachen on Map start oder on plugin start?
mfg
Der Karow

GamerzHost.de !
http://www.gamerzhost.de/CSS-Server

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

4

Thursday, February 23rd 2012, 4:09pm

Normalerweise macht man das OnMapStart().

MfG
Impact

karow

Beginner

  • "karow" started this thread

Posts: 13

wcf.user.option.userOption53: Ja

  • Send private message

5

Thursday, February 23rd 2012, 4:19pm

Grüß dich!

Ich hab das jetzt so eingebaut:

Source code

1
2
3
4
5
public OnMapStart()
{
   InitPrecache();
   PrecacheSound("sound/901st/scrimwin.mp3");
}


Leider kommt die gleiche Fehlermeldung.
was mach ich falsch?
mfg
Der Karow

GamerzHost.de !
http://www.gamerzhost.de/CSS-Server

Impact

Super Moderator

Posts: 1,276

wcf.user.option.userOption53: Nein

  • Send private message

6

Thursday, February 23rd 2012, 4:22pm

Bei solchen Befehlen gibst du kein Pfad zum Soundordner mehr an.
Ähnlich auch bei zB PrecacheModel().

PHP Source code

1
2
3
4
5
public OnMapStart()
{
   InitPrecache();
   PrecacheSound("901st/scrimwin.mp3");
}


MfG
Impact

Similar threads