Jump to content

Tails

Members
  • Posts

    731
  • Joined

  • Days Won

    10

Everything posted by Tails

  1. I've used this animation before, pretty sure it's this one setPedAnimation(elem, "ped", "floor_hit", 1000, false, true, false);
  2. (exports.SACGpolice:getWantedLevel(Player) == 0) that's a syntax error there, you probably want to return the statement return (exports.SACGpolice:getWantedLevel(Player) == 0)
  3. it does return just 3, print just outputs both arguments it returns. local text = "test3test3" local num, count = text:gsub('test', '') print(num) --> 33 print(count) --> 2
  4. The client event is triggered for all clients you'd have to add a check as well then. Put the code on the client side as well as the marker and use the onClientMarkerHit event. The event's callback returns 2 arguments, the element that hit the marker and the matching dimension. Ignore the latter for now. Example: local mark = createMarker(0, 0, 4, "arrow", 1) function onHit(element) if (element == localPlayer) then -- check if the element is the localPlayer (you) outputChatBox("hit") end end addEventHandler("onClientMarkerHit", mark, onHit) Hope this helps
  5. You could attach a smoke effect https://wiki.multitheftauto.com/wiki/CreateEffect Why not learn and do it yourself? This forum isn't for script requests, it's for help. We can only help you if you get stuck with your code.
  6. Here's how to display a YouTube video on the screen for everybody. I hope this will help you. local url = "https://www.youtube.com/tv#/watch/video/control?v=iZAqaykiS70&resume" local sw, sh = guiGetScreenSize() local browser = Browser(sw, sh, false, false) addEventHandler("onClientBrowserCreated", browser, function() browser:loadURL(url) end) addEventHandler("onClientRender", root, function() dxDrawImage(0, 0, sw, sh, browser) end)
  7. You are right. Go to this link https://wiki.multitheftauto.com/wiki/ToggleControl and check out the examples.
  8. Pattern matching could be a solution here local slot1 = getElementData(localPlayer, "slot1") if slot1:match("key:%w") then
  9. If you don't know, you should get rid of the element data and try experimenting with just tables. Look up some tutorials on tables and get used to them then afterwards you can use element data to sync data from a table. Here are a few links: https://devilsquid.com/lua-tables/ http://www.troubleshooters.com/codecorn/lua/luatables.htm https://www.tutorialspoint.com/lua/lua_tables.htm http://lua-users.org/wiki/TablesTutorial https://en.wikibooks.org/wiki/Lua_Programming/Tables
  10. Not quite sure if I understand but it looks like you're trying to check if "slot1" contains any key and then proceed with some code. There are different ways you can probably approach this. First is a table, which would be smarter because it is faster than element data and element data is not very safe. If this is the server side I think you should be fine but still personally I'd go with an actual table. What you can do is just simply check if any element data exists on "slot1" by just doing if getElementData (localPlayer, "slot1") then --draw key image in inventory else --slot 1 is blank end if you set the "slot1" data to nil or false setElementData("slot1", nil) then it will return false and execute the second part of your code. If this is not what you meant, please try to explain your issue a bit more.
  11. Divide the size by the distance. For example: local d = getDistanceBetweenPoints3D(x, y, z, Mx, My, Mz); dxDrawRectangle(x, y, 500/d, 250/d); dxDrawText("Pay'n'Spray", x, y, x, y, tocolor(255,0,0), 55/d);
  12. Because the vehicle doesn't exist on the client, at least not the variable. Place the 2 functions on the server side in your function under createVehicle.
  13. You probably forgot to spawn the player or fade the camera back in. Use fadeCamera to remove the black screen.
  14. You can't really get any information from world models as they're not elements. However you can use process line, I think that's how the editor does it. Check: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight and look at the examples. Process line returns information about what it hits, including ids.
  15. You'll only need the player https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html ~90 MB
  16. Even simpler: local sw, sh = 1920, 1080; local cw, ch = guiGetScreenSize(); function rect(...) return dxDrawRectangle(arg[1]/sw*cw, arg[2]/sh*ch, arg[3]/sw*cw, arg[4]/sh*ch, arg[5], arg[6], arg[7]); end EDIT: By the way, there are many threads about the same issue with different solutions. Try the search button.
  17. It could mean a 100 different things if you don't show us some code. You can concat tables with table.concat. For e.x.: local a = {"a", "b", "c"} print(a[1]..", "..a[2]) --> "a, b" print(table.concat(a, ", ")) --> "a, b, c"
  18. You have to post the rest of the code. Where you're setting the element data and where you're using asdfg.
  19. remove local from radlinks and radrechts in your function local radLinks, radRechts function radExit() local Vehicle = getVehicleController(source) radLinks, radRechts = getVehicleComponentRotation(Vehicle, "wheel_lf_dummy"), getVehicleComponentRotation(Vehicle, "wheel_rf_dummy") setVehicleComponentRotation(Vehicle, radLinks) setVehicleComponentRotation(Vehicle, radRechts) end addEventHandler("onVehicleExit", getRootElement(), radExit)
  20. There's nothing you can do. What you can do is add a small timer to when the player's screen will be visible (you can use fadeCamera) and freeze the player temporarily so they don't fall through the ground.
  21. local stream local volume = 1 function CambiarEstacionOnline(cmd,url) if (url) then if (isElement(stream)) then stopSound(stream) end stream = playSound(url) setSoundVolume(stream, volume) end end addCommandHandler("radio",CambiarEstacionOnline) function muteStream() if (isElement(stream)) then volume = volume == 1 and 0 or 1 setSoundVolume(stream, volume) end end addCommandHandler("mute",muteStream) I hope this is what you were looking for. I have a really hard time understanding you.
  22. Would be nice if you told people what you did to fix it. Now you're just wasting everyone's time reading this topic.
  23. Yeah, you could edit the original resource. https://github.com/multitheftauto/mtasa-resources/blob/master/[gameplay]/playerblips/playerblips.lua Under line 32 add another line: blip[plr]:setVisibleDistance(50) replace the number with anything you like.
  24. setElementParent(towTruck, nil)
  25. Make it client side and exclude the local player when you're creating the blips for the players Also use https://wiki.multitheftauto.com/wiki/SetBlipVisibleDistance to set the visible distance
×
×
  • Create New...