Jump to content

تعريف السورس


Recommended Posts

ليه مايدخلني داخل السياره عن طريق

warpPedIntoVehicle

يقولي في الديبوق

expected Ped

؟؟

addEventHandler("onClientGUIClick",root, 
function () 
if source == StarTech then 
    local x, y, z = getElementPosition( getLocalPlayer ( ) ) 
    local StarTech = createVehicle( 405, x, y, z )  
    warpPedIntoVehicle ( source, StarTech )  
end 
 end 
)  

Link to comment
  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

-- Client  
addEventHandler("onClientGUIClick",root, 
function () 
if source == StarTech then 
    triggerServerEvent ( "warp", localPlayer) 
end 
 end 
) 
  
-- Server 
addEvent('warp',true) 
addEventHandler('warp',root,  
function ( ) 
if ( isElement(theVehicle) ) then 
destroyElement(theVehicle) 
end 
local x,y,z = getElementPosition ( source ) 
theVehicle = createVehicle(405,x,y,z) 
warpPedIntoVehicle(source,theVehicle) 
end) 

Edited by Guest
Link to comment

طيب ابيه بس يطلع سياره وحده

يعني مثلا بسوي سيارتين في لوحة

اذا ضغط على الزر الاول ينزل السياره ( عادي )

واذا ضغط على الزر الثاني يسحب السياره الاولى وينزل الثانيه

addEventHandler("onClientGUIClick",root, 
function () 
if source == Star2 then 
    triggerServerEvent ( "warp2", localPlayer) 
end 
 end 
) 

------------------

addEvent('warp2',true) 
addEventHandler("warp2",root, 
function ( ) 
if ( isElement(theVehicle) ) then 
destroyElement(theVehicle) 
end 
local x,y,z = getElementPosition ( source ) 
theVehicle = createVehicle(350,x,y,z) 
warpPedIntoVehicle(source,theVehicle) 
end) 
  

Link to comment

كلنت

  
        StarTech = guiCreateStaticImage(9, 30, 202, 35, "StarTech.png", false) 
        Wagon = guiCreateStaticImage(9, 81, 201, 35, "Wagon.png", false) 
  
addEventHandler("onClientGUIClick",root, 
function () 
if source == StarTech then 
    triggerServerEvent ( "warp", localPlayer) 
end 
 end 
)  
  
--------------------------------------------- 
الزر الثاني------------------ 
  
addEventHandler("onClientGUIClick",root, 
function () 
if source == Wagon then 
    triggerServerEvent ( "warp2", localPlayer) 
end 
 end 
)  

سيرفر :

addEvent( "warp", true ) 
function warp () 
if ( isElement(StarTech) ) then 
destroyElement(StarTech) 
end 
    local x, y, z = getElementPosition( source ) 
    local StarTech = createVehicle( 405, x, y, z ) 
     warpPedIntoVehicle ( source, StarTech ) 
end 
addEventHandler ( "warp", getRootElement(), warp ) 
  
  
addEvent( "warp2", true ) 
function warp2 () 
if ( isElement(Wagon) ) then 
destroyElement(Wagon) 
end 
    local x, y, z = getElementPosition( source ) 
    local Wagon = createVehicle( 499, x, y, z ) 
     warpPedIntoVehicle ( source, Wagon ) 
end 
addEventHandler ( "warp2", getRootElement(), warp2 ) 

Link to comment
--- Client 
  
 addEventHandler('onClientGUIClick',root,  
 function ( ) 
 if ( source == Car ) then 
 triggerServerEvent('Warp',localPlayer) 
 elseif ( source == Car2 ) then 
 triggerServerEvent('Warp2',localPlayer) 
 end 
  end 
  ) 
   
  -- Server 
   
  addEvent('Warp',true) 
  addEventHandler('Warp',root, function ( ) 
  if ( isElement(car2) ) then 
  destroyElement(car2) 
  end 
  local x,y,z = getElementPosition ( source ) 
  car2 = createVehicle(id,x,y,z) 
  warpPedIntoVehicle(source,car2) 
  end 
 ) 
  
   addEvent('Warp2',true) 
  addEventHandler('Warp2',root, function ( ) 
  if ( isElement(car) ) then 
  destroyElement(car) 
  end 
  local x,y,z = getElementPosition ( source ) 
  car = createVehicle(id,x,y,z) 
  warpPedIntoVehicle(source,car) 
  end 
 ) 

