iPrestege Posted January 4, 2013 Share Posted January 4, 2013 Hello how are you .. hmm .. i have a problem with this wtf script ! whats the wrong -_-" -- Server Side i triger it from client side .. addEvent("Car", true) addEventHandler("Car", root, function() local mapName = getMapName(source) if mapName ~= "Arena-1" then local PlayerMoney = getPlayerMoney(source) if PlayerMoney >= 50000 then takePlayerMoney(source, 50000) x, y, z = getElementPosition(source), source, 50000 Vehicle = createVehicle(id, x, y, z) warpPedIntoVehicle(source, Vehicle) setVehicleLocked(Vehicle, true) setTimer(function() destroyElement(source, Vehicle) end, 300000, 1, true) outputChatBox("#FF0000 .."getPlayerName".. (source) Has Bought A Rhino !", root, 255, 255, 0, true) else outputChatBox("You Dont Have Money to Buy a Rhino", source, 255, 0, 0, true) end else outputChatBox("Round is not started!", source, 255, 0, 0, true) end end ) Link to comment
manve1 Posted January 4, 2013 Share Posted January 4, 2013 addEvent("Car", true) addEventHandler("Car", root, function() local mapName = getMapName(source) if mapName ~= "Arena-1" then local PlayerMoney = getPlayerMoney(source) if PlayerMoney >= 50000 then takePlayerMoney(source, 50000) x, y, z = getElementPosition(source), source, 50000 Vehicle = createVehicle(id, x, y, z) warpPedIntoVehicle(source, Vehicle) setVehicleLocked(Vehicle, true) setTimer(function() destroyElement(source, Vehicle) end, 300000, 1 ) outputChatBox("#FF0000 ".. getPlayerName(source) .."Has Bought A Rhino !", root, 255, 255, 0, true) else outputChatBox("You Dont Have Money to Buy a Rhino", source, 255, 0, 0, false) end else outputChatBox("Round is not started!", source, 255, 0, 0, false) end end ) Link to comment
iPrestege Posted January 4, 2013 Author Share Posted January 4, 2013 addEvent("Car", true) addEventHandler("Car", root, function() local mapName = getMapName(source) if mapName ~= "Arena-1" then local PlayerMoney = getPlayerMoney(source) if PlayerMoney >= 50000 then takePlayerMoney(source, 50000) x, y, z = getElementPosition(source), source, 50000 Vehicle = createVehicle(id, x, y, z) warpPedIntoVehicle(source, Vehicle) setVehicleLocked(Vehicle, true) setTimer(function() destroyElement(source, Vehicle) end, 300000, 1 ) outputChatBox("#FF0000 ".. getPlayerName(source) .."Has Bought A Rhino !", root, 255, 255, 0, true) else outputChatBox("You Dont Have Money to Buy a Rhino", source, 255, 0, 0, false) end else outputChatBox("Round is not started!", source, 255, 0, 0, false) end end ) What did you do ? nothing still not working -_-" Link to comment
manve1 Posted January 4, 2013 Share Posted January 4, 2013 Actually if u would look, u messed up the OutputChatBox, and the '(source)' plus the '..'s were outside into the say chat thing so i would output them and would cause an error Link to comment
TAPL Posted January 4, 2013 Share Posted January 4, 2013 local mapName = getMapName(source) -- read wiki, this function not need argument. x, y, z = getElementPosition(source), source, 50000 -- what is this? lol setTimer(function() destroyElement(source, Vehicle) end, 300000, 1, true) should be: setTimer(function(source) destroyElement(source, Vehicle) end, 300000, 1, source) And as manve1 said about the outputChatBox. Link to comment
MR.S3D Posted January 4, 2013 Share Posted January 4, 2013 (edited) Vehicle = {} addEvent("Car", true) addEventHandler("Car", root, function() local mapName = getMapName() if mapName ~= "Arena-1" then local PlayerMoney = getPlayerMoney(source) if PlayerMoney >= 50000 then takePlayerMoney(source, 50000) x, y, z = getElementPosition(source) if Vehicle[source] then destroyElement(Vehicle[source]) Vehicle[source] = nil end Vehicle[source] = createVehicle(432, x, y, z) if Vehicle[source] then warpPedIntoVehicle(source, Vehicle[source]) setVehicleLocked(Vehicle[source], true) setTimer(function(source) if Vehicle[source] then destroyElement(Vehicle[source]) Vehicle[source] = nil end end, 300000, 1, source) end outputChatBox("#FF0000" .. getPlayerName(source) .. " Has Bought A Rhino !", root, 255, 255, 0, true) else outputChatBox("You Dont Have Money to Buy a Rhino", source, 255, 0, 0, true) end else outputChatBox("Round is not started!", source, 255, 0, 0, true) end end ) Edited January 4, 2013 by Guest Link to comment
TAPL Posted January 4, 2013 Share Posted January 4, 2013 Vehicle = createVehicle(id, x, y, z) -- id is not defined. Link to comment
iPrestege Posted January 4, 2013 Author Share Posted January 4, 2013 @ Manve I'm sorry I did not see the edited this it,s my fault am sorry .. .. Thanks For Trying To Help =D @ TAPL i Read the wiki quickly .. Thanks @ MR.S3D Thanks it works correctly ... Thanks =D Link to comment
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