Tokio Posted April 9, 2018 Share Posted April 9, 2018 I want create a bank-system. But i don't know, how to begin the script. Can i make it possible this with setElementData, and getElementDatas? sorry for my bad english Link to comment
AHMED MOSTAFA Posted April 9, 2018 Share Posted April 9, 2018 (edited) 56 minutes ago, 50cent said: I want create a bank-system. But i don't know, how to begin the script. Can i make it possible this with setElementData, and getElementDatas? sorry for my bad english you can use setAccountData getAccountData or SQLite functions if you are Arabianhttps://forum.multitheftauto.com/forum/134-البرمجة/ Edited April 9, 2018 by killerProject 1 Link to comment
Tokio Posted April 9, 2018 Author Share Posted April 9, 2018 5 minutes ago, killerProject said: you can use setAccountData getAccountData or SQLite functions if you are Arabianhttps://forum.multitheftauto.com/forum/134-البرمجة/ Thanks, no i am Hungarian Link to comment
Storm-Hanma Posted April 10, 2018 Share Posted April 10, 2018 You forget main thing creating a window lol kidding 1 Link to comment
AHMED MOSTAFA Posted April 10, 2018 Share Posted April 10, 2018 35 minutes ago, Khadeer143 said: You forget main thing creating a window lol kidding is it important ? ex .. without window function command ( player, Command, amount ) local account = getPlayerAccount ( *** ) if account and not isGuestAccount ( *** ) and tostring (Command) and tonumber (amount) > 0 then local money = getAccountData ( ***, "Bank" ) or 0 if Command == "get" and money >= amount then givePlayerMoney ( ***, amount ) setAccountData ( account, "Bank", money - amount ) elseif *** == "set" and getPlayerMoney ( *** ) >= amount then takePlayerMoney ( player, *** ) setAccountData ( account, "Bank", money + *** ) end end end addCommandHandler ( "set", ***, command ) -- set +amount addCommandHandler ( "get", root, *** ) -- get +amount Not Tested Try to know what is the *** means 1 Link to comment
Storm-Hanma Posted April 11, 2018 Share Posted April 11, 2018 But with window it looks cool instead of commands 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