Jump to content

x[ مشكلة بكود ]x من فضلكم يا شباب ادخلو لا هنت :(


Recommended Posts

آلسلام وعليكم ورحمة الله وبركاتة

اليوم انا فكرت اسوي سكربت اخذ سياره .. لاجانب وللعرب ..

حدث مشكلة وانا بسوي .. كان نجحا وشغال 100%

لكن بعد لما طورتة بكودات .. حدث مشكلة ومو بيعطي سيآره .. #فارجوكم افهموني :(

الاكواد

-> server <-

addEvent("warpPedIntoVehicle",true) 
addEventHandler("warpPedIntoVehicle",root,car 
local Dead = {}; 
local ID = 411                   
     
      
     local x, y, z = getElementPosition ( source ) 
     Dead[source] = createVehicle( ID, x + 3, y, z ) 
      if ( Dead[source] ) then 
                warpPedIntoVehicle ( source, Dead[source] ) 
                outputChatBox("* [ تم اعطائك موتر ] .",source,math.random ( 150, 255 ),255,math.random ( 222, 255 ),true) 
end 
end) 

Client

addEventHandler("onClientGUIClick",car, 
function() 
triggerServerEvent("warpPedIntoVehicle",localPlayer) 
end 
) 
  
  

Link to comment

addEventHandler("onClientGUIClick", resourceRoot, function (   ) 
  if ( source == car ) then 
      triggerServerEvent ( "createVehicleForPlayer", localPlayer ) 
   end 
end ) 

local Dead = {}; 
local ID = 411                   
  
addEvent ( "createVehicleForPlayer", true ) 
addEventHandler("createVehicleForPlayer",root, function (  ) 
     if Dead[source] then 
         if isElement ( Dead[source] ) then destroyElement ( Dead[source] ) end 
     end 
     local x, y, z = getElementPosition ( source ) 
     Dead[source] = createVehicle( ID, x + 3, y, z ) 
     if ( Dead[source] ) then 
         warpPedIntoVehicle ( source, Dead[source] ) 
         outputChatBox("* [ تم اعطائك موتر ] .",source,math.random ( 150, 255 ),255,math.random ( 222, 255 ),true) 
    end 
end ) 
  
addEventHandler ( "onPlayerQuit", root, function (  ) 
   if Dead[source] then 
     if isElement ( Dead[source] ) then 
       destroyElement ( Dead[source] ) 
     end 
     Dead[source] = nil 
   end 
end ) 
  
addEventHandler ( "onVehicleExplode", resourceRoot, function (  ) 
   destroyElement ( source ) 
end ) 
Link to comment
addEventHandler("onClientGUIClick", resourceRoot, function (   ) 
  if ( source == car ) then 
      triggerServerEvent ( "createVehicleForPlayer", localPlayer ) 
   end 
end ) 

local Dead = {}; 
local ID = 411                   
  
addEvent ( "createVehicleForPlayer", true ) 
addEventHandler("createVehicleForPlayer",root, function (  ) 
     if Dead[source] then 
         if isElement ( Dead[source] ) then destroyElement ( Dead[source] ) end 
     end 
     local x, y, z = getElementPosition ( source ) 
     Dead[source] = createVehicle( ID, x + 3, y, z ) 
     if ( Dead[source] ) then 
         warpPedIntoVehicle ( source, Dead[source] ) 
         outputChatBox("* [ تم اعطائك موتر ] .",source,math.random ( 150, 255 ),255,math.random ( 222, 255 ),true) 
    end 
end ) 
  
addEventHandler ( "onPlayerQuit", root, function (  ) 
   if Dead[source] then 
     if isElement ( Dead[source] ) then 
       destroyElement ( Dead[source] ) 
     end 
     Dead[source] = nil 
   end 
end ) 
  
addEventHandler ( "onVehicleExplode", resourceRoot, function (  ) 
   destroyElement ( source ) 
end ) 

تم .. يعطيك آلعافية ي كنق :fadein:

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