Jump to content

1LoL1

Members
  • Posts

    944
  • Joined

  • Last visited

Everything posted by 1LoL1

  1. 1LoL1

    Solved..

    Hello, i created script but idk how to respawnVehicle if is in water. Can anyone help me please? i tried this but not work addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () car = createVehicle(id, x, y, z, rx, ry, rz) end) function RSP () if isElementInWater(car) then setTimer(respawnVehicle(car), 1000, 1) end end This work normally. addEventHandler("onVehicleExplode", getRootElement(), function () setTimer(respawnVehicle, 5000, 1, source) end)
  2. ElementData setElementData for health doesn't exist. Use setElementHealth & getElementHealth.
  3. Try this: db_name = "db" host = "host" user = "user" password = "pass" db = dbConnect( "mysql", "dbname="..db_name..";host="..host, user, password )
  4. So delete addEventHandler("Open", getRootElement(), open) addEventHandler("Close", getRootElement(), close)
  5. 1 - Where is defined "col" ? 2 - Where you created door you must put cordinates x, y, z now it's there only 1 not 3. Example: createObject(id, x, y, z, 90, 0, 0)
  6. Try this: door = createObject (974, 267.70001220703) -- here put cordinates function Open (pla) local vehicle = getPedOccupiedVehicle(pla) if getElementType ( pla ) == "player" then if vehicle or not vehicle then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then moveObject (door, 2200, 2743.29998779297, -2298, 4.3000001907349) -- here is where you enter the coordinatess of the new location of the object, 2200 = the speed of the movent. else outputChatBox("text", pla, 255, 255, 255, true) end end end end addEventHandler("onColShapeHit", col, Open) addEventHandler("Open", root, Open) function Close ( pla ) local vehicle = getPedOccupiedVehicle(pla) if getElementType ( pla ) == "player" then if vehicle or not vehicle then if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(pla)), aclGetGroup ( "Admin" ) ) then moveObject (door, 2951, 267.70001220703, -2298.1000976563, 4.3000001907349) -- here is where you copy the coordinates of the orginal location of the object, 2951 = the timer of movent. else outputChatBox("text", pla, 255, 255, 255, true) end end end end addEventHandler("onColShapeLeave", col, Close ) addEventHandler("Close", root, Close)
  7. 1LoL1

    [HELP] How

    1 - in comunity or created by me? 2 - idk 3 - Yes because I want him to fix
  8. 1LoL1

    [HELP] How

    Hello, i have this code but i don't know really why not work i want when i go traveled 100 meters i get 1x getElementData "M" i i go traveled 1000 meters i get 1 getElementData "KM" but not work function () if (isPedInVehicle(getLocalPlayer())) then x,y,z = getElementPosition(getLocalPlayer()) oX,oY,oZ = getElementPosition(getLocalPlayer()) distanceTraveled = getDistanceBetweenPoints3D(x,y,z,oX,oY,oZ) if distanceTraveled == 100 then setElementData(localPlayer, "M", (getElementData(localPlayer, "M") or 0) + 1) elseif distanceTraveled == 1000 then setElementData(localPlayer, "KM", (getElementData(localPlayer, "KM") or 0) + 1) end end end
  9. 1LoL1

    Solved

    oh work thanks !!!.
  10. 1LoL1

    Solved

    Hello, i need help. I know what is "getColorFromString" Example: color = "#00FF00" r, g, b = getColorFromString(color) -- result: 0, 255, 0 but my question is how i can to hex of RGB? Example: color = "0, 255, 0" -- result: 00FF00 how i can to this? please can anyone help me?
  11. 1LoL1

    boss

    addEvent("rocket", true) addEventHandler("rocket", root, function bossweapon (weapon, ammo) givePedWeapon(nemesi, 35, 5000, true) setPedWeaponSlot (nemesi, 7) end) addEventHandler("givePedWeapon", getRootElement(), bossweapon)
  12. 1LoL1

    boss

    Errors / Warnings?
  13. Try restart server if not work then sorry
  14. What not work? errors / warnings?
  15. 1LoL1

    boss

    addEvent ( "rocket", true ) addEventHandler ( "rocket", root, function bossweapon (weapon, ammo) givePedWeapon(nemesi, 31, 5000, true) end addEventHandler( "givePedWeapon", getRootElement(), bossweapon) -- here you had bosseapon not bossweapon
  16. 1LoL1

    boss

    Post the client-side code "rocket".
  17. 1LoL1

    What wrong ?

    Wrong? if he want set health he must use only setElementHealth not setElementData..
  18. 1LoL1

    What wrong ?

    Try this: addEvent("onZombieWasted", true) addEventHandler("onZombieWasted", getRootElement(), function (attacker) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(attacker)),aclGetGroup("Soldier")) then setElementHealth(attacker, (getElementHealth(attacker) or 0) + 5) end end)
  19. 1LoL1

    Solved

    ok it's solved (idk how to use "gettok" in the code)
  20. 1LoL1

    What wrong ?

    addEvent("onZombieWasted", true) addEventHandler("onZombieWasted", getRootElement(), function (attacker) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(attacker)),aclGetGroup("Soldier")) then if (getElementType ( attacker ) == "player") and (getElementType ( source ) == "ped") then setElementHealth(attacker, getElementHealth(attacker) + 5) end end end )
  21. 1LoL1

    Solved

    Pff i really don't know this function so i don't know how i can use in this my code.
  22. 1LoL1

    Solved

    Now in database is "255, 255, 255" but when i go setElementData(source, "RGB" its 3 in 1. So now how i can get to Car Lights??? Example: local w = {255,255,255} r = w[1] g = w[2] b = w[3] and lights will normally r, g, b
×
×
  • Create New...