Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. elseif option == "audio" then
  2. if not isPedInVehicle(player) then exports.titan_noti:showBox(player, "TIP: /v ["..legend.."]") return end
  3. local veh = getPedOccupiedVehicle(player)
  4. if(not isElement(veh)) then
  5. exports.titan_noti:showBox(player, "Musisz siedzieć w pojeździe.")
  6. return
  7. end
  8. local vehInfo = getVehInfo(getElementData(veh, "vehID"))
  9. if(not vehInfo) then
  10. exports.titan_noti:showBox(player, "Nie można znaleźć informacji o pojeździe.")
  11. return
  12. end
  13. if(not doesPlayerHaveDrivePerm(player, vehInfo.ID)) then
  14. exports.titan_noti:showBox(player, "Nie posiadasz kluczyków do tego pojazdu.")
  15. return
  16. end
  17. if not veh:getData("carAudio") then
  18. if veh:getData("carAudioOn") then veh:removeData("carAudioOn") end
  19. return exports.titan_noti:showBox(player, "W napędzie nie ma płyty.")
  20. else
  21. if veh:getData("carAudioOn") then
  22. veh:removeData("carAudioOn")
  23. local occupants = getVehicleOccupants(veh)
  24. for seat, player in pairs(occupants) do
  25. triggerClientEvent(player, "soundPlay.carAudioOff", player)
  26. end
  27. triggerClientEvent("soundPlay.carAudioOffTerrain", player, veh)
  28. return exports.titan_noti:showBox(player, "Audio zostało wyłączone.")
  29. else
  30. veh:setData("carAudioOn", true)
  31. local occupants = getVehicleOccupants(veh)
  32. for seat, player in pairs(occupants) do
  33. triggerClientEvent(player, "soundPlay.carAudioOn", player, veh:getData("carAudio"))
  34. end
  35. triggerClientEvent("soundPlay.carAudioOnTerrain", player, veh, veh:getData("carAudio"))
  36. return exports.titan_noti:showBox(player, "Audio zostało włączone.")
  37. end
  38. end
  39. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement