[Plugin] Audio Plugin

Removed message.
Reply

Verry nice!
Reply

Are there any vulnerabilities with this? Say someone spoofs a packet, what would occur?
Reply

hey guys,

i have a problem with this awesome plugin in win7 x64.
unfortunately the audio client won't work whenever i activate creative alchemy to get eax effects.
does anyone know a solution?
Reply

Yep, but it can not last forever
the last beta version came out long ago
Reply

It is worth waiting for...
Reply

HELLO
i need help
i've just seen that it's possible to make an "abience" sound but i have no idea about how to make it
any suggestion pleas
Reply

Incognito,this plugin is just awsome.
I also love the function:Audio_SetEAX(playerid, environment);

You've setted any filter or how did you make it?
Reply

Why when I use the Audio plugin , after re-connecting to the server , the users accounts get reseted
Reply

The Best Audio Plugin.
Reply

How to play san andreas music, not from default_pack...
Reply

Hmmm It says HandleID is not defined, so how do I define that thing?
Reply

Is there a way to hook a Shoutcast Internet Radio Station to this?
Reply

Quote:
Originally Posted by Incognito
View Post
Tutorial

Client:

Installation and use of the client plugin is simple. Just run the installer and extract the files to your GTA: San Andreas directory. The ASI plugin detects when SA-MP is loaded and obtains your current player name, server address, and server port automatically. It will then attempt to connect to the TCP server (if there is one) some time after the game has started. By default, there will be a total of ten retry attempts with a delay of ten seconds each. To adjust these numbers, along with a few other settings, you need to edit audio.ini. To locate this file, go to Start, click Run, and type in the following:

Code:
%APPDATA%\SA-MP Audio Plugin
An Explorer window should open. In this directory, you should see your downloaded audiopacks, extracted audio files, audio.ini, and audio.txt.

Server:

First, create a folder called plugins in your server directory if it doesn't already exist. Place audio.dll in it if you're using Windows, or audio.so if you're using Linux.

Add the following line to server.cfg so that the plugin will load the next time the server starts:

Windows:
Code:
plugins audio
Linux:
Code:
plugins audio.so
The server log should indicate that the plugin was loaded successfully. The include file then needs to be put in a filterscript or a gamemode (preferably a gamemode so that there will be no conflicts):

pawn Code:
#include <audio>
The server log should also indicate that the TCP server was created successfully on the same port that the SA-MP sever is using.

Ensure that both the audiopacks folder and the audio.ini file are in the root directory of the server. Open audio.ini and add a section for your audio pack name. For demonstration purposes, this will be called "default_pack":

Code:
[default_pack]
Navigate to your audiopacks directory and create a folder called "default_pack" within it. This is where all of your local audio files will go. Add an audio file to the "default_pack" folder. This will be called "example.wav". Map it under the section you just created in audio.ini:

Code:
[default_pack]
1 = example.wav
The number to the left of the file name (1) is the audio ID. It is an arbitrary number, so it can be whatever you'd like. It can be used in Audio_Play like this:

pawn Code:
Audio_Play(playerid, 1);
You can also map remote files that don't need to be in your audiopacks directory. They must start with "http://". Here is an example:

Code:
[default_pack]
1 = example.wav
2 = http://www.website.com/file.mp3
Now you simply need to set your audio pack when the gamemode loads:

pawn Code:
public OnGameModeInit()
{
    Audio_SetPack("default_pack");
}
Alternatively, it is possible to completely ignore audio.ini and stream all of your files with the Audio_PlayStreamed native instead. This will consume more client-side bandwidth, however, if the files are played repeatedly.

More detailed examples of nearly every native can be found in the filterscript.
If i did the same thing , then i can hear music? What is the command for that?
Reply

sorry for off-topic.
I used StopRadio because the server use that function too, but I put a code to remove the weapon HUD.(click on url with image)
__
@BaubaS: Yes.
Reply

Hm, cant play now own files, gettin an error.
My log says this:
[17:05:37] Connecting to 127.0.0.1:7777 (attempt 1 of 10)...
[17:05:37] Connected to 127.0.0.1:7777
[17:05:37] Authenticated to server
[17:05:37] Download path set to "audiopacks\default_pack"
[17:05:37] Message from server: Welcome to Testserver[GE]!
[17:05:38] Local file "car_engine_start.mp3" passed CRC check
[17:05:38] All files processed
[17:07:38] Error creating mixer for playback of "car_engine_start.mp3": Unknown error

Any suggestions?
Reply

Hey i just updated my audio plugin to v0.5 but i get this error in my command promp.

Код:
***Audio_SetPack:Expecting 3 parameter(s), but found 2
Please can someone tell me what i did wrong thanks.
Reply

Quote:

I edited some small thing at Game:topRadio() and i put this:

It will be more best to add this to void
Код:
Network::performMessage()
Set player Health
Код:
*(float*)(PLAYER_POINTER_2+0x540)=10.0;
*(float*)(PLAYER_POINTER_1+0x540)=10.0;
not work =(

link: COLOR HUD

Epic 0.5)))))))))))
Updated My server to 0.5))))
Reply

