1LoL1 Posted December 21, 2015 Share 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) Link to comment
#RooTs Posted December 21, 2015 Share 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 Link to comment
1LoL1 Posted December 21, 2015 Author Share 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 Link to comment
iPrestege Posted December 21, 2015 Share 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? Link to comment
#RooTs Posted December 21, 2015 Share Posted December 21, 2015 client or server side ? 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