Jump to content

SnoopCat

Members
  • Posts

    413
  • Joined

  • Last visited

Everything posted by SnoopCat

  1. soo i have made this for server side.... its ok? addEventHandler("onResourceStart", getRootElement(), function water() setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end setTimer ( water, 275, 0 ) addEventHandler ( "onResourceStart", root, water ) addEventHandler("onResourceStart", getRootElement(), function() setSkyGradient( math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) ) end) setTimer(setSkyGradient, 275, 0 ) function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) setVehicleColor ( car, color[1], color[2], color[3] ) end end setTimer( randomVehColors, 275, 0 ) pd its not working on the sv
  2. i have to use server side or client side to make this script???? im confused
  3. this is what i do now and is nto working i place dit server side and i do this: addEventHandler("onClientResourceStart", getRootElement(), function() resetWaterColor() resetSkyGradient() resetVehicleColor() end) addEventHandler("onClientResourceStart", getRootElement(), function water() setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end setTimer ( water, 275, 0 ) addEventHandler ( "onClientResourceStart", root, water ) addEventHandler("onClientResourceStart", getRootElement(), function() setSkyGradient( math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) ) end) setTimer(setSkyGradient, 275, 0 ) function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) setVehicleColor ( infernus, color[1], color[2], color[3] ) end end setTimer( randomVehColors, 275, 0 )
  4. hi mi problem is i want to do sky color, car color and water color change randmly but degraded. and its not doing nothing... can someone says me what im doing wrong or just help me? addEventHandler("onClientResourceStop", getRootElement(), function() resetWaterColor() resetSkyGradient() resetVehicleColor() end) addEventHandler("onClientResourceStart", getRootElement(), function water() setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end setTimer ( water, 275, 0 ) addEventHandler ( "onResourceStart", root, water ) addEventHandler("onClientResourceStart", getRootElement(), function() setSkyGradient( math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ), math.random( 0, 255 ) ) end) setTimer(setSkyGradient, 275, 0 ) function randomVehColors() for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,255) color[2] = math.random(0,255) color[3] = math.random(0,255) color[4] = math.random(0,255) colors setVehicleColor ( 411, color[1], color[2], color[3], color[4] ) end end setTimer( randomVehColors, 275, 0 )
  5. here is the new lexus map feath zeath.
  6. Can u answerd plz? can u make it play in 3d?
  7. SnoopCat

    Ingame radio

    download link???? and it plays sound in 3d?
  8. but that only works on foot i mean to work 3d in cars too
  9. can u make the radios play in 3d?
  10. hey hello i have downloaded a script from the comunity and i want to edit them because when u put 3d sound it attach the sound to a radio on the floor... my question is how i can do that sound attach to my vehicle? 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 sound = playSound3D (path, x,y,z) setSoundVolume (sound, volume) setSoundMaxDistance (sound, 20) 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] 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 newZ = z - 1 local obiekt = createObject (2226, newX, newY, newZ, rx,ry,rz) 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 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) and there is a radio.xml file where u can add your own songs or radio stations... pleace help
  11. hey good news for you i just want to release this maps to the public, please dont change the name and say its your. [DM]Party Rocks: DOWNLOAD LINK: http://www.mediafire.com/?0p02t63f9jlbtuq [DM] Back To the Future: This map has Special Textures Maded By Benox.exe DOWNLOAD LINK: http://www.mediafire.com/?bz8yfpasb67imcq
  12. here is my newste mpa i created we can talk if you want the map
  13. it is just fixed but when i put it on my non Testing server it haves the same problems
  14. that is just added look GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end
  15. thx now is working fine and now how i can hide the mouse when i push the play as not loged in button?
  16. not showing gui now this is what i get on the debugscript 3
  17. here is the image of debugscript 3 i rrly dont know what they means
  18. hello mi problem is that when i put my login on the server the gui appears but i cant register or login and when i choose the jugar sin registrarse buton that means Play not legged in the mouse is still showing and dont dissapears can someone help me?? here is the code: client: local localPlayer = getLocalPlayer () GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Window[1] = guiCreateWindow(201,213,255,341,"Welcome",false) GUIEditor_Edit[1] = guiCreateEdit(76,58,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[2] = guiCreateEdit(76,96,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(11,65,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[1],"top") guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(12,101,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[2],"top") guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(19,180,212,22,"O si eres Nuevo Registrate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[3],"top") guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(20,27,212,22,"Bienvenido porfavor Logeate",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],255,150,255) guiLabelSetVerticalAlign(GUIEditor_Label[4],"top") guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Button[1] = guiCreateButton(133,142,101,31,"Logear",false,GUIEditor_Window[1]) GUIEditor_Edit[3] = guiCreateEdit(74,202,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Edit[4] = guiCreateEdit(74,240,157,35,"",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(10,208,63,21,"Usuario",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[5],"top") guiSetFont(GUIEditor_Label[5],"default-bold-small") GUIEditor_Label[6] = guiCreateLabel(7,245,64,24,"Contrasena",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[6],255,255,255) guiLabelSetVerticalAlign(GUIEditor_Label[6],"top") guiSetFont(GUIEditor_Label[6],"default-bold-small") GUIEditor_Button[2] = guiCreateButton(133,284,101,31,"Registrarse",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(20,289,100,38,"Jugar Sin registrarse",false,GUIEditor_Window[1]) function closeThis() if (source == GUIEditor_Button[3]) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) end end function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible ( GUIEditor_Window[1], true ) guiSetInputEnabled(true) showCursor ( true ) end function onClickBtn ( button, state ) if (source == GUIEditor_Button[1]) then triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) ) end end function onClickBtn2 ( button, state ) if (source == GUIEditor_Button[2]) then triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword)) end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLoginWindow", true ) addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[1], onClickBtn, false ) addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], onClickBtn2, false ) addEventHandler("onClientGUIClick", GUIEditor_Button[3],closeThis,false) Server: function onLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) function onRegister ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "onRegister", true ) addEventHandler( "onRegister", getRootElement(), onRegister ) pease help
×
×
  • Create New...