Jump to content

استفسار لاصحاب الخبرة --- تم الارشآآآد


Recommended Posts

السلام عليكم اخوان 
كيف الاحوال .. ان شاء الله بخير 
المهم 
لدي استفسار و هو حول كيفية انشاء ماركر لما تدخل فيه يعطيك موتر او سيارة 
هو شفته في بدايات كثيرة 
حاولت اسويه من الماب اديتور و ما زبط 
ممكن الطريقة الصحيحة و شكرا لكم مسبقا 

Edited by Guest
Link to comment

-- Server Side --

marker = createMarker(x, y, z, "cylinder", 1.5, 255, 255, 0) 
  
addEventHandler("onMarkerHit", marker, 
function(player) 
     if getElementType(player) == "player" and not isPedInVehicle(player) then 
          warpPedIntoVehicle(player, createVehicle(id, getElementPosition(player))) 
     end 
end) 

Link to comment

server:

  
-- By Al3grab 
tCars = {} 
tCan = {} 
function onjoin () 
    tCan[source] = nil 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker (-3584.5581054688,-3007.271484375,60.200000762939, "cylinder", 4.5, 0, 0, 255, 320 ) 
  
function MarkerHit(thePlayer, source) 
    if tCan[thePlayer] ~= true then 
        if not isPedInVehicle(thePlayer) then 
            x,y,z = getElementPosition( thePlayer ) 
            tCars[thePlayer] = createVehicle ( 411, x,y,z ) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            tCan[thePlayer] = true           
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    tCan[source] = nil 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                tCan[k] = nil 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source,controller) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

Link to comment
server:
  
-- By Al3grab 
tCars = {} 
tCan = {} 
function onjoin () 
    tCan[source] = nil 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker (-3584.5581054688,-3007.271484375,60.200000762939, "cylinder", 4.5, 0, 0, 255, 320 ) 
  
function MarkerHit(thePlayer, source) 
    if tCan[thePlayer] ~= true then 
        if not isPedInVehicle(thePlayer) then 
            x,y,z = getElementPosition( thePlayer ) 
            tCars[thePlayer] = createVehicle ( 411, x,y,z ) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            tCan[thePlayer] = true           
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    tCan[source] = nil 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                tCan[k] = nil 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source,controller) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

شخاابيط

Marker = createMarker(...) 
addEventHandler('onMarkerHit',Marker, 
function(hit) 
if(getElementType(hit)=='player')then 
if(isElement(car))then destroyElement(car) end  return end 
car =createVehicle( .. ) 
warpPedIntoVehicle(hit,car) 
end 
end 
addEventHandler('onPlayerQuit',root,function() if isElement(car) then destroyElement(car) end) 
addEventHandler('onVehicleExplode',car,function() destroyElement(source) 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...