Tails Posted October 18, 2014 Share Posted October 18, 2014 Was working on a new map and found that my vehicles fall through the ground upon spawning. Figured I'd use isElementWaitingForGroundToLoad but I'm constantly getting this debug error: "attemp to call global: 'isElementWaitingForGroundToLoad' (a nil value)" I tried everything, even tried using the example code from the wiki page and it's still not working. I'm using MTA ver. 1.4-release-6882 Link to comment
King12 Posted October 18, 2014 Share Posted October 18, 2014 This function returns true if MTA has frozen the element because it is above map objects which are still loading. Maybe your game ain't freezing, that's why. Also make you are using it in the correct side, if the vehicle spawns on client-side use it on client side. Link to comment
Tails Posted October 18, 2014 Author Share Posted October 18, 2014 The vehicles are in a .map file. How would I use it client-side if onVehicleRespawn is a server-side event? Link to comment
albers14 Posted October 18, 2014 Share Posted October 18, 2014 Use onClientElementStreamIn and freeze the vehicle clientsided incase its ground arent loaded. Then check with a timer or smth, if the vehicle is still waiting on ground to load, if it isnt waiting then unfreeze the element and stop the timer. Link to comment
.:HyPeX:. Posted October 18, 2014 Share Posted October 18, 2014 The vehicles are in a .map file. How would I use it client-side if onVehicleRespawn is a server-side event? Well one is to obtain the vehicles or send them client-side, (wich i do not know if it would work), other is creating them client side... Link to comment
albers14 Posted October 18, 2014 Share Posted October 18, 2014 Nop Hypex, onClientElementStreamIn should do the job. https://wiki.multitheftauto.com/wiki/On ... ntStreamIn Together with "getElementType(streamedInObject) == "vehicle" then " then you use isElementWaitingForGroundToLoad(streamedInObject) in case thats true freeze and setTimer else do nothing. 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