Jump to content

x[ تمت الافاده ]x


Sfa7

Recommended Posts

-- client side 
  
function checkTransfer() 
    if isTransferBoxActive() == true then 
        setTimer(checkTransfer, 2000, 1) 
    else  
        setElementData(localPlayer, "iLoveMyMother", true) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, checkTransfer) 

-- server side 
  
local vehicle = {} 
  
local marker = createMarker(-3561.5, -3002.5, 45, "cylinder", 2, 0, 0, 255, 255) 
  
function spawnVeh(player) 
    if getElementType(player) == "player" and not isPedInVehicle(player) then 
        if not getElementData(player, "iLoveMyMother") then 
            if isElement(vehicle[player]) then 
                destroyElement(vehicle[player]) 
            end 
            local x, y, z = getElementPosition(player) 
            vehicle[player] = createVehicle(429, x + 1, y, z) 
            warpPedIntoVehicle(player, vehicle[player]) 
        end 
    end 
end 
addEventHandler("onMarkerHit", marker, spawnVeh) 
  
addEventHandler("onPlayerQuit", root, 
function() 
     if isElement(vehicle[source]) then 
          destroyElement(vehicle[source]) 
          vehicle[source] = nil 
     end 
end) 

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