Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. Aibo

    help please

    where is this event triggered and what is in housenumber variable?
  2. where is "vehicle" event is triggered? also i'd suggest using more explanatory names for events and functions rather than generic "vehicle" or "marker".
  3. opposite of == is ~=. opposite of false is true. you can also do: if someVariable then -- do some stuff if someVariable has any value except false or nil end
  4. Aibo

    Marker problem

    "onPlayerMarkerHit" is triggered by players, so player element is the source, and marker element is the first argument passed to the function. either edit your code or use "onMarkerHit" event instead.
  5. you're not really making it easy for people to understand, are you?
  6. if you're making a separate function, you should at least check if player is in a vehicle at all, otherwise getElementModel() will error. isTruck = function ( uPlayer ) if isPedInVehicle(uPlayer) then return getElementModel ( getPedOccupiedVehicle ( uPlayer ) ) == 437 else return false end end
  7. Aibo

    setElementData ??

    of any element. the data you set does not affect an element behavior (unless you script it). so no, you can't change player's max health with element data. iirc you cant change player's max health anyway, unless you script your own health system or extend the existing.
  8. Aibo

    setElementData ??

    and it is explained there how it works. you get the string key from your head, keeping in mind its purpose.
  9. Aibo

    setElementData ??

    where did you get this script? do you have any right to publish it here?
  10. hit element here is uPlayer. tbh i dont get why, fine with confusing prefixes like "uSomething" and unconventional semicolons. but hit element not necessarily is a player. so that name is misleading. and you should learn about variables and how do they work. this is programming basics.
  11. this is a single client code without any checks for element that hit the marker. so when 1 player hits the marker, the same event will be sent by multiple clients. it should only trigger if hitElement == localPlayer.
  12. Aibo

    setElementData ??

    "tempdata.originalnick" is a string, a key used to reference the element data. it has no source. state your question/problem more clearly.
  13. you never get any values for x,y,z: local locationTable = { { -2128, -80, 36 }, } function getRandomLocation ( ) return unpack ( locationTable [ math.random ( #locationTable ) ] ) end function buttonClick(button) if (source == acceptJob) and (button == "left") then triggerEvent ( "markerLocation3",lp ) end end addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true) addEvent ( "markerLocation3", true) function markerLocation () local x,y,z = getRandomLocation() markerLocation2 = createMarker ( x, y, z, "cylinder",250,250,250 ) blip = createBlipAttachtedTo ( markerLocation2, 53 ) end addEventHandler("markerLocation3",root,markerLocation) acceptJob = guiCreateButton(37,58,94,49,"Accept",false,truckWindow)
  14. нужно проверять, должно быть thePlayer == localPlayer вообще все можно в 1 функцию свернуть. и раз уж создаются элементы каждый раз, то вместо guiSetVisible лучше юзать destroyElement.
  15. postGUI должно быть true. хотя оно и так тру, дожно быть сверху, хз. вообще имхо легче стрелку и диск рисовать dxDrawImage.
  16. you are attaching nonexistent function to a nonexistent marker. and "end" for function is missing. fix it yourself.
  17. Aibo

    Creating GUIs

    i've been working with graphics and stuff for many years, i pretty much know what coordinates should i put to get something in position
  18. Aibo

    Creating GUIs

    when you got the layout figured out its not that hard to script it in using coordinates.
  19. Aibo

    Creating GUIs

    i create GUIs without any tools.
  20. first function is redundant and wrong, so i didnt read the rest.
  21. Aibo

    Convert numbers

    -- will return STRING in the form of "00:00" function convertTime ( time ) local min = math.floor ( time / 60000 ) local sec = time / 1000 % 60 return string.format("%02d:%02d", min, sec) end
  22. read lua manuals. function displayTab(number) if number == 1 then showInformationWindow () elseif number == 2 then showCommandWindow () end end
×
×
  • Create New...