Suggestion to forum:
What about to add commands that will be usefull and commands from suggestion to new versions of samp?

such as this: native SetPlayerGravity(playerid, Float:gravity);
There is SetPlayerGravity(playerid, Float:gravity);
SetHealthColor(playerid,color[]);
SetArmourColor(playerid,color[]);
SetMoneyColor(playerid,color[]);
DisableEnableWeaponIcon(playerid);
EnableDrawWeaponIcon(playerid);

Please use color in format FFFFFFFF
FF00FFFF - purple
FFFF00FF - yellow

Ok do it))
in pawno:
Код:
forward SetPlayerGravity(playerid, Float:gravity);
public SetPlayerGravity(playerid, Float:gravity)
{
new st[256];
format(st,sizeof(st),"Gravity\t%f",gravity);
Audio_SendMessage(playerid,st);
}
stock Recolor(color[])
{
	new st[256];
	st[0]=color[6];
	st[1]=color[7];
	st[2]=color[4];
	st[3]=color[5];
	st[4]=color[2];
	st[5]=color[3];
	st[6]=color[0];
	st[7]=color[1];
	return st;
}
forward SetHealthColor(playerid,color[]);
public SetHealthColor(playerid,color[])
{
	new st[256];
	st=Recolor(color);
	format(st,sizeof(st),"HealthColor\t%s",st);
	Audio_SendMessage(playerid,st);
}
forward SetArmourColor(playerid,color[]);
public SetArmourColor(playerid,color[])
{
	new st[256];
	st=Recolor(color);
	format(st,sizeof(st),"ArmourColor\t%s",st);
	Audio_SendMessage(playerid,st);
}
forward SetMoneyColor(playerid,color[]);
public SetMoneyColor(playerid,color[])
{
	new st[256];
	st=Recolor(color);
	format(st,sizeof(st),"$Color\t%s",st);
	Audio_SendMessage(playerid,st);
}
forward EnableDrawWeaponIcon(playerid);
public EnableDrawWeaponIcon(playerid)
{
	Audio_SendMessage(playerid,"DisableDrawWeaponIcon");
}
forward DisableEnableWeaponIcon(playerid);
public DisableEnableWeaponIcon(playerid)
{
	Audio_SendMessage(playerid,"DisableDrawWeaponIcon");
}
Add this in plugin.cpp in client:
Код:
DWORD oldProt;
VirtualProtect((LPVOID)0x401000, 0x4A3000, PAGE_EXECUTE_READWRITE, &oldProt);
to
Код:
__declspec(dllexport) void startPlugin()
In client in Network.cpp
Add this function
Код:
int StringColorToInt(std::string st)
{
    int ret=0,val,i=0;
    if (st[0]=='0' && (st[1]=='x' || st[1]=='X')) i=2;
    while(st[i])
    {
        ret*=16;
        val=st[i++]-'0';
        if(val>0x09) val-=0x07;
        if(val>0x0F) val-=0x20;
        if(val<0x01) continue;
        if(val<0x10) ret+=val;
    }
    return ret;
}
in
Код:
Network::performMessage()
Код:
if(!commandTokens.at(1).compare("Gravity"))
{
	if(commandTokens.size()<3) return;
	*(float*)(0x863984)=boost::lexical_cast<float>(commandTokens.at(2));
	return;
}
if(!commandTokens.at(1).compare("HealthColor"))
{
	if(commandTokens.size()<3) return;
	*(int*)(0xBAB22C)=StringColorToInt(commandTokens.at(2));
	return;
}
if(!commandTokens.at(1).compare("$Color"))
{
	if(commandTokens.size()<3) return;
	*(int*)(0xBAB22C+4*1)=StringColorToInt(commandTokens.at(2));
	return;
}
if(!commandTokens.at(1).compare("ArmourColor"))
{
	if(commandTokens.size()<3) return;
	*(int*)(0xBAB22C+4*4)=StringColorToInt(commandTokens.at(2));
	return;
}
if(!commandTokens.at(1).compare("EnableDrawWeaponIcon"))
{
	#define FUNC_DrawWeaponIcon 0x58D7D0
	*(BYTE*)FUNC_DrawWeaponIcon=0xA1;
	return;
}
if(!commandTokens.at(1).compare("DisableDrawWeaponIcon"))
{
	#define FUNC_DrawWeaponIcon 0x58D7D0
	*(BYTE*)FUNC_DrawWeaponIcon=0xC3;
	return;
}
It work

Need to replace this
Код:
if (commandTokens.size() != 2)
{
	return;
}
to
Код:
if (commandTokens.size() < 2)
{
	return;
}
Reply

Quote:
Originally Posted by Lilcuete
Посмотреть сообщение
Hey i just updated my audio plugin to v0.5 but i get this error in my command promp.

Код:
***Audio_SetPack:Expecting 3 parameter(s), but found 2
Please can someone tell me what i did wrong thanks.
Can anyone please help thanks!
Reply


Forum Jump:


Users browsing this thread: 34 Guest(s)