Jump to content

Help


iPrestege

Recommended Posts

Hello how are you .. hmm .. i have a problem with this wtf script ! whats the wrong -_-" :mrgreen:

-- 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
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
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 :mrgreen: still not working -_-" :|

Link to comment
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
  
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 by Guest
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...