id = الايدي

Car = اسم الزر

Car2 = اسم الزر

جرب ..

Link to comment
  local Veh = { } 
addCommandHandler('Naif', function ( player ) 
if ( isElement(Veh[player]) ) then 
destroyElement(Veh[player]) 
end 
local x,y,z = getElementPosition ( player ) 
Veh[player] = createVehicle(411,x,y,z) 
warpPedIntoVehicle(player,Veh[player]) 
end) 

^ شوفه وطبقه على الي انت تبي تسويه ..

Link to comment

Client side #

StarTech = guiCreateStaticImage(9, 30, 202, 35, "StarTech.png", false) 
Wagon = guiCreateStaticImage(9, 81, 201, 35, "Wagon.png", false) 
  
addEventHandler ("onClientGUIClick", resourceRoot,  
    function () 
        if (source == StarTech) then 
            triggerServerEvent ("warp", localPlayer) 
        end 
        if (source == Wagon) then 
            triggerServerEvent ("warp2", localPlayer) 
        end 
    end 
) 

Server side #

local Vehicles = { } 
addEvent ("warp", true) 
addEventHandler ("warp", root,  
    function () 
        if isElement (Vehicles [source]) then 
            destroyElement (Vehicles [source]) 
            Vehicles [source] = nil 
        end 
        local x,y,z = getElementPosition (source) 
        Vehicles [source] = createVehicle (405, x,y,z) 
        warpPedIntoVehicle (source, Vehicles [source]) 
    end 
) 
  
addEvent ("warp2", true) 
addEventHandler ("warp2", root,  
    function () 
        if isElement (Vehicles [source]) then 
            destroyElement (Vehicles [source]) 
            Vehicles [source] = nil 
        end 
        local x,y,z = getElementPosition (source) 
        Vehicles [source] = createVehicle (499, x,y,z) 
        warpPedIntoVehicle (source, Vehicles [source]) 
    end 
) 
  
addEventHandler ("onVehicleExplode", resourceRoot,  
    function () 
        destroyElement (source) 
    end 
) 
  
addEventHandler ("onPlayerQuit", root,  
    function () 
        if isElement (Vehicles [source]) then 
            destroyElement (Vehicles [source]) 
            Vehicles [source] = nil 
        end 
    end 
) 
Edited by Guest
Link to comment

ممكن اعرف ليه مايشتغل

ذا اذا ضغط مره على الزر يخفي الشات واذا ضغط مره ثانيه يظهر الشات

addEventHandler("onClientGUIClick", root, 
function () 
   if source == chat then 
       showChat(false) 
       else 
      showChat(true)  
   end 
end 
) 

Link to comment

طيب لو ابيها فتح اغلاق ابواب السياره

كذا ؟

addEventHandler("onClientGUIClick", root, 
function () 
   if source == doors then 
    playervehicle = getPlayerOccupiedVehicle ( thePlayer )   
    if ( playervehicle ) then 
    if isVehicleLocked ( playervehicle ) then 
    setVehicleLocked ( playervehicle, true ) = not setVehicleLocked ( playervehicle, false ) 
    end 
    end 
   end 
end 
) 

Link to comment

addEventHandler('onClientGUIClick',root, function ( ) 
if ( source == Locked ) then 
if ( getPedOccupiedVehicle(localPlayer) ) then 
if ( isVehicleLocked(getPedOccupiedVehicle(localPlayer)) ) then 
setVehicleLocked(getPedOccupiedVehicle(localPlayer),false) 
else 
setVehicleLocked(getPedOccupiedVehicle(localPlayer),true) 
end 
end 
end 
 end 
 ) 
  

جرب وشوف

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