Jump to content

buy item help


Recommended Posts

i hav ewirtie a bux itim but the ramp dont delete

addCommandHandler ("buyramp",
function(player,command)
local playerCash = loadPlayerData (player,"cash")
local playername = getPlayerName(player)
local drivervehicle = getPedOccupiedVehicle(player)
local x,y,z = getElementPosition(player)
local X,Y,Z = getVehicleRotation(drivervehicle)
if (tonumber(playerCash) > 99) then
setTimer(function() t1 = createObject ( 1633, x, y, z, X, Y, Z )end,5000,1)
setTimer ( "destroyObject", 10000, 1, t1 )
outputChatBox (getPlayerName(player) .. " #FF0000has bought Ramp(in 5 sec).",getRootElement(),51,255,0,true)
     savePlayerData (player,"cash",loadPlayerData(player,"cash") -100)
else
outputChatBox ("You cant bought Ramp, you need 100$ first!",player,255,0,0,false)
end
end)
 
addEvent("onbuyramp",true)
addEventHandler("onbuyramp",getRootElement(),buyramp)

Link to comment

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