Jump to content

[HELP] Script


1LoL1

Recommended Posts

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

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

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