Jump to content

Gravestone

Members
  • Posts

    467
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Gravestone

  1. I meant the buttons you want to trigger onClienGUIClick on.
  2. 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)
  3. We do not help people using leaked/stolen scripts.
  4. For the onPlayerLevelUp event, you can use onElementDataChange event to check if the level data changed and then trigger the onPlayerLevelUp event.
  5. You have to use the new way of posting codes. See the '<>' (code) button, it will allow you to paste codes.
  6. 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.
  7. Gravestone

    draw distance

    Haha, no problem. Btw there's a function setFarClipDistance which lets you increase the draw distance.
  8. 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)
  9. Use getPlayerTeam and check if the player is in the team you want the laser to be active for. Use createTeam to create teams.
  10. Did you replace the getAll function with mine?
  11. 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)
  12. This function checks the direction cursor is moving in, as @FaHaD said, use the last parameter of onClientClick.
  13. 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?
  14. I guess you'll have to sync the drawing between server and client.
  15. Gravestone

    draw distance

    Do you realize that you bumped a 3 year old post? -.-
  16. You can not, I guess some moderator will move this topic to that section. Just informed you for next time.
  17. You have to post your request in this section.
  18. Double posting is against rules.
  19. Isn't this topic same as this one?
×
×
  • Create New...