Jump to content

ksTakor

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by ksTakor

  1. Thanks man, that will help a lot
  2. thanks Necktrox wow, this table is different from what i have seen, I only see tables more like that local VehiclesID = { {417}, {593}, {493}, {509}, {487}, {497} } how can i check for the id's in this type of table? I wish to learn this way too
  3. Hi, i am trying to learn tables but so far no success kk I wish to learn then I tried to pass this id's and the check if is one of then but i had no success if not getElementModel(veh) == 417 or getElementModel(veh) == 593 or getElementModel(veh) == 493 or getElementModel(veh) == 509 or getElementModel(veh) == 487 or getElementModel(veh) == 497 then Thanks in advanced and sorry for the english
  4. Today I used the setVehicleWheelStates and If I set my wheels to fallen off, then set then to inflated again, after that if I fix my vehicle the wheels will be invisible, anyone knows a workaround for this? It only happens in my script (tested with the wiki script and don't happen) my script is this: --server-- local tireOff = getElementData(getElementData(veh,"parent"),"Tire_inVehicle") -- check if there is tires in the vehicle (gamemode element) if tireOff == 0 then setVehicleWheelStates(veh, 2, 2, 2, 2) elseif tireOff == 3 then local wheel = math.random(1, 4) if wheel == 1 then setVehicleWheelStates(veh, 0, 0, 2, 0) elseif wheel == 2 then setVehicleWheelStates(veh, 2, 0, 0, 0) elseif wheel == 3 then setVehicleWheelStates(veh, 0, 0, 0, 2) elseif wheel == 4 then setVehicleWheelStates(veh, 0, 2, 0, 0) end elseif tireOff == 2 then local wheel = math.random(1, 4) if wheel == 1 then setVehicleWheelStates(veh, 2, 0, 2, 0) elseif wheel == 2 then setVehicleWheelStates(veh, 2, 0, 0, 2) elseif wheel == 3 then setVehicleWheelStates(veh, 0, 2, 0, 2) elseif wheel == 4 then setVehicleWheelStates(veh, 0, 2, 2, 0) end elseif tireOff == 1 then local wheel = math.random(1, 4) if wheel == 1 then setVehicleWheelStates(veh, 2, 2, 2, 0) elseif wheel == 2 then setVehicleWheelStates(veh, 2, 0, 2, 2) elseif wheel == 3 then setVehicleWheelStates(veh, 2, 2, 0, 2) elseif wheel == 4 then setVehicleWheelStates(veh, 0, 2, 2, 2) end end Then when the player add the tires I call an trigger event in the server to put back the wheels: --client-- triggerServerEvent("putwheels", resourceRoot, veh) This is the function that put back the wheels --server-- function putwheels (veh) local frontLeft, rearLeft, frontRight, rearRight = getVehicleWheelStates ( veh ) -- testing the wheels which are missing if frontLeft == 2 then setVehicleWheelStates (veh, 0) elseif rearLeft == 2 then setVehicleWheelStates (veh, 0, 0) elseif frontRight == 2 then setVehicleWheelStates (veh, 0, 0, 0) elseif rearRight == 2 then setVehicleWheelStates (veh, 0, 0, 0, 0) end end addEvent("putwheels", true) addEventHandler("putwheels", resourceRoot, putwheels) if I fix the vehicle after it put back the wheels, makes the wheels invisible:
  5. Oh, then that was the problem. haha Thanks
  6. I tried to use the code from the wiki: dxDrawEmptyRec( 350, 350, 100, 100, tocolor(255,0,255), 1, false ) then give me an error: mta attempt to call a global dxDrawRectangle the script is client side what is the problem? Thanks in advance
  7. ksTakor

    Check Water

    Strange I tried in some script and only when player is swimming return true.
  8. ksTakor

    Check Water

    this just return true if the player is swimming in water I want a way of detecting if the water is in his legs.
  9. ksTakor

    Check Water

    How can I check if the ped is near or touching water?
  10. ksTakor

    [Help]

    He is looking for the textures in the zombies/skins folder and your textures are on the zombies folder this way he can't find the textures, just create a folder called skins in the zombies folder and put the skins there.
  11. ksTakor

    [Help]

    is in wrong folder he is looking for the texture in the folder Dayz/skins and your skin are in a another folder. That's the problem, and sorry for the english
  12. @myonlake Can you give me a exemple, I try it but I can't make work.
  13. its possible to mask a HUD component like the radar?
  14. try this: https://community.multitheftauto.com/ind ... ls&id=5376
  15. ksTakor

    Help Weapons

    Solved, I just separated the secondary weapon from the primary.
  16. ksTakor

    Help Weapons

    I have a problem with my inventory when a player drop a primary weapon ex: M4 but left the ammo in the inventory. Then he equip a secondary weapon like a pistol, it equips again the m4. I think the script is checking the ammo in the inventory then giving the weapon, but I like that it check if the weapon is there. function rearmPlayerWeapon(weaponName, slot) takeAllWeapons(source) local ammoData, weapID = getWeaponAmmoType(weaponName) if getElementData(source, ammoData) <= 0 then triggerClientEvent(source, "displayClientInfo", source, "Rearm", shownInfos.nomag, 255, 22, 0) return end setElementData(source, "currentweapon_" .. slot, weaponName) local weapon = getElementData(source, "currentweapon_1") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), true) end local weapon = getElementData(source, "currentweapon_2") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), false) end local weapon = getElementData(source, "currentweapon_3") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(source, weapID, getElementData(source, ammoData), false) end if elementWeaponBack[source] then detachElementFromBone(elementWeaponBack[source]) destroyElement(elementWeaponBack[source]) elementWeaponBack[source] = false end setElementModel(source, getElementData(source, "skin")) end addEvent("onPlayerRearmWeapon", true) addEventHandler("onPlayerRearmWeapon", getRootElement(), rearmPlayerWeapon) Thanks in Advance
  17. The ped i managed to destroy, the problem is I can't destroy the collision, give this error: Bad argument @ 'destroyElement' [Expected element at argument 1, got boolean].
  18. I want when I click a gui button destroy the body of the dead player, but when I execute the function only destroy the ped and not the colision. debugscript: Bad argument @ 'destroyElement' [Expected element at argument 1, got boolean] spawn.lua: where is the function that create the ped and the colision when the players die. Server Side function kilLDayZPlayer(killer, headshot, weapon) pedCol = false local account = getPlayerAccount(source) if not account then return end killPed(source) triggerClientEvent(source, "hideInventoryManual", source) if getElementData(source, "alivetime") > 0 and not isElementInWater(source) then local x, y, z = getElementPosition(source) if getDistanceBetweenPoints3D(x, y, z, 6000, 6000, 0) > 200 then local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) local skin = getElementModel(source) local ped = createPed(skin, x, y, z, rotZ) pedCol = createColSphere(x, y, z, 1.5) killPed(ped) setTimer(destroyDeadPlayer, 2700000, 1, ped, pedCol) attachElements(pedCol, ped, 0, 0, 0) setElementData(pedCol, "parent", ped) setElementData(pedCol, "playername", getPlayerName(source)) setElementData(pedCol, "deadman", true) setElementData(pedCol, "MAX_Slots", getElementData(source, "MAX_Slots")) local time = getRealTime() local hours = time.hour local minutes = time.minute setElementData(pedCol, "deadreason", getPlayerName(source) .. " is dead. Cause of death: " .. (weapon or "Unknown") .. ". Time of death: " .. hours .. ":" .. minutes .. " o'clock.") end end menu_client.lua: where the gui is. ClientSide if itemName == "hide" then local col = getElementData(getLocalPlayer(), "currentCol") local gearName = "Hide Body" triggerServerEvent("removeBody", getLocalPlayer(), getElementData(col, "parent")) disableMenu() return end survivorSystem.lua: where the function that removes the body is. ServerSide function removeBody(object) setPedAnimation(source, "BOMBER", "BOM_Plant", nil, false, false, nil, false) destroyElement(getElementData(object, "parent")) destroyElement(object) end addEvent("removeBody", true) addEventHandler("removeBody", getRootElement(), removeBody) Thanks in Advance
  19. sorry, do not wish to offend. is just for nobody copy my idea. Sorry again for being rude and for the english
  20. I manage to solve. Thanks
  21. The option is the same as the other in size and font. if I put the third option in the place of the second option work. is just the third option that don't work
×
×
  • Create New...