Jump to content

[HELP] Whats wrong with script?? [SOLVED]


Clydian

Recommended Posts

Posted (edited)

local aPickup = createPickup ( -49.7573, -269.5133, 6.6331, 3, 1273, 0, 0 ) 
  
function showPropertyInfo ( player ) 
   outputChatBox ( "| Īpašums: 'Alus & Co.' |", player ) 
   outputChatBox ( "| Cena: 150000 | 5min ienākums: 5000 | Pārdošanas cena: 60000 |", player ) 
   outputChatBox ( "| Lai iegādātos šo īpašumu, rakstiet: /buyproperty. Lai pārdotu /sellproperty |", player ) 
    
end 
addEventHandler ( "onPickupHit", aPickup, showPropertyInfo ) 
  
function whenBuyProperty(player, commandName) 
    local money = getPlayerMoney(player) 
    if (money > 150000) then 
        outputChatBox("You have succesfully bought an interior!", player) 
    end 
end 

So basicly i want to make two commands.

/buyproperty

/sellproperty

How can i make that when player types /buyproperty it shows if it has enought money, on not that much money?

Edited by Guest
Posted
addCommandHandler("buy", 
function(player) 
    if getPlayerMoney(player) >= 5000 then 
        takePlayerMoney(player,5000) 
    end 
end 
) 

Posted
addCommandHandler("buy", 
function(player) 
    if getPlayerMoney(player) >= 5000 then 
        takePlayerMoney(player,5000) 
    end 
end 
) 

and how should i make the enevnt handler?

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