05.01.2012, 15:34
(
Последний раз редактировалось Jochemd; 14.06.2014 в 10:55.
)
Hello,
Today I release another script I made, the "Dynamic Radio in Vehicles". This script is designed to easily add real existing radio stations to the game. It simply replaces the old radio.
You can install this by putting...
... at the top of your gamemode or filterscript (filterscript since R2)
Using it ingame
There are three new buttons added in SA-MP 0.3d, and we will use two of them: Y and N.
Y -> Station Next
N -> Station Back
You can also choose different styles for the textdraw (since R5)
For those who are interested in how te styles look; I uploaded a picture of them.
ID 0: http://i.imgur.com/zqqCi.png
ID 1: http://i.imgur.com/hIsYh.png
ID 2: http://i.imgur.com/vSjoj.png
I can only say, check it out!
Credits
Jochemd - Creating this script (not too hard)
****** - y_hooks
Jakku - I asked him for help when the hooks didn't work well.
Changelog
Download
http://pastebin.com/5yKug2wj (R7)
Example for GetRadioStationsString() http://pastebin.com/raw.php?i=m45qNVeR (note: copy it to your PAWN editor for a better reading experience with syntax highlighting.)
Please note this is not a filterscript, but an include! You have to use "AddRadioStation" in your gamemode/filterscript!
Today I release another script I made, the "Dynamic Radio in Vehicles". This script is designed to easily add real existing radio stations to the game. It simply replaces the old radio.
pawn Код:
stock AddRadioStation(name[NAME_SIZE], link[LINK_SIZE])
// name: The name of the radio station (which will show ingame when changing stations).
// link: The link to the audio stream.
pawn Код:
#include "DynamicRadioStations"
Using it ingame
There are three new buttons added in SA-MP 0.3d, and we will use two of them: Y and N.
Y -> Station Next
N -> Station Back
You can also choose different styles for the textdraw (since R5)
pawn Код:
#define USE_TEXTDRAW_SET [ID]
ID 0: http://i.imgur.com/zqqCi.png
ID 1: http://i.imgur.com/hIsYh.png
ID 2: http://i.imgur.com/vSjoj.png
I can only say, check it out!
Credits
Jochemd - Creating this script (not too hard)
****** - y_hooks
Jakku - I asked him for help when the hooks didn't work well.
Changelog
Код:
R7 - The textdraw is now per-player instead of per-vehicle, which saves A LOT of textdraws. Note: I did not use PlayerTextDraws, but a loop with normal textdraws. R6 - Added GetRadioStationsString() which returns all names of the stations (NAME1\nNAME2\nNAME3). This allows you to create command like /setstation (see example) and /allstations. - Bugfix in SetRadioStation. R5 - Fixed a bug: People were able to switch radio stations on foot. - Changed the hooks OnGameModeInit and OnFilterScriptInit to stocks to save script space. - Added GetVehicleRadioStation(vehicleid) and SetVehicleRadioStation(vehicleid, stationid) (useful if you want to make a 'favourites' script, for example). - Rewrote almost whole code in another style. - Added several textdraw styles. You can now choose one you prefer using a define! Credits to Jakku for creating some styles - The radio stations are now synced per vehicle. When a passenger changes the radio station, the driver sees it and the same goes for when the driver changes it. R4 - Fixed bug: When you spawn, server crashes. Update strongly recommended! R3 - Fixed bug: Array sizes do not match (error 47). - Fixed bug: Music doesn't stop when you exit the vehicle. - Fixed bug: "symbol" has been truncated to "size". I have just shrinked the hooks. R2: - Now you can use this in an filterscript as well! - Fixed a bug where the last one wouldn't be called because the cell assignment starts from 0. Thanks to CyNiC!
http://pastebin.com/5yKug2wj (R7)
Example for GetRadioStationsString() http://pastebin.com/raw.php?i=m45qNVeR (note: copy it to your PAWN editor for a better reading experience with syntax highlighting.)
Please note this is not a filterscript, but an include! You have to use "AddRadioStation" in your gamemode/filterscript!