Jump to content

طلب مساعده !


Recommended Posts

جرب

ma = createMarker (x,y,z, "cylinder", 2, 255, 0, 255, 255 ) 
  
V = {} 
function M( thePlayer ) 
          if V[thePlayer] then 
                 if isElement(V[thePlayer]) then 
                        destroyElement(V[thePlayer]) 
                 end 
          end 
          local x,y,z = getElementPosition(thePlayer) 
          V[thePlayer] = createVehicle(411,x,y,z)       
          warpPedIntoVehicle(source, V[thePlayer]) 
      end 
addEventHandler( "onMarkerHit", ma, M ) 

Link to comment
جرب الطريقة هذي
vehicle = { } 
  
vehicle[source] = createVehicle ( ... ) 
if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 

بس اجي على الماركر بوقف وما يصير شي

يمكن انا وضعته غلط ...

function g() 
setElementData(source,"xxx",tostring("Yes")) 
end 
addEventHandler("onPlayerJoin",root,g) 
  
ma = createMarker (1556.6724853516,-1606.4342041016, 12.3, "cylinder", 2, 255, 0, 255, 150 ) 
  
vehicle = { } 
  
function M( thePlayer ) 
get = getElementData(thePlayer,"xxx") 
if get == "Yes" then 
if not isPedInVehicle(thePlayer) then 
x,y,z = getElementPosition( thePlayer ) 
if getElementModel( thePlayer ) == 287 then 
vehicle[source] = createVehicle ( 596, x, y, z ) 
setVehicleColor(vehicle[source],27,54,160,255,255,255) 
warpPedIntoVehicle(thePlayer,vehicle[source]) 
if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) 
end 
end 
         end 
       end 
     end 
addEventHandler( "onMarkerHit", ma, M ) 
  

Link to comment
جرب
ma = createMarker (x,y,z, "cylinder", 2, 255, 0, 255, 255 ) 
  
V = {} 
function M( thePlayer ) 
          if V[thePlayer] then 
                 if isElement(V[thePlayer]) then 
                        destroyElement(V[thePlayer]) 
                 end 
          end 
          local x,y,z = getElementPosition(thePlayer) 
          V[thePlayer] = createVehicle(411,x,y,z)       
          warpPedIntoVehicle(source, V[thePlayer]) 
      end 
addEventHandler( "onMarkerHit", ma, M ) 

جرب هذا وقولي الخطأ اذا كان فيه خطأ

Link to comment

طيب مثلا انا عملت كمان ماركر

وانا بروح اخد سيارة من ماركر الاول

ورحت اخد كمان سيارة من الماركر الثاني

كيف بدي تختفي السيارة الي اختها من الماركر الاول ؟؟

اسف من كثر الطلبات :oops:

هذه اخر طلب لاني بدي انهيه

Link to comment
طيب مثلا انا عملت كمان ماركر

وانا بروح اخد سيارة من ماركر الاول

ورحت اخد كمان سيارة من الماركر الثاني

كيف بدي تختفي السيارة الي اختها من الماركر الاول ؟؟

اسف من كثر الطلبات :oops:

هذه اخر طلب لاني بدي انهيه

vehicle = {} 
  
local TableMarker = 
{ 
    { x = 0, y = 0, z = 0 }, 
    { x = 10, y = 10, z = 10 } 
} 
     
for _, m in ipairs ( TableMarker ) do 
    local marker = createMarker ( m.x, m.y, m.z ) 
addEventHandler ( 'onMarkerHit', marker, 
    function ( ... ) 
        if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
        vehicle[source] = createVehicle ( 411, getElementPosition ( ... ) ) 
        warpPedIntoVehicle ( ..., vehicle[source] ) 
    end 
) 
end 

جرب

Edited by Guest
Link to comment
  
vehicle = {} 
  
local TableMarker = 
{ 
    { x = 1556.6724853516, y = -1606.4342041016, z = 12.3 }, 
    { x = 1544.0750732422, y = -1609.6583241953, z = 12.3 } 
} 
  
addEventHandler ( 
    'onResourceStart', resourceRoot, 
    function ( ) 
        for _, m in ipairs ( TableMarker ) do 
            local marker = createMarker ( m.x, m.y, m.z ) 
        end 
        addEventHandler ( 'onMarkerHit', marker, onHit ) 
    end 
) 
  
  
  
function onHit (thePlayer ) 
    if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
    vehicle[source] = createVehicle ( 596, getElementPosition (x,y,z) ) 
    warpPedIntoVehicle ( thePlayer,vehicle[source] ) 
end 

ما يصير شي

ويعطيني

WARNING >> AddEventHandler

Link to comment
vehicle = {} 
  
local TableMarker =  
{ 
    {x = 1556.6724853516, y = -1606.4342041016, z = 12.3}, 
    {x = 1544.0750732422, y = -1609.6583241953, z = 12.3} 
} 
  
addEventHandler("onResourceStart", resourceRoot, 
function() 
     for _, m in ipairs (TableMarker) do 
          local marker = createMarker(m.x, m.y, m.z) 
          addEventHandler("onMarkerHit", marker, onHit) 
     end 
end) 
  
function onHit(player) 
     if getElementType(player) == "player" and not isPedInVehicle(player) then 
          if isElement(vehicle[player]) then destroyElement(vehicle[player]) end 
          local x, y, z = getElementPosition(player, x, y, z) 
          vehicle[player] = createVehicle(596, x, y, z) 
          warpPedIntoVehicle(player, vehicle[player]) 
     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...