Jump to content

Redeem Code


Daniel.

Recommended Posts

Posted

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) 

Posted

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

Posted

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

Posted

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

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