1LoL1 Posted December 21, 2015 Posted December 21, 2015 Hello, i created script but i don't know how i can fix this. I want to add outputChatBox if player is not in vehicle. if (tonumber(money) >= 500000) then outputChatBox("500000", player, 255, 255, 255, true) local vehicle = getPedOccupiedVehicle(player) x, y, z = getElementPosition(vehicle) setElementPosition(vehicle, x, y, z) setPlayerMoney(player, 500000) if not (vehicle) then outputChatBox("You are not in vehicle !", player, 255, 0, 0, true) end else outputChatBox("You don't have money, you need 500,000$", player, 255, 0, 0, true) end end end)
#RooTs Posted December 21, 2015 Posted December 21, 2015 try this if (tonumber(money) >= 500000) then outputChatBox("500000", player, 255, 255, 255, true) local x, y, z = getElementPosition(vehicle) setElementPosition(vehicle, x, y, z) setPlayerMoney(player, 500000) local vehicle = getPedOccupiedVehicle(player) if vehicle then outputChatBox("You are not in vehicle !", player, 255, 0, 0, true) else outputChatBox("You don't have money, you need 500,000$", player, 255, 0, 0, true) end end
1LoL1 Posted December 21, 2015 Author Posted December 21, 2015 try this if (tonumber(money) >= 500000) then outputChatBox("WWWWWWWWWWWWW", player, 255, 255, 255, true) local x, y, z = getElementPosition(vehicle) setElementPosition(vehicle, x, y, z) setPlayerMoney(player, 500000) local vehicle = getPedOccupiedVehicle(player) if vehicle then outputChatBox("You are not in vehicle !", player, 255, 0, 0, true) else outputChatBox("You don't have money, you need 500,000$", player, 255, 0, 0, true) end end No i mean this: addCommandHandler ("flip", function (player,command) local money = getPlayerMoney(player) if my code if (tonumber(money) >= 500000) then outputChatBox("500000", player, 255, 255, 255, true) local vehicle = getPedOccupiedVehicle(player) x, y, z = getElementPosition(vehicle) setElementPosition(vehicle, x, y, z + 1) setPlayerMoney(player, 500000) if not (vehicle) then outputChatBox("CARRRRRRRRRRRRRRRRR", player, 255, 0, 0, true) end else outputChatBox("MONEYYYYYYYYYYYYYYYYY", player, 255, 0, 0, true) end else if (tonumber(money) >= 500000) then outputChatBox("500000", player, 255, 255, 255, true) local vehicle = getPedOccupiedVehicle(player) x, y, z = getElementPosition(vehicle) setElementPosition(vehicle, x, y, z + 1) setPlayerMoney(player, 2500) if not (vehicle) then outputChatBox("CARRRRRRRRRRRRRRRRR", player, 255, 0, 0, true) end else outputChatBox("MONEYYYYYYYYYYYYYYYYY", player, 255, 0, 0, true) end end end) but not work
iPrestege Posted December 21, 2015 Posted December 21, 2015 why you are doing all this? you want to flip the car only if the player have the money isn't that what you're trying to do?
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