xyz
Members-
Posts
78 -
Joined
-
Last visited
Everything posted by xyz
-
What? I don't want to trigger this on literally every colshape I leave. That colshape is the only colshape in that resource so I can use resourceRoot. I didn't ask for that. resourceRoot works well as it is. Also, I'm not leaving the colshape, just going behind a wall, how is leaving the colshape going to help in any way?
-
So I am making a robbery script with guards, but the guards only hit me when I restart the script near them. When I go behind a wall and come back their aim is off, and they don't hit me. It sometimes looks like the bullet goes into me but no damage. function cancelUnkillableDamage(p, md) if (isElement(p)) then if (p.type ~= "player") then return end addEventHandler("onClientRender", root, function() for _, v in ipairs(Element.getAllByType("ped")) do if (v:getData("ms:guard") == true) then local x, y, z = getPedBonePosition(p, 3) local px, py, pz = getElementPosition(v) local dg = findRotation(px, py, x, y) setPedAimTarget(v, x, y, z) setPedControlState(v, "fire", true) setElementRotation(v, 0, 0, tonumber(dg)) end end end) end end addEventHandler("onClientColShapeHit", resourceRoot, cancelUnkillableDamage)
-
Doesn't look like you get playerPos from anywhere, can you post the function that triggers the checkPlayerPos event
-
What makes the function get executed? Also the chances of being exactly at those coordinates are really slim.
-
onClientGUIScroll, guiScrollBarGetScrollPosition(scroll) / amount is what I use to limit the maximum
-
Change root to localPlayer and remove root completely
-
Second question is, how can I get ingame players to a browser site? inb4 no one knows
-
Simply, does MTA have any connection thing that like starts it up and connects to a server if it's not started up or anything, if it does can I have an example? EDIT: From a webpage like from google chrome.
-
Loop through all the players and use getDistanceBetweenPoints3D to check if they're near enough.
-
So I made a script that creates a vehicle in the air, and the vehicle needs to drop instantly, but it doesnt as it's not rendered for anyone. Is there way to make it drop instantly?
-
I do create a new table for every new user addEventHandler("onPlayerLogin", root, function() local acc = getPlayerAccount(source) local accn = getAccountName(acc) dbExec(con, "CREATE TABLE IF NOT EXISTS "..accn.." ('num', 'model', 'x', 'y', 'z', 'yRot', 'r', 'g', 'b', 'fuel', 'hp', 'plate', 'upgrades')") end)
-
Doesn't work, the problem here is that it doesn't get the stuff from the table, it just inserts nil and false into the gridlist.
-
I changed it, these are the errors I get. And yes the vehicles are saved to the database.
-
So I'm trying to make a vehicle system, and I can't get the stuff from SQL database to gridlist. -- Client function insertVehs(res) for _, vehn in ipairs(res) do local num, model, x, y, z, yRot, r, g, b, fuel, hp, plate, upgrades = unpack(vehn) local row = guiGridListAddRow(p.g) guiGridListSetItemText(p.g, row, 1, num, false, false) guiGridListSetItemText(p.g, row, 2, getVehicleNameFromModel(model), false, false) guiGridListSetItemText(p.g, row, 3, hp, false, false) guiGridListSetItemText(p.g, row, 4, fuel, false, false) end end addEvent("vehs:insertVehsIntoGui", true) addEventHandler("vehs:insertVehsIntoGui", root, insertVehs) bindKey("F3", "down", "vehicles") function openPGui() local state = not guiGetVisible(p.w) guiSetVisible(p.w, state) showCursor(state) triggerServerEvent("vehs:getVehicles", localPlayer) end addCommandHandler("vehicles", openPGui) -- Server function getActualVehs(qh, source) local res = dbPoll(qh, 0) triggerClientEvent(source, "vehs:insertVehsIntoGui", source, res) end function getVeh() local acc = getPlayerAccount(client) local accn = getAccountName(acc) dbQuery(getActualVehs, {client}, con, "SELECT * FROM "..accn) end addEvent("vehs:getVehicles", true) addEventHandler("vehs:getVehicles", root, getVeh)
-
Do you have an actual police team? If so, change it so that team can use it, as that faction thingy might cause problems
-
I helped you to start off, use dxDrawText and getTimerDetails to get the seconds thing. You won't learn if we do it for you
-
setTimer( function () for _, v in ipairs(getElementsByType("player")) do if (isPedInVehicle(v)) then local x, y, z = getElementPosition(v) local veh = getPedOccupiedVehicle(v) destroyElement(veh) veh = nil vehicle = createVehicle(vehicle id here, x, y, z) warpPedIntoVehicle(v, vehicle) end end end, 15000, 0 ) This is what you mean? Just use math.random to change vehicle
-
Showchat and showhud aren't that big of a problem in most cases, you can just cancel the chat event 'onPlayerChat' if the player isn't logged in. EDIT: You can probably disable showchat and showhud with canceling OnPlayerCommand, havent tested it
-
Got it working, thanks anyway.
-
bad argument #1 to 'gsub' (string expected, got nil)
