stefutz101 Posted June 28, 2016 Share Posted June 28, 2016 Hi everyone , i'm working at a resource what make a car invulnerable when driver type /park , when he leaves car it becomes vulnerable . This is normal ? PS i used this function : setVehicleDamageProof Link to comment
Simple0x47 Posted June 28, 2016 Share Posted June 28, 2016 That's why the function affects the player's vehicle in which if he's not in it the vehicle hasn't got that property. I would recommend the use of tables and events to get done this things. Link to comment
stefutz101 Posted June 28, 2016 Author Share Posted June 28, 2016 What's the best solution ? Link to comment
Simple0x47 Posted June 28, 2016 Share Posted June 28, 2016 There are lots of ways you can choose. The one that I recommend you, would be to create a table named "vehicles" and save there as key the vehicle ID the vehicle element, then use some events to make the connections to access the right vehicle. That would be the best way to do it, but you could also use setElementData for it. Link to comment
stefutz101 Posted June 28, 2016 Author Share Posted June 28, 2016 I don't need a table to do that . Link to comment
Captain Cody Posted June 29, 2016 Share Posted June 29, 2016 1 player, sure you don't need tables. 2+ Players.. Yes you do need tables. Basicly everything that involves more then one person that is server side requires one sort of table or another. Link to comment
_DrXenon Posted June 29, 2016 Share Posted June 29, 2016 Tables for what? I may have not understood the issue? Anyway, You can simply use setElementData & setVehicleDamageProof. I seriously did not understand what is the problem here, But tables are never needed unless you prefer to use them. Link to comment
Simple0x47 Posted June 30, 2016 Share Posted June 30, 2016 Tables for what? I may have not understood the issue?Anyway, You can simply use setElementData & setVehicleDamageProof. I seriously did not understand what is the problem here, But tables are never needed unless you prefer to use them. Tables are needed for performance, because setElementData takes a lot of CPU and RAM. Link to comment
stefutz101 Posted June 30, 2016 Author Share Posted June 30, 2016 Lol i did it without tables. aprox 15 lines of code Link to comment
Captain Cody Posted June 30, 2016 Share Posted June 30, 2016 yes but stefutz as soon as lots of cars start using setElementData you will notice a performance drop. 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