Daniel. Posted July 24, 2012 Posted July 24, 2012 So I'm currently creating a donation system for my current gamemode I was wonder if this will work to give a player a object such as `spawnVehicle` anyway here is the code function onRedeemCode(thePlayer, commandName, code) if not (code) then outputChatBox("SYNTAX: /".. commandName .." [Redeem Code]", thePlayer, 125, 294, 14) else if code == "sodq-39jd-239j-230jd" then --setPlayerMoney(thePlayer, 1000000)-- What thing tha twill happen else outputChatBox("This code is not in our code database, sorry.", thePlayer, 255, 0, 0) end end addCommandHandler("redeemcode", onRedeemCode)
JR10 Posted July 24, 2012 Posted July 24, 2012 You have a missing end. function onRedeemCode(thePlayer, commandName, code) if not (code) then outputChatBox("SYNTAX: /".. commandName .." [Redeem Code]", thePlayer, 125, 294, 14) else if code == "sodq-39jd-239j-230jd" then --setPlayerMoney(thePlayer, 1000000)-- What thing tha twill happen else outputChatBox("This code is not in our code database, sorry.", thePlayer, 255, 0, 0) end end end addCommandHandler("redeemcode", onRedeemCode) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Daniel. Posted July 24, 2012 Author Posted July 24, 2012 I noticed that but would it work if I tyed in something like /redeemcode sodq-39jd-239j-230jd would it spawn the object?
Anderl Posted July 24, 2012 Posted July 24, 2012 There isn't any function making it spawn in your code, so, no. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
Daniel. Posted July 24, 2012 Author Posted July 24, 2012 if Id id put one under if code == then would it work?
Anderl Posted July 24, 2012 Posted July 24, 2012 Yes, except if you're code is wrong. "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
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