Blinker. Posted November 2, 2014 Share Posted November 2, 2014 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. Link to comment
Feche1320 Posted November 3, 2014 Share Posted November 3, 2014 You can try onPlayerWasted. Link to comment
Blinker. Posted November 3, 2014 Author Share Posted November 3, 2014 i've already tried it doesn't work because it doesn't detect the car. Link to comment
juanruiz85 Posted November 4, 2014 Share Posted November 4, 2014 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 Link to comment
Blinker. Posted November 4, 2014 Author Share Posted November 4, 2014 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 Link to comment
.:HyPeX:. Posted November 5, 2014 Share Posted November 5, 2014 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. Link to comment
'LinKin Posted November 5, 2014 Share Posted November 5, 2014 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. Link to comment
.:HyPeX:. Posted November 5, 2014 Share Posted November 5, 2014 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. Link to comment
.:HyPeX:. Posted November 5, 2014 Share Posted November 5, 2014 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. Link to comment
Blinker. Posted January 14, 2015 Author Share Posted January 14, 2015 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. Link to comment
FranklinRoosevelt Posted January 14, 2015 Share Posted January 14, 2015 Btw , destoryElement Doesn't work. What? In all it work. Link to comment
Blinker. Posted January 14, 2015 Author Share Posted January 14, 2015 in race it doesn't work , race integrity will fail. Link to comment
'LinKin Posted January 19, 2015 Share Posted January 19, 2015 Still have this issue? haha I solved it long time ago. You can download it from http://linkin.hol.es It works flawlessly Link to comment
Et-win Posted January 19, 2015 Share Posted January 19, 2015 ...No, everything works fine. Link to comment
Et-win Posted January 19, 2015 Share Posted January 19, 2015 hm? All the codes which he states they don't work. Link to comment
Blinker. Posted January 20, 2015 Author Share Posted January 20, 2015 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 Link to comment
'LinKin Posted January 25, 2015 Share Posted January 25, 2015 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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now