Clydian Posted November 28, 2015 Posted November 28, 2015 (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 November 29, 2015 by Guest
ALw7sH Posted November 28, 2015 Posted November 28, 2015 addCommandHandler("buy", function(player) if getPlayerMoney(player) >= 5000 then takePlayerMoney(player,5000) end end )
Clydian Posted November 28, 2015 Author Posted November 28, 2015 addCommandHandler("buy", function(player) if getPlayerMoney(player) >= 5000 then takePlayerMoney(player,5000) end end ) and how should i make the enevnt handler?
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