Jump to content

Adolfram

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by Adolfram

  1. nginx ftw you're free to use external webserver and as @CodyJ(L) said it may improve your speed. check /ipb ig to see cpu and ram usage that might be the trouble. contact to your host for your bw stats and check them out, might be a dos attack or something
  2. i had a similar issue, i did a magic fix with string gsub. it goes news_:gsub("\n", "\\n");
  3. there are so many wrong things in your code. first of all, for i, eventVeh in ipairs ( eventVehicles[eventManager] ) do triggerClientEvent("disable_aircars", source, eventVeh) end this is ok but in client, for i, veh in ipairs(getElementsByType("vehicle")) do if isWorldSpecialPropertyEnabled("aircars") then setWorldSpecialPropertyEnabled("aircars", true, eventVeh) end this makes it all wrong. there is no 3rd arg in that function so the loop is useless. if you want to make it only enabled when a player gets in the event car, pass the event vehicles to client and check on onClientVehicleEnter and then enable property.
  4. solved it, turns out i had to use downloadFile function before enabling the mod even though client had downloaded it earlier.
  5. hi, i'm getting "Attempt to load "...mod.txd" before onClientFileDownloadComplete event" error even tho i have downloaded the files, i couldn't figure out why.
  6. yeah you're right but still gotta use math to part the string line by line, i think i can do it when i get home
  7. Adolfram

    Lock System

    lol no. it checks if the member is the vehicle is being entered to, here if source == veh.v then
  8. Adolfram

    Lock System

    veh represents all the sub tables, have you tried the code? because i did and it actually works, lol
  9. Adolfram

    Lock System

    sure thing, i couldn't understand the purpose at first. my bad, glad it worked out for you
  10. Adolfram

    Lock System

    edited the code, take a look please
  11. Adolfram

    Lock System

    can you please try this addEventHandler("onVehicleStartEnter",root,function(player,seat) if seat == 0 then if personalCar[player] then if not source ~= personalCar[player].v then if personalCar[player].locked == true then cancelEvent() outputChatBox("This vehicle is locked!",player,0,255,255) end end end end end) if you are trying to check if vehicle is locked and is not owned by the player who's entering you should addEventHandler("onVehicleStartEnter",root,function(player,seat) if seat == 0 then for i, veh in pairs (personalCar) do if source == veh.v and i~= player then if veh.locked == true then cancelEvent() outputChatBox("This vehicle is locked!",player,0,255,255) end end end end)
  12. Adolfram

    Lock System

    no, check that and then check personalCar[player].v. that's why you're getting errors, you're trying to index a nil value
  13. god it's lit. as a massive vc fan, please take my upvote
  14. i think you could do a custom wordreak with some math magic. but i have no clue how, sadly
  15. Adolfram

    help

    jacked is not defined in call911 function and i don't think it's a good idea to overwrite call function. you might want to change the table name to wantedPlayers or something
  16. local lines = 0 local wordbreak = false local str = tipBox.string while str:find ("#%x%x%x%x%x%x") do str = str:gsub('#%x%x%x%x%x%x', ''); end local lineWidth = dxGetTextWidth( str, 1, "default-bold" ) while ( lineWidth + offsetWidth > minimumWidth ) do lineWidth = lineWidth - minimumWidth lines = lines + 1 wordbreak = true end try this please
  17. right. you should remove {} tags around the URL strings, it should be like local URLMusics = { 'url', 'url' }
  18. Adolfram

    Lock System

    you should check if player's value is registered on table if personalCar[player] then -- end
  19. your usage of tables is wrong, i corrected it for you here: local TuningSound = playSound3D(URLMusics[randomize], 1383, -22, 1001, true) -- you don't need to turn it into a string and it's not how turning a variable/table into a string is done. you should use tostring for that but in your case, table member returns a string value (your url) so you don't need it at all secondly you don't need to set sound's dimension and interior on serverside, and you can't because it's not synced. so you can basically do move your "DimensionSond" script to client side and run it. here's how it should look like: function MusicTuning() local randomize = math.random ( #URLMusics ) local TuningSound = playSound3D(URLMusics[randomize],1383,-22,1001,true) setSoundMaxDistance(TuningSound,50) DimensionSond (TuningSound) end DIMS___ = 1 function DimensionSond(TuningSound) setElementDimension(TuningSound,DIMS___) setElementInterior(TuningSound,1) setElementPosition(TuningSound,1383,-22,1001) DIMS___ = DIMS___ + 1 end in the end, your code should look like: local URLMusics = { {'https://albireo1.sscdn.co/palcomp3/2/a/b/9/equipeinsanos-tribo-da-periferia-mussoumano-convida-6ec60699.mp3'}, {'https://japeto.sscdn.co/palcomp3/a/5/4/a/equipeinsanos-tribodaperiferia-carro-velho-ec4211d7-e7b4a010.mp3'} } function ShowDxMenuStartTuning() addEventHandler("onClientRender", root, DXMenuPrincipal) showCursor(true) PainelMenuPrincipal = true MusicTuning() end addEvent("ShowPainelMenuStartTuning", true) addEventHandler("ShowPainelMenuStartTuning", getRootElement(), ShowDxMenuStartTuning) function MusicTuning() local randomize = math.random ( #URLMusics ) local TuningSound = playSound3D(URLMusics[randomize],1383,-22,1001,true) setSoundMaxDistance(TuningSound,50) DimensionSond (TuningSound) end DIMS___ = 1 function DimensionSond(TuningSound) setElementDimension(TuningSound,DIMS___) setElementInterior(TuningSound,1) setElementPosition(TuningSound,1383,-22,1001) DIMS___ = DIMS___ + 1 end
  20. yeah sure, you can cut the color coded part when breaking the string and add it on later when rendering. for instance, say, you have a string "stringx3" and you want to cut out the "x3" part, you'd use; var = var:gsub ("x3", ""); i didn't expand the example to not to get in your way too much, tell me if you need further details though. good luck!
×
×
  • Create New...