Jump to content

الوزنية[تمت الافاده[


Recommended Posts

السلام عليكم

عندي كود تاخذ سيارة اذا دخلت الماركر وجيت اظيف له كود يركب الوزنية وما ظبط

ملاحظه / المود مركب مع مود الوزنيات

الكود

سيرفر

tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( -4033.39746, -3061.74316, 379.18237, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer,tCars[thePlayer]) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source,controller) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 

كلنت

addEvent("handeling",true) 
addEventHandler("handeling",root, 
function (car) 
importHandling(car,"1500.0 1200.0 0.1 0.0 0.0 -0.05 70 0.50 0.8 0.70 5 800.0 33.0 16.0 F P 5.4 0.90 1 45.0 0.95 0.14 0.0 0.80 -0.25 0.5 -0.7 0.00 0.00 19000 0 0 0 3 0") 
end) 

Edited by Guest
Link to comment
-- Client Side 
  
addEvent("handeling",true) 
addEventHandler("handeling",root, 
function Handling() 
    local Vehicle = getPedOccupiedVehicle(localPlayer) 
      local Handling = "1500.0 1200.0 0.1 0.0 0.0 -0.05 70 0.50 0.8 0.70 5 800.0 33.0 16.0 F P 5.4 0.90 1 45.0 0.95 0.14 0.0 0.80 -0.25 0.5 -0.7 0.00 0.00 19000 0 0 0 3 0" 
     if Vehicle then 
    importHandling(getPedOccupiedVehicle(localPlayer), Handling, "SA") 
  
          outputChatBox("#80ff40 Handling has been applied successfully!!", 0, 255, 0, true) 
  
  end) 

=====

-- Server Side 
  
tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( -4033.39746, -3061.74316, 379.18237, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer,tCars[thePlayer]) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 

Link to comment

@برستيج

تسلم لاكن الكود في اخطا لكن عدلتها

=====

في مشكلة في الكود

server

tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( 1807, 858, 11, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

سطر 15 يقول في مشكلة في الارقمنت الاول حاولت اصلحها وما ظبط

Link to comment
@برستيج

تسلم لاكن الكود في اخطا لكن عدلتها

=====

في مشكلة في الكود

server

tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( 1807, 858, 11, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

سطر 15 يقول في مشكلة في الارقمنت الاول حاولت اصلحها وما ظبط

حطه

setElementData( tCars[thePlayer], "tCan", true ) 

element data يمديك تختصرها بدون

فيه جدولين ليه ؟

Link to comment
@برستيج

تسلم لاكن الكود في اخطا لكن عدلتها

=====

في مشكلة في الكود

server

tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( 1807, 858, 11, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

سطر 15 يقول في مشكلة في الارقمنت الاول حاولت اصلحها وما ظبط

والله الكود استخدمتة فـ لوحة وكآن شغال معي :mrgreen:

@ المشكلة الثانية شوف رد عآشق

Link to comment
@برستيج

تسلم لاكن الكود في اخطا لكن عدلتها

=====

في مشكلة في الكود

server

tCars = {} 
tCan = {} 
function onjoin () 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerJoin",root,onjoin) 
  
marcker1ofGive = createMarker ( 1807, 858, 11, "cylinder", 1.5, 255, 0, 0, 255 ) 
  
function MarkerHit(thePlayer, source) 
    if getElementData(tCan[thePlayer],"tCan") ~= true then 
        if not isPedInVehicle(thePlayer) then 
            tCars[thePlayer] = createVehicle ( 411, 1825.5, 881.5, 10.4) 
            warpPedIntoVehicle(thePlayer,tCars[thePlayer]) 
            setElementData(tCan[thePlayer],"tCan",true) 
            triggerClientEvent(thePlayer,"handeling",thePlayer) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", marcker1ofGive, MarkerHit ) 
  
function onquit () 
    if tCars[source] then 
        if isElement(tCars[source]) then 
            destroyElement(tCars[source]) 
        end 
    end 
    setElementData(tCan[source],"tCan",false) 
end 
addEventHandler("onPlayerQuit",root,onquit) 
  
function destroyIt() 
    setTimer(function(car) 
        for k,v in ipairs ( tCars ) do 
            if v == car then 
                tCars[k] = nil 
                setElementData(tCan[k],"tCan",false) 
            end 
        end 
        destroyElement(car) 
    end , 2000 , 1 ,source) 
end 
addEventHandler("onVehicleExplode",root,destroyIt) 
  

سطر 15 يقول في مشكلة في الارقمنت الاول حاولت اصلحها وما ظبط

والله الكود استخدمتة فـ لوحة وكآن شغال معي :mrgreen:

@ المشكلة الثانية شوف رد عآشق

في كود الكلنت حاط اسم الوظيفه داخل قوس وناقصك اند

=======

خلاص تمت الافاده مشكورين عاشق وبرستيج

يغلق

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