-
Posts
334 -
Joined
-
Last visited
Everything posted by Jokeℝ1472771893
-
----client sx,sy = guiGetScreenSize () local volume = 0.3 local guiShowing = false local currentPlaying = nil local state = nil musicPlayerGUI = {} width,height = 200,350 function createGui () musicPlayerGUI.window = guiCreateWindow(sx-width,sy/2-height/2,width,height,"Radio player",false) musicPlayerGUI.grid = guiCreateGridList(5,25,width-10,height-95,false,musicPlayerGUI.window) addEventHandler ( "onClientGUIDoubleClick", musicPlayerGUI.grid, onGuiClick, true ) -- klikanie w grid odpala radio stacje musicPlayerGUI.column = guiGridListAddColumn(musicPlayerGUI.grid,"Radio stations",0.9) musicPlayerGUI.button1 = guiCreateButton(10,height-65,25,20,">",false,musicPlayerGUI.window) addEventHandler ( "onClientGUIClick", musicPlayerGUI.button1, onGuiClick,true) musicPlayerGUI.button2 = guiCreateButton (40, height-65,25,20,"||",false,musicPlayerGUI.window) addEventHandler ( "onClientGUIClick", musicPlayerGUI.button2, onGuiClick, true ) musicPlayerGUI.button3 = guiCreateButton(70,height-65,60,20,"Play 3D",false,musicPlayerGUI.window) addEventHandler ( "onClientGUIClick", musicPlayerGUI.button3, onGuiClick, true ) musicPlayerGUI.button4 = guiCreateButton (135, height-65,60,20,"Close",false,musicPlayerGUI.window) addEventHandler ( "onClientGUIClick", musicPlayerGUI.button4, onGuiClick, true ) musicPlayerGUI.label = guiCreateLabel (5,height-45,width-10,20,"Volume",false,musicPlayerGUI.window) guiSetFont (musicPlayerGUI.label, "default-bold-small") guiLabelSetHorizontalAlign (musicPlayerGUI.label, "center") musicPlayerGUI.volumeBar = guiCreateScrollBar(5,height-30,width-10,20,true,false,musicPlayerGUI.window) guiScrollBarSetScrollPosition (musicPlayerGUI.volumeBar, volume*100) guiWindowSetMovable (musicPlayerGUI.window, false) guiWindowSetSizable (musicPlayerGUI.window, false) guiSetVisible (musicPlayerGUI.window, false) end stationsNames = {} stations = {} function showGui () if guiShowing then guiShowing = false guiSetVisible (musicPlayerGUI.window, false) showCursor (false) else guiShowing = true guiSetVisible (musicPlayerGUI.window, true) showCursor (true) end end addCommandHandler("radio",showGui) function onGuiClick (button, state, x,y) if source == musicPlayerGUI.button1 and state == "up" then --play button local selected = guiGridListGetSelectedItem (musicPlayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicPlayerGUI.grid, selected, musicPlayerGUI.column) if stationName then if currentPlaying then stopSound (currentPlaying) end currentPlaying = playSound (stations[stationName]) setSoundVolume (currentPlaying, volume) state = "play" else outputChatBox ("unknown error") end elseif state == "pause" and isSoundPaused(currentPlaying) then setSoundPaused (currentPlaying, false) end end if source == musicPlayerGUI.button2 and state == "up" then --pause button if isSoundPaused (currentPlaying) == false then setSoundPaused (currentPlaying, true) end end if source == musicPlayerGUI.button3 and state == "up" then -- 3d local selected = guiGridListGetSelectedItem (musicPlayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicPlayerGUI.grid, selected, musicPlayerGUI.column) if stationName then triggerServerEvent ("onClientRadioCreate", getLocalPlayer(), getLocalPlayer(), stationName) end end end if source == musicPlayerGUI.button4 and state == "up" then -- close showGui () end if source == musicPlayerGUI.grid and state == "up" then -- grid list click local selected = guiGridListGetSelectedItem (musicPlayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicPlayerGUI.grid, selected, musicPlayerGUI.column) if stationName then if currentPlaying then stopSound (currentPlaying) end currentPlaying = playSound (stations[stationName]) setSoundVolume (currentPlaying, volume) else outputChatBox ("unknown error") end end end end function OnScroll(Scrolled) if source == musicPlayerGUI.volumeBar then volume = guiScrollBarGetScrollPosition (source) / 100 if currentPlaying then setSoundVolume (currentPlaying, volume) end end end addEventHandler("onClientGUIScroll",getRootElement(),OnScroll) function onRadioCreate (x,y,z,path) local playerveh = getPedOccupiedVehicle(source) local sound = playSound3D (path, x,y,z) setSoundVolume (sound, volume) setSoundMaxDistance (sound, 300) attachElements(sound,playerveh) end addEvent ("onNewRadioCreate", true) addEventHandler ("onNewRadioCreate", getRootElement(), onRadioCreate) function onStart () triggerServerEvent ("requestForRadios", getLocalPlayer(), getLocalPlayer()) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), onStart) function onJoin (radia, names, st) for k,v in ipairs(radia) do local sound = playSound3D (v[4], v[1], v[2], v[3]) setSoundVolume (sound, volume/100) setSoundMaxDistance (sound, 20) end stationsNames = names stations = st for k,v in ipairs(stationsNames) do local row = guiGridListAddRow ( musicPlayerGUI.grid ) guiGridListSetItemText ( musicPlayerGUI.grid, row, musicPlayerGUI.column, v, false, false ) end end addEvent ("sendAllRadios", true) addEventHandler ("sendAllRadios", getRootElement(), onJoin) createGui () ---server-- function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(angle+90) local plusX = math.cos(a) * dist local plusY = math.sin(a) * dist return x+plusX, y+plusY end xmlFile = xmlLoadFile ("radios.xml") radios = {} stations = {} stationsNames = {} function loadStations () if xmlFile then local children = xmlNodeGetChildren (xmlFile) for k,v in ipairs(children) do local radioTable = xmlNodeGetAttributes (v) for name,value in pairs(radioTable) do --outputChatBox (tostring(value)) if name == "name" then stationName = value elseif name == "path" then stationPath = value end end --outputChatBox ("name = " .. tostring(stationName) .. ", path = " .. tostring(stationPath)) stations[stationName] = stationPath table.insert (stationsNames, 1, stationName) end table.sort (stationsNames) end end loadStations () --stacje["kwejk"] = "http://fm.kwejk.pl/kwejkfm_aac.m3u" --stacje["zet"] = "http://www.radiozet.pl/content/stream/radiozet.pls" --stacje["rmf"] = "http://www.miastomuzyki.pl/odbior/rmf_aacp.pls" --stacje["rmf fm"] = "http://www.miastomuzyki.pl/odbior/rmf_aacp.pls" --nazwyStacji = {"kwejk", "zet", "rmf fm"} function createRadio (player,station) if station then local stationPath = stations[station] local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if stationPath then local x,y,z = getElementPosition( player ) local rx,ry,rz = getElementRotation ( player ) local newX, newY = getPointFromDistanceRotation (x,y, 1.5, rz) local playerveh = getPedOccupiedVehicle(player) local newZ = z - 1 local obiekt = createObject (2229, newX, newY, newZ, rx,ry,rz) attachElements (obiekt, playerveh,1, 0, 0,90,0) triggerClientEvent ("onNewRadioCreate", getRootElement(), newX, newY, newZ, stationPath) -- wysyla informacje do clientow o nowym radiu outputChatBox ("New station: " .. station .. " created, path: " .. tostring(stationPath), 0,220,0) table.insert (radios, 1, {newX, newY, newZ, stationPath}) -- zapisuje informacje o radiu dla nowych graczy else outputChatBox ("error", player, 220, 0, 0) --outputChatBox ("You choose wrong station, avaible stations:", player, 220, 0, 0) --for k,v in ipairs(stationsNames) do --outputChatBox ("-" .. v, player) --end end else outputChatBox ("error", player, 220, 0, 0) --outputChatBox ("Choose radio to create, avaible stations:", player,220,0,0) --for k,v in ipairs(stationsNames) do -- outputChatBox ("-" .. v, player) --end end end end addEvent ("onClientRadioCreate", true) addEventHandler ("onClientRadioCreate", getRootElement(), createRadio) --addCommandHandler ("radio", createRadio) function onJoin (player) if radios then triggerClientEvent (player, "sendAllRadios", getRootElement(), radios, stationsNames, stations) end end addEvent ("requestForRadios", true) addEventHandler ("requestForRadios", getRootElement(), onJoin) how to attach the music in the radio? the music is playing in same place -.-
-
function createTeamsOnStart () Busdriver = createTeam ( "Busdriver", 0, 200, 255 ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) marker1 = createMarker (1808,-1904.3000488281,12.5,"cylinder",1.2,0,0,225,100) marker2 = createMarker (1794.4000244141,-1932.1999511719,12.39999961853,"cylinder",2,0,255,225,100) blip1 = createBlip ( 1808,-1904.3000488281,12.5, 56, 2) blip2 = createBlip ( 1794.4000244141,-1932.1999511719,12.39999961853, 53 ) attachElements (blip1,marker1,0,0,0) ped1 = createPed (1808,-1904.3000488281,12.5) ped2 = createPed (1794.4000244141,-1932.1999511719,12.39999961853,4) attachElements (ped2,marker2,0,0,0) setPedRotation (ped1,180) setPedAnimation( ped1, "paulnmac", "wank_loop" ) setElementDimension ( marker2, 0 ) setElementDimension ( ped2, 0 ) setElementDimension ( blip2, 0 ) setElementFrozen ( ped1, true ) function showGUI(hitPlayer) triggerClientEvent (hitPlayer,"show",getRootElement(),hitPlayer) end addEventHandler ("onMarkerHit",marker1,showGUI) addEventHandler("onMarkerLeave",marker1, function (leavePlayer) triggerClientEvent(leavePlayer,"hide",leavePlayer) end) function start(hitPlayer) help = createVehicle(437,1783.0999755859,-1929.1999511719,13.60000038147) outputChatBox("Go now to the flag to get your money", source, 255, 2, 0) setElementDimension ( help, 0 ) end addEventHandler ("onMarkerHit",marker2,start) jobmarker = createMarker ( 1536.1999511719,-1669.9000244141,12.39999961853, cylinder, 5, 255, 200, 0, 250, getRootElement() ) blip4 = createBlip ( 1536.1999511719,-1669.9000244141,12.39999961853, 53 ) setElementDimension ( blip4, 0 ) setElementDimension ( jobmarker, 0 ) function eindMission (player) if ( getElementDimension ( source ) == 0 ) then destroyElement ( help ) setElementPosition( player, 1536.1999511719,-1669.9000244141,12.39999961853 ) setElementDimension ( player, 0 ) givePlayerMoney ( player, 500 ) end end addEventHandler( "onMarkerHit", jobmarker, eindMission ) Server Side windpw = {} button = {} window = guiCreateWindow(0.3,0.2,0.4,0.5,"Bus Job",true) guiSetAlpha(window,255) guiCreateStaticImage ( 0, 0, 1, 0.8,"boot.png",true,window) guiSetVisible(window,false) button[1] = guiCreateButton(0.52,0.85,0.45,0.1,"Accept",true,window) button[2] = guiCreateButton(0,0.85,0.45,0.1,"Decline",true,window) function show() guiSetVisible (window,true) showCursor(true) end addEvent("show",true) addEventHandler("show",getRootElement(),show) addEvent("hide",true) addEventHandler("hide",getRootElement(), function () guiSetVisible(window,false) showCursor (false) end) addEventHandler("onClientGUIClick",getRootElement(), function (player) if (source == button[2]) then guiSetVisible (window,false) showCursor (false) outputChatBox ("You have declined this mission",225,0,0) elseif (source == button[1]) then money = getPlayerMoney (source) if (money < 0) then outputChatBox ("Jaap:Ok, Come later back for money",225,250,0) else player = getLocalPlayer() outputChatBox ("Jaap:Ok, This mission start now",225, 255,0) setElementModel (player, 255) setElementPosition( player, 1794.4000244141,-1932.1999511719,12.39999961853, 4 ) setElementDimension ( player, 0 ) outputChatBox ("Step one time in the marker for spam a Bus",225,0,0) end end end) Client Side but i whant to add that 1 player can spwan 1 car and when someone hit Job Marker then you can see youre job destination Blip
-
GTA4 is the best but GTA SA is better xD
-
How to add?
-
look this happened when i try to start any Map
-
ok i try
-
but i can't start all maps [PLAY][Race][CTF] and etc
-
i delete that but Nothing
-
No i don't see O_O you think it is problem?
-
please Help i double post because you don't see my posts
-
this us part of ACL
-
"Console"> "SuperModerator"> "Admin"> "RPC"> "user.paruyr"> "resource.Admin"> "RPC"> "RPC"> "MapEditor"> "Default"> "MapEditor"> "resource.editor_main"> "resource.edf"> "raceACLGroup"> "Default"> "raceACL"> "resource.race"> "Admin"> "general.ModifyOtherObjects" access="true"> "general.http" access="true"> "command.shutdown" access="true"> "command.install" access="true"> "command.aexec" access="true"> "command.debugscript" access="true"> "command.upgrade" access="true"> "command.crun" access="true"> "command.srun" access="true"> "command.run" access="true"> "function.addBan" access="true"> "function.removeBan" access="true"> "function.executeCommandHandler" access="true"> "function.setServerPassword" access="true"> "function.getServerPassword" access="true"> "function.createResource" access="true"> "function.copyResource" access="true"> "function.addResourceMap" access="true"> "function.addResourceConfig" access="true"> "function.removeResourceFile" access="true"> "function.setResourceDefaultSetting" access="true"> "function.removeResourceDefaultSetting" access="true"> "function.aclReload" access="true"> "function.aclSave" access="true"> "function.aclCreate" access="true"> "function.aclDestroy" access="true"> "function.aclSetRight" access="true"> "function.aclRemoveRight" access="true"> "function.aclCreateGroup" access="true"> "function.aclDestroyGroup" access="true"> "function.aclGroupAddACL" access="true"> "function.aclGroupRemoveACL" access="true"> "function.aclGroupAddObject" access="true"> "function.aclGroupRemoveObject" access="true"> "function.refreshResources" access="true"> "function.setServerConfigSetting" access="true"> "function.updateResourceACLRequest" access="true"> "command.aclrequest" access="true"> "general.adminpanel" access="true"> "general.tab_players" access="true"> "general.tab_resources" access="true"> "general.tab_server" access="true"> "general.tab_maps" access="true"> "general.tab_bans" access="true"> "general.tab_adminchat" access="true"> "command.kick" access="true"> "command.freeze" access="true"> "command.mute" access="true"> "command.setnick" access="true"> "command.shout" access="true"> "command.spectate" access="true"> "command.slap" access="true"> "command.setgroup" access="true"> "command.sethealth" access="true"> "command.setarmour" access="true"> "command.setmoney" access="true"> "command.setskin" access="true"> "command.setteam" access="true"> "command.giveweapon" access="true"> "command.setstat" access="true"> "command.jetpack" access="true"> "command.warp" access="true"> "command.setdimension" access="true"> "command.setinterior" access="true"> "command.createteam" access="true"> "command.destroyteam" access="true"> "command.givevehicle" access="true"> "command.repair" access="true"> "command.blowvehicle" access="true"> "command.destroyvehicle" access="true"> "command.customize" access="true"> "command.setcolor" access="true"> "command.setpaintjob" access="true"> "command.listmessages" access="true"> "command.readmessage" access="true"> "command.listresources" access="true"> "command.start" access="true"> "command.stop" access="true"> "command.stopall" access="false"> "command.restart" access="true"> "command.execute" access="true"> "command.setpassword" access="true"> "command.setwelcome" access="true"> "command.setgame" access="true"> "command.setmap" access="true"> "command.setweather" access="true"> "command.blendweather" access="true"> "command.setblurlevel" access="true"> "command.setwaveheight" access="true"> "command.setskygradient" access="true"> "command.setgamespeed" access="true"> "command.setgravity" access="true"> "command.settime" access="true"> "command.ban" access="true"> "command.unban" access="true"> "command.banip" access="true"> "command.unbanip" access="true"> "command.banserial" access="true"> "command.unbanserial" access="true"> "command.listbans" access="true"> "RPC"> "function.callRemote" access="true"> "general.adminpanel" access="false"> "general.tab_players" access="false"> "general.tab_resources" access="false"> "general.tab_maps" access="false"> "general.tab_server" access="false"> "general.tab_bans" access="false"> "general.tab_adminchat" access="false"> "command.kick" access="false"> "command.freeze" access="false"> "command.mute" access="false"> "command.setnick" access="false"> "command.shout" access="false"> "command.spectate" access="false"> "command.slap" access="false"> "command.setgroup" access="false"> "command.sethealth" access="false"> "command.setarmour" access="false"> "command.setmoney" access="false"> "command.setskin" access="false"> "command.setteam" access="false"> "command.giveweapon" access="false"> "command.setstat" access="false"> "command.jetpack" access="false"> "command.warp" access="false"> "command.setdimension" access="false"> "command.setinterior" access="false"> "command.givevehicle" access="false"> "command.repair" access="false"> "command.blow" access="false"> "command.destroy" access="false"> "command.customize" access="false"> "command.setcolor" access="false"> "command.setpaintjob" access="false"> "command.listmessages" access="false"> "command.readmessage" access="false"> "command.listresources" access="false"> "command.start" access="false"> "command.stop" access="false"> "command.stopall" access="false"> "command.restart" access="false"> "command.execute" access="false"> "command.setpassword" access="false"> "command.setwelcome" access="false"> "command.setgame" access="false"> "command.setmap" access="false"> "command.setweather" access="false"> "command.blendweather" access="false"> "command.setblurlevel" access="false"> "command.setwaveheight" access="false"> "command.setskygradient" access="false"> "command.setgamespeed" access="false"> "command.setgravity" access="false"> "command.settime" access="false"> "command.ban" access="false"> "command.unban" access="false"> "command.banip" access="false"> "command.unbanip" access="false"> "command.banserial" access="false"> "command.unbanserial" access="false"> "command.listbans" access="false"> "MapEditor"> "general.ModifyOtherObjects" access="true"> "function.startResource" access="true"> "function.stopResource" access="true"> "function.restartResource" access="true"> "function.createResource" access="true"> "function.copyResource" access="true"> "function.renameResource" access="true"> "function.deleteResource" access="true"> "function.addResourceMap" access="true"> "function.addResourceConfig" access="true"> "function.removeResourceFile" access="true"> "function.setResourceDefaultSetting" access="true"> "function.removeResourceDefaultSetting" access="true"> "function.xmlLoadFile" access="true"> "general.adminpanel" access="false"> "general.tab_players" access="false"> "general.tab_resources" access="false"> "general.tab_maps" access="false"> "general.tab_server" access="false"> "general.tab_bans" access="false"> "general.tab_adminchat" access="false"> "command.kick" access="false"> "command.freeze" access="false"> "command.mute" access="false"> "command.setnick" access="false"> "command.shout" access="false"> "command.spectate" access="false"> "command.slap" access="false"> "command.setgroup" access="false"> "command.sethealth" access="false"> "command.setarmour" access="false"> "command.setmoney" access="false"> "command.setskin" access="false"> "command.setteam" access="false"> "command.giveweapon" access="false"> "command.setstat" access="false"> "command.jetpack" access="false"> "command.warp" access="false"> "command.setdimension" access="false"> "command.setinterior" access="false"> "command.givevehicle" access="false"> "command.repair" access="false"> "command.blow" access="false"> "command.destroy" access="false"> "command.customize" access="false"> "command.setcolor" access="false"> "command.setpaintjob" access="false"> "command.listmessages" access="false"> "command.readmessage" access="false"> "command.listresources" access="false"> "command.start" access="false"> "command.stop" access="false"> "command.stopall" access="false"> "command.restart" access="false"> "command.execute" access="false"> "command.setpassword" access="false"> "command.setwelcome" access="false"> "command.setgame" access="false"> "command.setmap" access="false"> "command.setweather" access="false"> "command.blendweather" access="false"> "command.setblurlevel" access="false"> "command.setwaveheight" access="false"> "command.setskygradient" access="false"> "command.setgamespeed" access="false"> "command.setgravity" access="false"> "command.settime" access="false"> "command.ban" access="false"> "command.unban" access="false"> "command.banip" access="false"> "command.unbanip" access="false"> "command.banserial" access="false"> "command.unbanserial" access="false"> "command.listbans" access="false"> "raceACL"> "general.ModifyOtherObjects" access="true"> "function.xmlLoadFile" access="true"> "function.startResource" access="true"> "function.stopResource" access="true"> "function.restartResource" access="true"> "general.adminpanel" access="false"> "general.tab_players" access="false"> "general.tab_resources" access="false"> "general.tab_maps" access="false"> "general.tab_server" access="false"> "general.tab_bans" access="false"> "general.tab_adminchat" access="false"> "command.kick" access="false"> "command.freeze" access="false"> "command.mute" access="false"> "command.setnick" access="false"> "command.shout" access="false"> "command.spectate" access="false"> "command.slap" access="false"> "command.setgroup" access="false"> "command.sethealth" access="false"> "command.setarmour" access="false"> "command.setmoney" access="false"> "command.setskin" access="false"> "command.setteam" access="false"> "command.giveweapon" access="false"> "command.setstat" access="false"> "command.jetpack" access="false"> "command.warp" access="false"> "command.setdimension" access="false"> "command.setinterior" access="false"> "command.givevehicle" access="false"> "command.repair" access="false"> "command.blow" access="false"> "command.destroy" access="false"> "command.customize" access="false"> "command.setcolor" access="false"> "command.setpaintjob" access="false"> "command.listmessages" access="false"> "command.readmessage" access="false"> "command.listresources" access="false"> "command.start" access="false"> "command.stop" access="false"> "command.stopall" access="false"> "command.restart" access="false"> "command.execute" access="false"> "command.setpassword" access="false"> "command.setwelcome" access="false"> "command.setgame" access="false"> "command.setmap" access="false"> "command.setweather" access="false"> "command.blendweather" access="false"> "command.setblurlevel" access="false"> "command.setwaveheight" access="false"> "command.setskygradient" access="false"> "command.setgamespeed" access="false"> "command.setgravity" access="false"> "command.settime" access="false"> "command.ban" access="false"> "command.unban" access="false"> "command.banip" access="false"> "command.unbanip" access="false"> "command.banserial" access="false"> "command.unbanserial" access="false"> "command.listbans" access="false">
-
yes it have
-
please Help me
-
yes and not only race i can't start Map's
-
yes
-
local marker1 = createMarker ( 1253.0999755859, -1399, 12, 'cylinder', 11, 222, 222, 1, 225 ) local gate1 = createObject ( 980, 1252.8000488281, -1399.0999755859, 14.800000190735, 0, 0, 90 ) function movingObject ( hitElement, matchingDimension ) if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1413, 14.800000190735 ) end end function moveObjectBack () if getElementType ( hitElement ) == "player" then moveObject ( gate1, 3000, 1252.8000488281, -1399.0999755859, 14.800000190735 ) end end addEventHandler ( "onMarkerHit", marker1 , movingObject ) addEventHandler ( "onMarkerLeave", marker1, moveObjectBack ) what is wrong?
-
Yeh thnx its work but i can't start Maps now
-
but i don't have that resourses?
-
"Admin"> "SuperModerator"> "Admin"> "RPC"> "resource.Admin"> "resource.webadmin"> "user.paruyrh"> "resource.resedit"> "user.dino">
-
i add but nothing
-
it is "admin" startup="1" protected="0" /> its in mta.conf