Jump to content

JsK

Members
  • Posts

    13
  • Joined

  • Last visited

About JsK

  • Birthday 09/08/1998

Details

  • Location
    France

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

JsK's Achievements

Square

Square (6/54)

0

Reputation

  1. But this is the same for every cars , i have about 34 cars and its all the same things , so what exactly i have to do in details ? if you can explain better
  2. Hi guys , so i have made a external car spawning system for my server , but the only problem is that if i spawn the same cars (for example i spawn Infernus at X pos and spawn Another Infernus at Y spawn - different places) , when they boom , there will be 2 Infernus spawned on the SAME spot Here is the code about respawns of cars : function respawnDayZVehicle2(id,x,y,z,rx,ry,rz,veh,col,max_slots) local armorMax = getElementData(col,"armorPointsMax") destroyElement(veh) destroyElement(col) veh = createVehicle(id,x,y,z,rx,ry,rz) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",max_slots) --Engine + Tires local tires,engine,parts,metal = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) setElementData(vehCol,"Tire_inVehicle_HP",400) setElementData(vehCol,"Engine_inVehicle_HP",400) setElementData(vehCol,"Parts_inVehicle_HP",400) setElementData(vehCol,"armorPointsMax",armorMax) setElementData(vehCol,"armorPoints",0) setElementData(vehCol,"receiver",0) setElementData(vehCol,"vehicle:station",0) --vehicle_indentifikation setElementData(vehCol,"spawn",{id,x,y,z,rx,ry,rz}) --others setElementData(vehCol,"fuel",10) end and here is the code of the car spawn. function SpawnDayZVehicle2(id,typ) local x, y, z = getElementPosition(source) veh = createVehicle(id, x + 5, y, z) vehCol = createColSphere(x + 5, y, z, 2.5) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 0) -- количество слотов в тс local tires,engine,parts,metal = getVehicleAddonInfos(getElementModel(veh))---данные берём из vehicle_spawns setElementData(vehCol,"Tire_inVehicle",tires) setElementData(vehCol,"Engine_inVehicle",engine) setElementData(vehCol,"Parts_inVehicle",parts) setElementData(vehCol,"armorPoints",list) setElementData(vehCol,"Tire_inVehicle_HP",400) setElementData(vehCol,"Engine_inVehicle_HP",400) setElementData(vehCol,"Parts_inVehicle_HP",400) setElementData(vehCol,"armorPoints",15500) setElementData(vehCol,"receiver",0) setElementData(vehCol,"spawn",{id,x,y,z,rx,ry,rz}) if typ == "con" then --лут который будет спаунится в конвойном тс setElementData(vehCol,"GPS",1) setElementData(vehCol,"Toolbox",1) setElementData(vehCol,"Map",1) end setElementData(vehCol, "fuel", 20) setVehicleHeadLightColor(veh,math.random(0,255),math.random(0,255),math.random(0,255)) end addEvent("spawnVehAdmin",true) addEventHandler("spawnVehAdmin",getRootElement(),SpawnDayZVehicle2) The data "spawn" is the file of spawn of cars. Please HELP :v
  3. Hey guys , i have a code that is supposed to make a special skin id only slow walk ( like when you alt + z walk in gta:sa solo ) Problem is : it doesn't work Here's the codes : client.Lua function lsoslsolssolsos() if getElementData(getLocalPlayer(),"Sprints") == false then setElementData(getLocalPlayer(),"Sprints",true) else setElementData(getLocalPlayer(),"Sprints",false) end end bindKey("z","both", lsoslsolssolsos) setTimer(function() if getElementData(getLocalPlayer(),"logedin") then local data = fastsprintskin[getElementModel(getLocalPlayer())] local datas = nosprints[getElementModel(getLocalPlayer())] if data then if getPedControlState ( "aim_weapon" ) then return false end if isPedDucked(getLocalPlayer()) then return false end if getPedMoveState(getLocalPlayer()) == "jog" or getPedMoveState(getLocalPlayer()) == "walk" or getPedMoveState(getLocalPlayer()) == "walk" then return false end if getElementData(getLocalPlayer(),"Sprints") == true then if getPedControlState("sprint") == true then setPedControlState("sprint",data[1]) else setPedControlState("sprint",data[2]) end end end if datas then setElementData(getLocalPlayer(),"Sprints",datas[1]) end end end,50,0) and config.Lua : fastsprintskin = { [40] = {false,true}, [14] = {false,true}, [0] = {false,true}, [11] = {false,true}, [36] = {false,true}, [34] = {false,true}, [19] = {false,true}, [16] = {false,true}, [17] = {false,true}, [43] = {false,true}, [66] = {false,true}, [33] = {false,true}, [32] = {false,true}, [67] = {false,true}, [62] = {false,true}, [68] = {false,true}, } nosprints = { [267] = {false}, } So what is wrong ? please help
  4. Nope , same error , and there is nothing at the end i have made some changes and saw that the ammo was going down from the inventory , but when you have left like 1 bullet and re equip gun you get everything back , it's kinda like duplication stuff Here's the change of what i made : for i,weaponData in ipairs(weaponAmmoTable["51мм NATO"]) do if weaponName == weaponData[2] and (weap1 == weaponData[1] or weap2 == weaponData[1] or weap3 == weaponData[1]) then return "51мм NATO",weaponData[2] end end end function weaponSwitch(weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2(weapon,getElementData(localPlayer,"currentweapon_1"),getElementData(localPlayer,"currentweapon_2"),getElementData(localPlayer,"currentweapon_3"),getElementData(localPlayer,"selectedWeapon")) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getLocalPlayer(),ammoName,getElementData(getLocalPlayer(),ammoName)-1) end end end addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(),weaponSwitch) before there was only weaponName == weaponData[2] and WeaponAmmoType2 was added 2 times.
  5. outputChatBox(tostring(getElemen tData(localPlayer, ammoName ) -1))
  6. Once again , i've tried but inventory dissapearing. "ERROR : Loading script failed : mod/DayZ/inventory.Lua : 2112: ')' excepted near '
  7. inventory.Lua:2280 : attempt to compare number with boolean this is all i get.
  8. i have added your line in the command and it :Oed up my whole inventory didnt wanted to open. But the bug of ammo was gone but no inventory. And what is the code from the event when you switch the gun ? function weaponSwitch(weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2(weapon,getElementData(localPlayer,"currentweapon_1"),getElementData(localPlayer,"currentweapon_2"),getElementData(localPlayer,"currentweapon_3"),getElementData(localPlayer,"selectedWeapon")) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getElementData(getLocalPlayer(),ammoName)-1) outputChatBox(tostring(getElementData(getLocalPlayer(),ammoName)-1)) end end end addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(),weaponSwitch) Keep in mind that this makes dissapear the inventory but the ammo goes down.
  9. Hey guys. i have a small problem that makes my development stuck of my entire gamemode, Basically when i'm shooting with a gun , it shows on the guns hud that the ammo goes out , but it doesn't go out from the inventory , so Example if i take "AK-47" with 300 ammo and shoot 100 ammo , i re equip gun and i will have 300 ammo again. 2nd problem is that i tried to see in /debugscript 3 where the error was , and couldn' find it. function weaponSwitch(weapon) if source == getLocalPlayer() then local ammoName,_ = getWeaponAmmoType2(weapon,getElementData(localPlayer,"currentweapon_1"),getElementData(localPlayer,"currentweapon_2"),getElementData(localPlayer,"currentweapon_3"),getElementData(localPlayer,"selectedWeapon")) if getElementData(getLocalPlayer(),ammoName) > 0 then setElementData(getLocalPlayer(),ammoName,getElementData(getLocalPlayer(),ammoName)-1) end end end addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(),weaponSwitch) HELP
×
×
  • Create New...