SlashBuster Posted April 21, 2013 Share Posted April 21, 2013 I have a script which stores a car in a mysql database when it spawns so that every car is related to a owner. But thats only in the database. How can I do the same in the game so that a vehicle has an id which I can ask for in a Lock script so that only that person who owned it can open it Thanks best greetings Link to comment
50p Posted April 21, 2013 Share Posted April 21, 2013 If your players need to register then use player's account name as the vehicle ID. setElementID( vehicle, getAccountName( getPlayerAccount( player ) ) ) Link to comment
SlashBuster Posted April 21, 2013 Author Share Posted April 21, 2013 and is it only for the vehicle which was spawned in the smae function? Link to comment
50p Posted April 21, 2013 Share Posted April 21, 2013 Doesn't matter where you assign the ID, you can have a script that creates vehicles and then when player enter the vehicle and types "/buy 1000" your script will change the ID of the vehicle so that he owns the car. If you load the cars from database then you can assign the ID right after you create the vehicle. Why do you ask me when you want to change the ID? It's up to you. Link to comment
SlashBuster Posted April 21, 2013 Author Share Posted April 21, 2013 getElementID (vehicle) how does this string knows which vehicle is meant Link to comment
TAPL Posted April 21, 2013 Share Posted April 21, 2013 getElementID (vehicle) how does this string knows which vehicle is meant You maybe mean this? getElementByID 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