Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/21 in all areas

  1. Ohhh ok got it wait a sec Add this to onClientPlayerDamage if weapon == 51 then triggerEvent("killDayzPlayer", localPlayer); return; end This is already in your code but you don’t have the return thing, you mai just add that after the triggerEvent
    1 point
  2. Well that should work, please note that if used on client side that returns the clients computer time witch might be different from server time! A work around will be to set the game time as the real time on server side and get the game time on the client. If not you can set it as an elementData on root element and update that data every hour on server
    1 point
  3. Olá. "MarkerTable" não é um marker, por isso é impossível obter a posição do elemento.
    1 point
  4. 1 point
  5. Olá novamente, desculpe-me pelo meu erro acima! Eu acho que consegui entender o que você precisa, sendo assim eu fiz outro código (baseado no seu) com algumas funções a mais. function getNearestVehicle(player, distance) local lastMinDis = distance - 0.0001 local nearestVeh = false local px, py, pz = getElementPosition(player) local pint = getElementInterior(player) local pdim = getElementDimension(player) for _, v in pairs(getElementsByType("vehicle")) do local vint, vdim = getElementInterior(v), getElementDimension(v) if vint == pint and vdim == pdim then local vx,vy,vz = getElementPosition(v) local dis = getDistanceBetweenPoints3D(px, py, pz, vx, vy, vz) if dis <= distance then if dis <= lastMinDis then lastMinDis = dis nearestVeh = v end end end end return nearestVeh end local gpStaff = "Staff" function detachVehicle(player) if (isObjectInACLGroup("user."..(getAccountName(getPlayerAccount(player))), aclGetGroup(gpStaff))) then local pPos = {getElementPosition(player)} -- Posição do player local pVeh = getNearestVehicle(player, 3) -- Todos os veículos até 3 metros de você local pMarker = createMarker(pPos[1], pPos[2], pPos[3], "cylinder", 1.5, 255, 255, 0, 180) attachElements(pMarker, player, 0, 0, -1) setTimer( function() destroyElement(pMarker) end , 2000, 1) if (pVeh and isElement(pVeh)) then if (not getElementData(player, "vehMarkerHited")) then outputChatBox("pegou") attachElements(pVeh, player) setVehicleDamageProof(pVeh, true) setElementData(player, "vehMarkerHited", true) else outputChatBox("soltou") setVehicleDamageProof(pVeh, false) setElementData(player, "vehMarkerHited", false) if (isElementAttached(pVeh)) then detachElements(pVeh, player) end end end end end addCommandHandler("t", detachVehicle) Espero que te ajude!
    1 point
  6. AttachElements seria mais para "colar" um elemento em outro. Mas você pode usar os parâmetros de offset dele para deixar o elemento "colado porém distante" do outro elemento. @Kii, sobre seu problema é pq veh é uma tabela e não um veículo. Veja oq a função getElementsByType retorna.
    1 point
  7. Olá. Sim, é possível. Fiz até um código de teste. A granada explode 500ms após ser lançada. addEventHandler("onClientProjectileCreation", root, function(creator) iprint(getProjectileType(source)) if getProjectileType(source) == 16 then setProjectileCounter(source, 500) end end) Funções: getProjectileType - para obter o tipo de projétil. setProjectileCounter - o tempo para explodir. Evento: onClientProjectileCreation - o evento é client-side, porém ele sincroniza para todos assim que alguém cria um projétil; seja molotov, granada, basuca.
    1 point
  8. Seu script tem vários erros. 1° porque você está usando 2x o getPedOccupiedVehicle(source)? 2° todo o seu código só vai rodar se o source não estiver em um veículo ( if not isPedInVehicle ( source ) then ), não faz sentido já que o veículo que o marker vai ser anexado é o veículo em que o source está. Marker_Van = {} function Pegar_Caixa_trabLixeiro (source) local Veiculo = getPedOccupiedVehicle(source) if isElement(Veiculo) and getElementModel (Veiculo) == 408 then Marker_Van[source] = createMarker ( 0, 0, 0, "cylinder", 1.2, 16, 111, 231, 90) attachElements ( Marker_Van[source], Veiculo, 0, -4.5, -1.2 ) setElementVisibleTo ( Marker_Van[source], source, true ) end end Obs: desse jeito só vai criar o marker se o source estiver dentro do carro.
    1 point
  9. Ped Controller 1.0.5.1 FIX 24.10.2011, 8:25:18 PM I. About this resource: - Thanks this resource you can control created ped ( i named it Android ), Practically every function which has local player, i made binds for Stationary Computer, so if you play on laptop you must edit binds. ( probably that you have numeric keypad ). * You can buy numeric keypad separately ( i know you don't buy it, you're too lazy ) Numeric keypad is more comfortable, so for that i made this keypad. !!! IF YOU HAVE GOT LOW PROFILE COMPUTER PLEASE SET AUTO RESOURCE RESTARTING! !!! !!! TO DO IT TYPE FOLLOWING COMMAND: /lowprofile - it's COMMAND FOR ON/OFF! !!! II. Control keys: 'num 8' - forwards 'num 2' - backwards 'num 4' - left 'num 6' - right 'num 5' - fight/fire 'num 0' - sprint 'num 9' - walk 'num 7' - jump 'num add' - enter/quit the car ( you must stay on vehicle roof when you enter ) III. Vehicle control keys: 'num 8' - accelerate 'num 2' - brake reverse 'num 4' - left 'num 6' - right 'num 0' - handbrake 'num add' - enter/quit the car ( you must stay on vehicle roof when you enter ) 'num sub' - nitro 'num 7' - HELICOPTER - ROTATE LEFT 'num 9' - HELICOPTER - ROTATE RIGHT 'num div' - HELICOPTER - FORWARDS 'num mul' - HELICOPTER - BACKWARDS IV. Useful commands: /info ^ show or hide info displayed near ped head /line ^ show or hide line between you and your ped under control /warppedtoveh ^ enter vehicle, but remember you must be on vehicle roof /removepedfromveh ^ removes ped from vehicle /warpmetoped ^ warp yourself to created ped /warppedtome ^ warp created ped to yourself /writeasa ^ write as a ped /lowprofile ^ use this option when you have got weak computer /givepedjetpack -- REMOVED ^ gives jetpack to ped /removepedjetpack -- REMOVED ^ removes jetpack from ped /givepedparachute ^ gives parachute to ped /pedcols ^ turn ped collisions off/on /pedvehcols ^ turn ped occupied vehicle collisions on/off Video #1: Video #2: V. Changes: *in version 1.0.1: Added: new commands( warpmetoandroid, warpandroidtome ) Added: cursor showing by 'm' key Added: ped options menu ( ability to choosing skin and ped name ) Fixed: debug error - guiSetPosition *in version 1.0.2: Added: new commands( all for vehicle ) Added: ped options menu ( ability to choosing skin,ped name,weapon,alpha level ) Added: steering vehicle ( practically same control keys like on foot ) Fixed: debug error in ped options menu - guiSetPosition Fixed: rescripted part of resource to server side Fixed: error with vehicle binds Deleted: section in readme file for people playing on laptops - it doesn't make a sense *in version 1.0.3: Added: control of writing ( write as your ped for ex. my Android: hi here i am! ) Added: ped vehicle options menu ( choosing vehicle, alpha level, proof on/off ) Added: nitro key *in version 1.0.4 PRE: Added: some new bind keys for vehicle ( compatibility with helicopters ) Fixed: NUM_ADD BUG - finally it's finished Deleted: known bugs section in readme file - it's not necessary TODO: CONTROL OF WRITING *in version 1.0.5 FULL: Added: command /givepedparachute - gives ped parachute Added: collision commands /pedcols, /pedvehcols Removed: ped jetpack doesn't work cause ped can't fly Removed: i haven't got time to finish it in 1.0.5 **in version 1.0.5.1 FIX: Fixed: debug script errors fixed on resource start Fixed: lowprofile now works im sure *** IT IS FULL VERSION OF THIS RESOURCE, I WILL RELEASE FIX VERSIONS LATER! *** I AM TOO BORED WITH THIS RES. VI. Author - You can contact me by: * GG(gadu-gadu.pl): 8369955 * E-Mail: [email protected] * Forum: forum.multitheftauto.com ( nickname: gary35 ) DOWNLOAD: cPed 1.0.0.zip http://www33.zippyshare.com/v/47072820/file.html cPed 1.0.1.zip http://www33.zippyshare.com/v/26628863/file.html cPed 1.0.2.zip http://www33.zippyshare.com/v/18588925/file.html cPed 1.0.3.zip http://www33.zippyshare.com/v/46455961/file.html cPed 1.0.4 PRE.zip http://www33.zippyshare.com/v/90779808/file.html cPed 1.0.5 FULL.zip http://www33.zippyshare.com/v/4497691/file.html cPed 1.0.5.1 FIX.zip http://www1.zippyshare.com/v/22850990/file.html Community link: coming up
    0 points
×
×
  • Create New...