-
Posts
467 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Gravestone
-
I meant the buttons you want to trigger onClienGUIClick on.
-
That is because onClientGUIClick will trigger also when the gui-elements parent (if any) is clicked too. To fix this, you need to set the fourth argument of addEventHandler as 'false'. Example: addEventHandler("onClientGUIClick", gui-element, function-name, false)
-
We do not help people using leaked/stolen scripts.
-
Yeah, haha.
-
That's actually GTA 16 meters ;D
-
For the onPlayerLevelUp event, you can use onElementDataChange event to check if the level data changed and then trigger the onPlayerLevelUp event.
-
You have to use the new way of posting codes. See the '<>' (code) button, it will allow you to paste codes.
-
20 m when you're infront of it? Can you send me a screenshot? It works perfectly for me whether the size is big or small.
-
Haha, no problem. Btw there's a function setFarClipDistance which lets you increase the draw distance.
-
It works fine for me.
-
warpPlayerIntoVehicle is a deprecated function, you'll have to use warpPedIntoVehicle in combination with createVehicle at server side, else, I don't there's a way through which you can create vehicle client side and warp the ped server sided. (Already tried)
- 8 replies
-
- warppedintovehicle
- player
-
(and 1 more)
Tagged with:
-
Use getPlayerTeam and check if the player is in the team you want the laser to be active for. Use createTeam to create teams.
-
Did you replace the getAll function with mine?
-
triggerServerEvent, triggerClientEvent
-
That is because: Line 11 checks if the getElementByID had returned the ID of the given element. In this case, you're using the first argument as a string, which has to be an element instead. Gimme some time, I'll try to figure it out. Edit: Done, here's how it will work: local sx_, sy_ = guiGetScreenSize ( ) local sx, sy = sx_/1440, sy_/900 function distanceFromPlayerToCheckpoint(player, i) g_Checkpoints = getAll("checkpoint") local checkpoint = g_Checkpoints[getElementData(player, "race.checkpoint")] if checkpoint == nil then return false end local x, y, z = getElementPosition(player) for i, v in ipairs(checkpoint) do outputChatBox(unpack(v)) end return getDistanceBetweenPoints3D(x, y, z, unpack(checkpoint.position)), unpack(checkpoint.size) end function getAll(name) local result = {} for i,element in ipairs(getElementsByType(name)) do result[i] = {} result[i].id = getElementID(element) or i local position = { tonumber(getElementData(element,"posX")), tonumber(getElementData(element,"posY")), tonumber(getElementData(element,"posZ")) } local size = { tonumber(getElementData(element, "size")) } result[i].position = position; result[i].size = size; end return result end function draw() local distance, size = distanceFromPlayerToCheckpoint(localPlayer) dxDrawText(distance-size*5, sx_ * 1.5200, sy_ * 0.9843, sx_ * 0.2172, sy_ * 1.0167, tocolor(0, 0, 0, 255), 0.55*sy, "bankgothic", "center", "top", false, false, false, false, false) end addEventHandler("onClientRender", root, draw)
-
This function checks the direction cursor is moving in, as @FaHaD said, use the last parameter of onClientClick.
-
I don't know if this is true or not, but you can try what @dugasz1 said. Also, if you want to warp the player into vehicle you can use the following: -- client -- function createLocalVehicle() local vehicle = createVehicle(model, x, y, z) triggerServerEvent("onClientWarpRequest", localPlayer, vehicle) end -- handler here -- server -- function warpPlayerToLocalVehicle(vehicle) if isElement(vehicle) then warpPedIntoVehicle(source, vehicle) end end addEvent("onClientWarpRequest", true) addEventHandler("onClientWarpRequest", root, warpPlayerToLocalVehicle) Edit: I just see warpPedIntoVehicle is a shared function, what are you talking about?
- 8 replies
-
- warppedintovehicle
- player
-
(and 1 more)
Tagged with:
-
I guess you'll have to sync the drawing between server and client.
-
Calculating screen position, centering, and scaling based on resolution
Gravestone replied to Backsage's topic in Scripting
Yeah, glad you figured it out. -
Do you realize that you bumped a 3 year old post? -.-
-
You can not, I guess some moderator will move this topic to that section. Just informed you for next time.
-
You have to post your request in this section.
-
Double posting is against rules.
-
Isn't this topic same as this one?