scaryface87 Posted November 24, 2015 Share Posted November 24, 2015 Hello , I would like to make a "rent" script if u do /rent (number of days) for example /rent 1 , then ur renting something for a certain day u fill in. Something like this below : I should be able to restart the script without losing the (timer?) (the rent) function rentMe(playerSource) outputChatBox("You rented me for *how many day here*!") setElementData(playerSource,"hasRent",1) end addCommandHandler("rent",rentMe) Link to comment
SpecT Posted November 24, 2015 Share Posted November 24, 2015 Save the day that the rent will expire with setAccountData. And on player login check if he has rented and if yes then get the date. If the current date is the same as the saved one then remove the rent state. Also don't use setElementDataif you want to keep the data saved. Use setAccountDatainstead. Link to comment
scaryface87 Posted November 25, 2015 Author Share Posted November 25, 2015 Ah right i forgot about setAccountData & getAccountData , Thank you! i"ll try it Link to comment
SpecT Posted November 25, 2015 Share Posted November 25, 2015 Ah right i forgot about setAccountData & getAccountData ,Thank you! i"ll try it You are welcome! If you need more help post it here. Good luck! Link to comment
scaryface87 Posted November 26, 2015 Author Share Posted November 26, 2015 Hello , Im trying to go a little bit higher. This time if u do /rent it"ll set a data to a createdcar , this car gets saved in a SQL file So i made a collumn with model , x ,y ,z , owner if script starts it creates a vehicle with the info it get + it sets elementdata (value is in collumn owner) My question is is it possible to get the object with the elementdata of the owner & remove hes name to "rentable"? Hm i think i might be able to make it so im trying it first. 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