Jump to content

Need Help


Amir_William

Recommended Posts

function giveMoney(cmd)
	if (moneyChances == nil) then ------if moneyChances == nil | moneyChances doesn't appear before in the function, the value it's nil
		givePlayerMoney(source, 50000) ------50.000 the amount of money the player get with the command. (You can edit this number)
		moneyChances = 1 -------moneyChances = 1, so the first variable now it's NOT nil, that should block the option of giving the money to the player
	else
		outputChatBox("You already used this command.", source, 255, 0, 0) --------if moneyChances == 1 then this text shows  up
	end
end
addCommandHandler("money", giveMoney) 

(server-side)

PD: Not tested, but this could give you an idea on how to make it, I hope it help you

note: I'm new trying to help in this section, if I'm wrong or I missed something please tell me and I'll learn about my mistake :D

 

Link to comment
7 hours ago, Cronoss said:
function giveMoney(cmd)
	if (moneyChances == nil) then ------if moneyChances == nil | moneyChances doesn't appear before in the function, the value it's nil
		givePlayerMoney(source, 50000) ------50.000 the amount of money the player get with the command. (You can edit this number)
		moneyChances = 1 -------moneyChances = 1, so the first variable now it's NOT nil, that should block the option of giving the money to the player
	else
		outputChatBox("You already used this command.", source, 255, 0, 0) --------if moneyChances == 1 then this text shows  up
	end
end
addCommandHandler("money", giveMoney) 

(server-side)

PD: Not tested, but this could give you an idea on how to make it, I hope it help you

note: I'm new trying to help in this section, if I'm wrong or I missed something please tell me and I'll learn about my mistake :D

 

Or like this:

local used = false

function givecash(command, thePlayer)
  if used == false then
    givePlayerMoney(thePlayer, 5000)
    used = true
    elseif used == true then
    outputChatBox("Already used this command", thePlayer, 255, 0, 0, true)
    end
  end
addCommandHandler("cash", givecash)

 

Edited by Hydra
Link to comment

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...