Jump to content

What's wrong with this?


Lloyd Logan

Recommended Posts

Why is nothing happening with this script?

  
function buyVeh() 
    local money = getPlayerMoney(source) 
    if (money < 10000) then 
        ("You do not have enough money to purchase this car", 255, 0, 0) 
        else 
        newveh = createVehicle(589, 558.748046875, -1265.380859375, 17.2421875 ) 
        warpPedIntoVehicle(source, newveh) 
        takePlayerMoney (source, 10000) 
        outputChatBox("You have successfully bought a club!", 0, 255, 0) 
    end 
end 
addCommandHandler("buyvehclub", getRootElement(), buyVeh) 

Link to post
function buyVeh ( source ) 
    local money = getPlayerMoney ( source ) 
    if ( money < 10000 ) then 
        outputChatBox ( "You do not have enough money to purchase this car", source, 255, 0, 0 ) -- You forgot about 'outputChatBox' 
        else 
        newveh = createVehicle ( 589, 558.748046875, -1265.380859375, 17.2421875 ) 
        warpPedIntoVehicle ( source, newveh ) 
        takePlayerMoney ( source, 10000 ) 
        outputChatBox ( "You have successfully bought a club!", 0, 255, 0 ) 
    end 
end 
addCommandHandler ( "buyvehclub", buyVeh ) -- addCommandHandler doesn't have attachedTo argument. 

Link to post

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