Jump to content

1.4 problem


Blinker.

Recommended Posts

Posted

Hello folks ,i was using a script to move a vehicle when a player dies in Destruction Derby gamemode to prevent car bugs.. so when a player Dies the car will be moved to another place but now in 1.4 version it's not working , i don't know why it's not working. in older versions it was working well i am using :

function moveVehicle ( vehicle ) 
    local x, y, z = getElementPosition ( vehicle ) 
    if ( vehicle ) then 
        setElementPosition ( vehicle, x, y, z - 100 )   
    end 
    end 
  
addEvent ( "onPlayerRaceWasted", true ) 
addEventHandler ( "onPlayerRaceWasted" , getRootElement(), moveVehicle ) 
  

i guess onPlayerRaceWasted is not working anymore in this new Race.

is there any alternative for onPlayerRaceWasted ?

Thanks in advance.

Posted

maybe this can help you

  
function notifyAboutExplosion() 
    -- source is the element that triggered the event and can be used in other events as well 
    outputChatBox(getVehicleName(source) .. " just blew up") 
end 
  
-- by using getRootElement() as root, it works for any vehicle 
addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion) 
  

source

https://wiki.multitheftauto.com/wiki/OnVehicleExplode

Posted

i guess the problem is setElementPosition , i've asked my friend he had a script to move the car after the player dies, he was using another event , but it doesn't work also in 1.4 , so the problem is setElementPosition

Posted
i guess the problem is setElementPosition , i've asked my friend he had a script to move the car after the player dies, he was using another event , but it doesn't work also in 1.4 , so the problem is setElementPosition

setElementPosition works pretty well, else looots of stuff everywhere would be failing.

Posted

Yes, I don't understand what happens here...

I think the problem's root is some script line somewhere inside the race resource.

Because it seems like if the car was warped after some time to the position where the player died and its visibility is set to false. It's very wierd.

Blinker, try using destroyElement instead of setElementPosition, I've not tried it because I believe it will cause troubles, just as when you destroy a vehicle using Admin Panel, the race resource messes up and gets restarted. However this can be solved by adding it to the Admin ACL.

Posted
Yes, I don't understand what happens here...

I think the problem's root is some script line somewhere inside the race resource.

Because it seems like if the car was warped after some time to the position where the player died and its visibility is set to false. It's very wierd.

Blinker, try using destroyElement instead of setElementPosition, I've not tried it because I believe it will cause troubles, just as when you destroy a vehicle using Admin Panel, the race resource messes up and gets restarted. However this can be solved by adding it to the Admin ACL.

The race resource gets messed up becouse destroying the car makes all the "cache" variables the race is using nil making it go totally wrong causing huge errors. In the end restarting is the only solution else than kicking the player.

Posted
Yes, I don't understand what happens here...

I think the problem's root is some script line somewhere inside the race resource.

Because it seems like if the car was warped after some time to the position where the player died and its visibility is set to false. It's very wierd.

Blinker, try using destroyElement instead of setElementPosition, I've not tried it because I believe it will cause troubles, just as when you destroy a vehicle using Admin Panel, the race resource messes up and gets restarted. However this can be solved by adding it to the Admin ACL.

The race resource gets messed up becouse destroying the car makes all the "cache" variables the race is using nil making it go totally wrong causing huge errors. In the end restarting is the only solution else than kicking the player.

  • 2 months later...
Posted

Hello , i came back to that problem , hopefully i'll find a solution for that problem...

i forgot about this topic and that problem because i stopped working on this script.

if anyone could help me i'll be so grateful,

Thanks.

Btw , destoryElement Doesn't work.

Posted

how did you fix it linkin , can you share the way you fixed it ? or just functions.. hm i need to add it in my script .. so i can't add your whole resource to my script :D

Posted

You muse freeze the car, because when u set it's position to some negative value (under water) the car keeps going down, untill it reaches a point where it goes back to the surface (that's when the bug occurs)

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...