Jump to content

Recommended Posts

Posted

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

My servers:

Fun:

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Derby(DD):

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted (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 Arabian

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

Edited by killerProject
  • Thanks 1

 

 


April 25, 2016, THE BEGINNING OF MY JOURNEY ?

Check my apps in playStore


 

Posted
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

  • Like 1

 

 


April 25, 2016, THE BEGINNING OF MY JOURNEY ?

Check my apps in playStore


 

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.
×
×
  • Create New...