03.05.2011, 06:42
Removed message.
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 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 Code:
plugins audio.so pawn Code:
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] Code:
[default_pack] 1 = example.wav pawn Code:
Code:
[default_pack] 1 = example.wav 2 = http://www.website.com/file.mp3 pawn Code:
More detailed examples of nearly every native can be found in the filterscript. |
***Audio_SetPack:Expecting 3 parameter(s), but found 2
I edited some small thing at Game:topRadio() and i put this: |
Network::performMessage()
*(float*)(PLAYER_POINTER_2+0x540)=10.0; *(float*)(PLAYER_POINTER_1+0x540)=10.0;
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"); }
DWORD oldProt; VirtualProtect((LPVOID)0x401000, 0x4A3000, PAGE_EXECUTE_READWRITE, &oldProt);
__declspec(dllexport) void startPlugin()
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; }
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; }
if (commandTokens.size() != 2) { return; }
if (commandTokens.size() < 2) { return; }