Jump to content

buy item help


Recommended Posts

Posted

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)

Posted

omfg

setTimer ( "destroyObject", 10000, 1, t1 )

why in quotes?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
it's destroyElement by the way

lol, true, when i saw the quotes i didnt read rest xD

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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