Posts: 122
Threads: 41
Joined: Jun 2016
Reputation:
0
Hello!
I have a RP Server with my own Gamemode.
From Yesterday I'm having some problems with someone who enters server when nobody's in an change the vehicle colors of the vehicle server.
How I can prevent this?
Thanks!
Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
So, you're telling him to loop through 2000 vehicles? Surely that's bad coding practice?
Posts: 513
Threads: 4
Joined: Jun 2015
Reputation:
0
Why store color name instead of its id?
Posts: 1,079
Threads: 199
Joined: Jun 2013
Reputation:
0
If you have a timer for vehicle fuel (which I'm sure you do), then just set the vehicle color to their saved vehicle color in that timer.
If you don't have file saving for your vehicles, then you need to get it now before it's too late.
Posts: 122
Threads: 41
Joined: Jun 2016
Reputation:
0
Thanks to all, I'll try the Aerotactics solution, sure I'm using a timer for fuel and I'm storing all the data in MySQL. The problem is, that the person who is changing the colors also changes de color in the database. I'm not at house in this moment but when I arrive I'll post the code for the saved color on vehicles because I have the mech work so I need to change the color of cars sometimes..
Thanks!
Posts: 12
Threads: 0
Joined: Jul 2016
Reputation:
0
The best I can think of right now is to store the server-side colors in a vehicle variable (vColor1, vColor2 for example) and what you could do then is perform a check every so often to see if the server-side colors match up with the variables, if not then change it back to the variables.