Jump to content

Tails

Members
  • Posts

    740
  • Joined

  • Days Won

    16

Everything posted by Tails

  1. Try youtube.com or mtasa.com which should work without requesting the domains Else try adding port 80 after localhost like "localhost:80/index.html"
  2. You're setting the URL too fast. Use the browser events. You'll need to use this one: https://wiki.multitheftauto.com/wiki/OnClientBrowserCreated
  3. A quick and easy way would be to add this if (getZoneName(player.position, true) == "Las Venturas") then return end --> function spawn( player ) if getZoneName(player.position, true) == "Las Venturas" then return end local rnd = math.random( 1, #spawns ) setElementPosition( player, spawns[rnd][1], spawns[rnd][2], spawns[rnd][3] ) end addCommandHandler("pvp",spawn)
  4. Tails

    Safe zone

    Try adding this if attacker ~= localPlayer then
  5. What part are you stuck with? Please provide some actual code so we can help you with it.
  6. I've never heard of anti-bounce. What is it?
  7. if not z == 20 then Is what you're doing but z will probably never be 20 exactly, so do z >= 20 instead. return then you're returning but that doesn't stop the object use stopObject() and then return it. Hope this helps.
  8. I've used this animation before, pretty sure it's this one setPedAnimation(elem, "ped", "floor_hit", 1000, false, true, false);
  9. (exports.SACGpolice:getWantedLevel(Player) == 0) that's a syntax error there, you probably want to return the statement return (exports.SACGpolice:getWantedLevel(Player) == 0)
  10. 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
  11. 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
  12. 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.
  13. 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)
  14. You are right. Go to this link https://wiki.multitheftauto.com/wiki/ToggleControl and check out the examples.
  15. Pattern matching could be a solution here local slot1 = getElementData(localPlayer, "slot1") if slot1:match("key:%w") then
  16. 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
  17. 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.
  18. 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);
  19. 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.
  20. You probably forgot to spawn the player or fade the camera back in. Use fadeCamera to remove the black screen.
  21. 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.
  22. You'll only need the player https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html ~90 MB
  23. 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.
×
×
  • Create New...