Witam, mam pewien skrypt na muzyke z pojazdu Pony. Muzyczka gra, wszystko pi?knie tylko gdy zrobi sie /reconnect a muzyka jest w??czona to jej nie s?ycha? a inni co nie zrobili /reconnect s?ysza j?. Prosz? o pomoc.
ponymuz-c.lua
[lua]local muza={}
addEvent("pony_muzyka1", true)
addEventHandler("pony_muzyka1", root, function(val, veh)
if val==1 then
local x,y,z=getElementPosition(veh)
muza[veh]=playSound3D("http://radioftb.net/disco.m3u", x, y, z, true)
setSoundMaxDistance(muza[veh], 50)
attachElements(muza[veh], veh, 0, 0, 0)
elseif val==2 then
if muza[veh] then
destroyElement(muza[veh])
end
end
end)
[/lua]
ponymuz-s.lua
[lua]addCommandHandler("startted", function(plr, cmd)
if isPedInVehicle(plr) then
auto = getPedOccupiedVehicle(plr)
pan = getVehicleOccupant(auto, 0)
if plr == pan then
if getElementModel(auto)==413 then
outputChatBox("[PonyMusic] Muzyka zosta?a w??czona!", plr)
triggerClientEvent(root, "pony_muzyka1", plr, 1, auto)
end
end
end
end)
addCommandHandler("stopped", function(plr, cmd)
if isPedInVehicle(plr) then
pojazd = getPedOccupiedVehicle(plr)
kier = getVehicleOccupant(pojazd, 0)
if plr == kier then
if getElementModel(pojazd)==413 then
outputChatBox("[PonyMusic] Muzyka zosta?a wy??czona!", plr)
triggerClientEvent(root, &... |