Daniel. Posted July 24, 2012 Share 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) Link to comment
JR10 Posted July 24, 2012 Share 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) Link to comment
Daniel. Posted July 24, 2012 Author Share 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? Link to comment
Anderl Posted July 24, 2012 Share Posted July 24, 2012 There isn't any function making it spawn in your code, so, no. Link to comment
Daniel. Posted July 24, 2012 Author Share Posted July 24, 2012 if Id id put one under if code == then would it work? Link to comment
Anderl Posted July 24, 2012 Share Posted July 24, 2012 Yes, except if you're code is wrong. 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