Jump to content

PeterP

Members
  • Posts

    5
  • Joined

  • Last visited

PeterP's Achievements

Vic

Vic (3/54)

0

Reputation

  1. But I'm trying to destroy the object that was once attached to the player,
  2. function addCapacete (source) local capacete1 = getElementData(source, "capaceteOn") if capacete1 then exports.pAttach:detach(capacete1) destroyElement(capacete1) setElementData(source, "capaceteOn", nil) else capacete1 = createObject(1873,0,0,0) setElementData(source, "capaceteOn", capacete1) exports.pAttach:attach(capacete1, source, 8, -0.02,0,0,0,0,-104.4) end end addEvent ( "onaddCapacete", true ) addEventHandler("onaddCapacete", getRootElement(), addCapacete) I'm getting an error: bad argument @ 'destroyElement' [expected element at argument 1] on line 5 why am I getting this error?
  3. Hi. I was wondering if someone could help me with this. The camera goes through the wall on a custom object; the collision works fine, players can't go through it, nor vehicles or bullets, but the camera seems to ignore it. Does anyone know why this happens?
  4. I'm trying to build a server with a friend of mine, and we have been facing a few problems lately. Players on my server are getting network problems and crashes often, I have spoken to my host and they say there's nothing wrong on their side, So we've been trying to find out the reason but nothing was found yet. I was hoping someone could help me out here. This is an error my friend got; Version = 1.5.9-release-21048.0.000 Time = Tue Jan 11 22:23:25 2022 Module = C:\Program Files (x86)\MTA San Andreas 1.5\mta\netc.dll Code = 0xC0000005 Offset = 0x00215A03 EAX=00000000 EBX=00000000 ECX=00000078 EDX=00004EC2 ESI=FEBE6040 EDI=00000000 EBP=0177F50C ESP=0177F4C8 EIP=60775A03 FLG=00010203 CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B This is the log on my computer, MTADiag-Log-2022-1-12_1-27-5 (mtasa.com) And this is my friends log, MTADiag-Log-2022-1-11_22-44-42 (mtasa.com) We're both having the same problems as everyone in my server. Thank you very much.
  5. function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end addEventHandler("onViatura", root, function() local receiver = getElementData(source, "ReceiverPM") local vtr = carros[source] if (receiver) and (vtr) then local vrx, vry, vrz = getElementRotation(vtr) local px, py, pz = getElementPosition(vtr) if not getElementData(receiver, "NaViatura") then if not isPedInVehicle(receiver) then setElementData(receiver, "NaViatura", true) message(source, "O jogador foi colocado na viatura.", "success") message(receiver, "Você foi colocado na viatura!", "info") attachElements(receiver, vtr, 0.2, -1.5, 0, 0,0,90) setPedAnimation(receiver, 'ped','CAR_dead_LHS') setElementRotation(receiver, vrx, vry, vrz + 83) end else setElementData(receiver, "NaViatura", nil) message(source, "O jogador foi retirado da viatura.", "success") message(receiver, "Você foi retirado da viatura!", "info") detachElements(receiver, getElementAttachedTo(receiver)) setElementPosition(receiver, px + 2, py + 2, pz) setPedAnimation(receiver) end end end ) This function was originaly created to lock a player in the car using the mouse cursor, but it's not possible to release the player once he's in the car because I can't click on them. How can I create a command using the player's ID to realease him ? Thank you very much.
×
×
  • Create New...