Jump to content

dx


Recommended Posts

ابي لما يوخد سياره

يجي له مثل سي جي لما تربح اي مهمه يقول

Win 453

ابي لما يخش ماركر ويعطيه سياره

يقوله

Welcome To Car :arrowup:

Code

:

  
local marker = createMarker(0,someY,someZ) 
addEventHandler("onMarkerHit",marker,function(element,dimension) 
    if getElementType(element) == "player" and getElementDimension(element) == dimension and not isPedInVehicle(element) then 
        local x,y,z = getElementPosition(marker) 
        local vehicle = createVehicle(432,x,y,z) 
        warpPedIntoVehicle(element,vehicle,0) 
        outputChatBox("You received a car!",element) 
    end 
end) 
  

Link to comment

-- Server Side # 
local marker1 = createMarker (x,y,z,'cylinder',2,255,0,255,177 ) 
  
addEventHandler('onMarkerHit',marker1,function (plr) 
    if getElementType(plr) == 'player' and not isPedInVehicle(plr) then 
        if isElement(vehicle[plr]) then destroyElement(vehicle[plr]) vehicle[plr] = nil end 
            local x,y,z = getElementPosition(plr) 
                vehicle[plr] = createVehicle(id,x,y,z) 
                    warpPedIntoVehicle(plr,vehicle[plr]) 
                        outputChatBox('Welcome to your car',plr,255,0,255,true) 
        end 
    end 
) 
  
addEventHandler('onVehicleExplode',resourceRoot,function() 
    setTimer(destroyElement,2000,1,source) 
    end 
) 
     
addEventHandler('onPlayerQuit',root,function() 
    if isElement(vehicle[source]) then  
        destroyElement(vehicle[source])  
            vehicle[source] = nil  
        end 
    end 
) 

كمل الي تبيه لأني ما فهمتك ,,

Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...