-
Posts
1,134 -
Joined
-
Last visited
-
Days Won
37
Everything posted by NeXuS™
-
function ujraeledes() local varjalMar = setTimer( function() spawnPlayer (source, 0, 0, 0) setCameraTarget (source, source) fadeCamera (source, true) triggerClientEvent ("stopHalalMusic", source) end, 120000, 1) end)
-
Alright, now you have to explain your problem better. Because we can't understand nothing at all.
-
addEventHandler("onClientRender", getRootElement(), function() local pX, pY, pZ = getElementPosition(localPlayer) for i, k in ipairs(getElementsByType("vehicle")) do if getElementData(k, "customName") then local cX, cY, cZ = getElementPosition(k) if getDistanceBetweenPoints3D(cX, cY, cZ, pX, pY, pZ) <= 20 then local ignoredElement = getPedOccupiedVehicle(localPlayer) and getPedOccupiedVehicle(localPlayer) or localPlayer if isLineOfSightClear(cX, cY, cZ+1, pX, pY, pZ+1, true, true, true, true, true, false, false, ignoredElement) then local cX, cY = getScreenFromWorldPosition(cX, cY, cZ+1) if cX and cY then dxDrawText(getElementData(k, "customName"), cX, cY) end end end end end end)
-
Just calculate the position. You can attach an element to the car and set it's collision to false, and then create the text on that object. Whatever you want. The script itself works totally fine for me wo/ any disappearing. Do you have any errors in debugscript mode?
-
Found it. local fontTab = {} function mtrxButton(a, b, c, d, text, fontSize, r, g, bc, parent) local button local label if (parent) then outputChatBox(b) button = guiCreateButton(a, b, c, d, text, false, parent) --button = guiCreateStaticImage(a, b, c, d, ":test_font/button_green.png", false, parent) outputChatBox("Created w/ parent") outputChatBox(a .. " " .. b .. " " .. c .. " " .. d) else --button = guiCreateStaticImage(a, b, c, d, ":test_font/button_green.png", false) button = guiCreateButton(a, b, c, d, text, false) outputChatBox("Created wo/ parent") end label = guiCreateLabel(0, 0, c, d, text, false, button) setMtrxFont(label, fontSize) guiLabelSetColor(label, r, g, bc) guiLabelSetHorizontalAlign(label, "center", true) guiLabelSetVerticalAlign(label, "center") addEventHandler("onClientMouseEnter", label, function() guiStaticImageLoadImage(button, ":test_font/button_red.png") end, false) addEventHandler("onClientMouseLeave", label, function() guiStaticImageLoadImage(button, ":test_font/button_green.png") end, false) return button, label end function setMtrxFont(gui, fontSize) for i = 1, #fontTab do if (fontTab[i][1] == fontSize) then guiSetFont(gui, fontTab[i][2]) return end end table.insert(fontTab, {}) fontTab[#fontTab][1] = fontSize fontTab[#fontTab][2] = "default-bold" --fontTab[#fontTab][2] = guiCreateFont("default", fontSize) end GUIEditor = { img = {}, window = {}, mtrxButt = {} } GUIEditor.window[1] = guiCreateWindow(194, 111, 391, 237, "", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.img[1], GUIEditor.mtrxButt[1] = mtrxButton(48, 45, 104, 51, "I'm the button #1", 10, 0, 0, 0, GUIEditor.window[1]) GUIEditor.img[2], GUIEditor.mtrxButt[2] = mtrxButton(200, 107, 144, 60, "I'm the button #2", 11, 0, 0, 0, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) local x, y = guiGetPosition(GUIEditor.img[1], false) outputChatBox(x .. " " .. y) addCommandHandler("buttest", function() guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) showCursor(not isCursorShowing()) end) You had the "b" for the y and "b" for the blue color. Btw, sorry for all that :~ in there, just change your main code by renaming one of the "b"s in your function.
-
I think it's because the player's model is blocking the isLineOfSightClear function. Try this one. addEventHandler("onClientRender", getRootElement(), function() local pX, pY, pZ = getElementPosition(localPlayer) for i, k in ipairs(getElementsByType("vehicle")) do if getElementData(k, "customName") then local cX, cY, cZ = getElementPosition(k) if getDistanceBetweenPoints3D(cX, cY, cZ, pX, pY, pZ) <= 20 then if isLineOfSightClear(cX, cY, cZ+1, pX, pY, pZ+1, true, true, true, true, true, false, false, localPlayer) then local cX, cY = getScreenFromWorldPosition(cX, cY, cZ+1) if cX and cY then dxDrawText(getElementData(k, "customName"), cX, cY) end end end end end end)
-
function handlerFunction(thePlayer) local oX, oY, oZ = getElementPosition(ggate) if oZ ~= defz then gateclose(thePlayer) else gateopen(thePlayer) end end addEventHandler("onResourceStart," getResourceRootElement(), function() for i, k ipairs(getElementsByType("player")) do bindKey(k, "K", "down", handlerFunction) end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "K", "down", handlerFunction) end) bindKey arguments were :Oed.
-
So you might have an error inside your mtrxButton function. I'm gonna run through it, maybe I can see something in there.
-
Did you try creating those images just by guiCreateStaticImage to see if they are created or not?
-
function handlerFunction(thePlayer) local oX, oY, oZ = getElementPosition(ggate) if oZ ~= defz then gateclose(thePlayer) else gateopen(thePlayer) end end addEventHandler("onResourceStart," getResourceRootElement(), function() for i, k ipairs(getElementsByType("player")) do bindKey(k, "down", handlerFunction) end end) addEventHandler("onPlayerJoin", getRootElement(), function() bindKey(source, "down", handlerFunction) end) I think this one should work.
-
I think what you could do, is 1. getElementsByType("colshape") 2. Cycle through them by for 3. Create a vehicle by createVehicle on their positions 4. Check if that vehicle is on the ground 5. Destroy the vehicle 6. If it was on the ground, don't do anything 7 If it wasn't, destroy the colshape.
-
I don't know what's happening with your script. Mine works just totally fine without even ACL permission to it. Oh my god, I just misunderstood your problem, give me a minute :DD. So, what you'll have to do, is go to your ACL.xml, and set the acccess to true at the commands you wish to enable. (Change the "Default" ACL permissions.) <right name="command.aexec" access="true"></right> And after, use my script, so only the players who are inside that serial table can use those commands. By doing this, everyone would be able to use those commands, so make sure that THIS script is running.
-
Haha @harryh, and I haven't seen that mistake before.
-
Try outputing it's position.
-
It's not returning false. Your if statement is :Oed up. local hostname = "127.0.0.1" local username ="root" local password = "" local database = "testserver" local sqlConnection = dbConnect( "mysql", "dbname=".. database ..";host="..hostname.."", ""..username.."",""..password.."" ) function loadObjects() local nrQuery = dbQuery(sqlConnection, "SELECT * FROM landobjects") local rQuery = dbPoll( nrQuery, -1 ) if (rQuery) then if (loaded == 0) then for _, row in ipairs(rQuery) do if (not row) then break end local mid = row["mid"] if (not mid) then outputChatBox( "No model ID", getRootElement( )) break end local ox = row["ox"] local rox = row["rox"] local oy = row["oy"] local roy = row["roy"] local oz = row["oz"] local roz = row["roz"] local object = createObject( mid, oz, oy, oz, rox, roy, roz) local ds = function() if (row["ds"] == 1) then setElementDoubleSided( object, true ) else setElementDoubleSided( object, false ) end end table.insert(LCobs, object) triggerClientEvent( "objectStream", client, object, mid ) loaded = 1 end else clearLoadedObjects() loadObjects() loaded = 0 outputChatBox( "Objects Reloaded" ) end else outputChatBox( "No Objects to Load") end end addCommandHandler( "loadall", loadObjects )
-
Try outputing the number of elements inside your table. outputChatBox(#rQuery)
-
Give me a minute, gonna test it. Works totally fine for me, with access in the ACL.xml. Are ya calling aexec somewhere in your script? Can you copy your ACL.xml for me please? *EDIT* Works totally fine WITHOUT any access in ACL.xml.
-
Is it up on your phpMyAdmin?
-
Give the resource ACL permission. <object name="resource.resourcename"/> Add this to your ACL.xml and replace the resourcename with the actual reosources name, or if you have only your resources installed, you can do resource.*
-
local allowedSerials = { ["serialhere"] = true } local blockedCommands = { ["debugscript"] = true, ["stop"] = true, ["etc"] = true, } addEventHandler("onPlayerCommand", getRootElement(), function(commandName) if blockedCommands[commandName:lower()] then if not allowedSerials[getPlayerSerial(source)] then cancelEvent() end end end) I think this one should work.