Recommended Posts

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

Share this post


Link to post
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 Arabian

https://forum.mtasa.com/forum/134-البرمجة/

Edited by killerProject
  • Thanks 1

Share this post


Link to post
35 minutes ago, Khadeer143 said:

You forget main thing creating a window  lol kidding 


is it important ?
ex .. without window :D

 

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

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.