Jump to content

Some Train questions and !


CodX

Recommended Posts

Posted

Hello !

The train has some bugs in GTA multiplayer (MTA Server).

When a player climb up like passager in train, he will die after tunnel of Los Santos and another location.

Can be solve this bug ?

 

P.S: Sorry if my english is bad, i from Romanian.

  • Discord Moderators
Posted (edited)

*Can i solve this bug * im from Romania.

No, you cant solve this.. this is a sync bug, MTA is good at syincing, but not when syncing towned vehicles, trains, and anything thats attached.

 

Or maybe you can, if you disable player damage, or attach yourself to the train(i dont think that this will work..)

Edited by Pirulax
Posted

My server is Hard RolePlay. I can't disable damage.. Then the Cops can;t shot in criminals to kill them, or criminals in cops.

Attached i've triet but don't work.

Posted (edited)

you could just disable player damages when he enters inside the train, and enable them when he gets out

Edited by Gordon_G
Posted (edited)

I've made a job for "train". If that bug can be disabled from scripting of the job, i really don't know how can i do that.

Can you help me, if you how ?

Edited by CodX
Posted (edited)

You could try this :

addEventHandler("onClientVehicleEnter", root,
  function (thePlayer)
    if thePlayer == localPlayer then
      local model = getElementModel(source)
      if model == 538 or model == 570 or model == 537 then
        addEventHandler("onClientPlayerDamage", localPlayer, function() cancelEvent() end )
      end
    end
  end
)

addEventHandler("onClientVehicleExit", root,
  function (thePlayer)
    if thePlayer == localPlayer then
      local model = getElementModel(source)
      if model == 538 or model == 570 or model == 537 then
        removeEventHandler("onClientPlayerDamage", localPlayer, function() cancelEvent() end )
      end
    end
  end
)

It should work

Edited by Gordon_G
Posted (edited)

Ok. I will try.

I will edit this message at 20:00. Now the hosting is in manage...

 

Edited by CodX
Posted (edited)

Doesn't not work.

The script doesn't have errors but players take damage when they climb up in train.

 

I will try to find o solution for that..

But I have a more serious problem on the train, that with the injury I will solve it somehow.

After 5-10 minutes, the train moves its location a few meters further and no longer climbs up into it, unless it just wipes out and makes another.

Edited by CodX
  • MTA Team
Posted

Does removing event handlers work like that? (when using anonymous functions)

I'd much rather store it in a variable, or create a named function for that.

Posted

Yes.

<meta>
     <script src="bug.lua" type="server" />
     <script src="bug.lua" type="client" />
</meta>

 

  • Like 1
Posted
39 minutes ago, CodX said:

Yes.


<meta>
     <script src="bug.lua" type="server" />
     <script src="bug.lua" type="client" />
</meta>

 

I am a very bad scripter....  But you have 2 of the same file, one is server, and one client.

Try replacing the meta with this.

<meta>
     <script src="bug.lua" type="client" />
</meta>

 

Posted

Ok. I will edit this message with a reponse in 1 hour, i wait to connect a player :)

P.S: Sorry for my english.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...