Jump to content

xxx[مساعدة]xxx


Doffy

Recommended Posts

guiComboBoxGetSelected

 

        local combo = guiComboBoxGetSelected(combox) ----- نسوي اختصار يجيب اول شئ موجود فـ الكومبو 
        if combo == 0 then ---- نسوي تحقق ان اللي اختاره اول شئ في الكومبو
  ----- Your code

 

في البداية بتسوي حدث

onClientGUIClick

if source == اسم الكومبو

 

Link to comment
-- Created By #_iMr,[E]coo ,,,, Not Deleted It
local combox = اسم الكومبوبوكس
local button = اسم الزر

addEventHandler("onClientGUIClick", resourceRoot, 
   function() 
      if source == button then 
      local Select = guiComboBoxGetSelected(combox)
      local Text = guiComboBoxGetItemText(combox, Select)
      if Text == "اسم السيارة الاولى الموجودة بالكومبوبكوس تحط هنا بدون زيادة او نقصنان" then 
      -- Your Code
    elseif Text == "اسم السيارة الثانية الموجودة بالكومبوبكوس تحط هنا بدون زيادة او نقصنان" then 
     -- Your Code
       end -- end if
    end -- end if 
end -- end function
)

 

Edited by #_iMr.[E]coo
Link to comment
2 minutes ago, #_iMr.[E]coo said:

-- Created By #_iMr,[E]coo ,,,, Not Deleted It
local combox = اسم الكومبوبوكس
local button = اسم الزر

addEventHandler("onClientGUIClick", resourceRoot, 
   function() 
      if source == button then 
      local Select = guiComboBoxGetSelected(combox)
      local Text = guiComboBoxGetItemText(combox, Select)
      if Text == "اسم السيارة الاولى الموجودة بالكومبوبكوس تحط هنا بدون زيادة او نقصنان" then 
      -- Your Code
    elseif Text == "اسم السيارة الثانية الموجودة بالكومبوبكوس تحط هنا بدون زيادة او نقصنان" then 
     -- Your Code
       end -- end if
    end -- end if 
end -- end function
)

 

تسلم علي مساعدته ي بطل

كنت قاعد أسويله الكود وفجأه احصل الصوت ذا يجي 

حق لما رسالة جديدة تجي

يقدر انه يسوي تحقق ان اللي اختاره هو اول او ثاني خيار

مو شرط يجيب الكلام

  • Like 1
Link to comment
1 minute ago, Abu-Solo said:

تسلم علي مساعدته ي بطل

كنت قاعد أسويله الكود وفجأه احصل الصوت ذا يجي 

حق لما رسالة جديدة تجي

يقدر انه يسوي تحقق ان اللي اختاره هو اول او ثاني خيار

مو شرط يجيب الكلام

نو ما تقدر 

+

ما اسامحه اذا يمسح كلامي فوق 

 

Link to comment
Just now, #_iMr.[E]coo said:

نو ما تقدر 

+

ما اسامحه اذا يمسح كلامي فوق 

 

وربي ما رح امسحه :) علشانك يا غالي

4 minutes ago, KinG_Himoo12 said:

وربي ما رح امسحه :) علشانك يا غالي

يخوي حاولت ما نفع شوف 
كلنت

-- Created By #_iMr,[E]coo ,,,, Not Deleted It

local combox = GUIEditor.combobox[1]
local button = GUIEditor.button[6]

addEventHandler("onClientGUIClick", resourceRoot, 
   function() 
      if source == button then 
      local Select = guiComboBoxGetSelected(combox)
      local Text = guiComboBoxGetItemText(combox, Select)
      if Text == "Infernus" then 
      triggerServerEvent("GetInfernus")
    elseif Text == "Sultan" then 
    triggerServerEvent("GetSultan")
       end 
    end 
end
)

سيرفر

 Vehicle = {},

addEvent ( "GetInfernus", true )
addEventHandler ( "GetInfernus", root,
    function (   )
          local x, y, z = getElementPosition ( source )
          local _,_,r = getPedRotation ( source )
          if isElement( Vehicle[source] ) then destroyElement( Vehicle[source] )
        else
          Vehicle[source] = createVehicle ( 411, x, y, z+1, 0, 0,r)
          warpPedIntoVehicle ( source,Vehicle[source] )
        end
    end
);

addEvent ( "GetSultan", true )
addEventHandler ( "GetSultan", root,
    function (   )
          local x, y, z = getElementPosition ( source )
          local _,_,r = getPedRotation ( source )
          if isElement( Vehicle[source] ) then destroyElement( Vehicle[source] )
        else
          Vehicle[source] = createVehicle ( 560, x, y, z+1, 0, 0,r)
          warpPedIntoVehicle ( source,Vehicle[source] )
        end
    end
);

 

  • Like 1
Link to comment
addEventHandler('onClientGUIClick',root, function ( )
if ( source == GUIEditor.button[6] ) then 
local sel = guiComboBoxGetSelected ( GUIEditor.combobox[1] );
local aText = guiComboBoxGetItemText ( GUIEditor.combobox[1] , sel );
if ( sel ~= 0 ) then 
if ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,411);
elseif ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,560);
end
end
end
end );


--- Server Side 

local VehicleTable = { };


addEvent ( 'GetVehicle' , true );
addEventHandler ( 'GetVehicle' , root , function ( idCar )
if ( idCar and type ( idCar ) == 'number' ) then 
if ( isElement ( VehicleTable [ source ] ) ) then destroyElement ( VehicleTable [ source ] ) end
if ( getPedOccupiedVehicle ( source ) ) then removePedFromVehicle ( source ) end
local pos = { getElementPosition ( source ) };
VehicleTable [ source ] = createVehicle ( idCar , pos[1] , pos[2] , pos[3] )
warpPedIntoVehicle ( source , VehicleTable [ source ] )
end
end );

addEventHandler ( 'onPlayerQuit', root , function ( )
if ( isElement ( VehicleTable [ source ] ) ) then
destroyElement ( VehicleTable [ source ] )
VehicleTable [ source ] = nil
end
end );

جرب 

  • Like 1
Link to comment
5 minutes ago, Default said:

addEventHandler('onClientGUIClick',root, function ( )
if ( source == GUIEditor.button[6] ) then 
local sel = guiComboBoxGetSelected ( GUIEditor.combobox[1] );
local aText = guiComboBoxGetItemText ( GUIEditor.combobox[1] , sel );
if ( sel ~= 0 ) then 
if ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,411);
elseif ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,560);
end
end
end
end );


--- Server Side 

local VehicleTable = { };


addEvent ( 'GetVehicle' , true );
addEventHandler ( 'GetVehicle' , root , function ( idCar )
if ( idCar and type ( idCar ) == 'number' ) then 
if ( isElement ( VehicleTable [ source ] ) ) then destroyElement ( VehicleTable [ source ] ) end
if ( getPedOccupiedVehicle ( source ) ) then removePedFromVehicle ( source ) end
local pos = { getElementPosition ( source ) };
VehicleTable [ source ] = createVehicle ( idCar , pos[1] , pos[2] , pos[3] )
warpPedIntoVehicle ( source , VehicleTable [ source ] )
end
end );

addEventHandler ( 'onPlayerQuit', root , function ( )
if ( isElement ( VehicleTable [ source ] ) ) then
destroyElement ( VehicleTable [ source ] )
VehicleTable [ source ] = nil
end
end );

جرب 

موب شغال يخوي

Link to comment
5 minutes ago, Default said:

addEventHandler('onClientGUIClick',root, function ( )
if ( source == GUIEditor.button[6] ) then 
local sel = guiComboBoxGetSelected ( GUIEditor.combobox[1] );
local aText = guiComboBoxGetItemText ( GUIEditor.combobox[1] , sel );
if ( sel ~= 0 ) then 
if ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,411);
elseif ( aText == 'CarName' ) then 
triggerServerEvent('GetVehicle',localPlayer,560);
end
end
end
end );


--- Server Side 

local VehicleTable = { };


addEvent ( 'GetVehicle' , true );
addEventHandler ( 'GetVehicle' , root , function ( idCar )
if ( idCar and type ( idCar ) == 'number' ) then 
if ( isElement ( VehicleTable [ source ] ) ) then destroyElement ( VehicleTable [ source ] ) end
if ( getPedOccupiedVehicle ( source ) ) then removePedFromVehicle ( source ) end
local pos = { getElementPosition ( source ) };
VehicleTable [ source ] = createVehicle ( idCar , pos[1] , pos[2] , pos[3] )
warpPedIntoVehicle ( source , VehicleTable [ source ] )
end
end );

addEventHandler ( 'onPlayerQuit', root , function ( )
if ( isElement ( VehicleTable [ source ] ) ) then
destroyElement ( VehicleTable [ source ] )
VehicleTable [ source ] = nil
end
end );

جرب 

انت ليه نهاية كل كود تحط

;

 

Link to comment
Just now, Abu-Solo said:

شغل الديبق 

واضغط علي السيارة اللي تبي تختارها

وراح يجيك كلام في 

debug

انسخ الصورة او اكتب الكلام اللي طلع #

ادري السيارة الثانية اشتغلت والاولي لا يخوي

خلاص يخوي حليت المشكلة شكرا ليكم جدا ^^

Link to comment
-- الحقوق تعود لــ برستيج
VehicleTable = {  }

addEvent ( "GetVehicle",true ) 
addEventHandler ( "GetVehicle",root, 
  function (  IDCAR  ) 
      local vehicle = getPedOccupiedVehicle( source )
        if vehicle then destroyElement( vehicle ) end
        if isElement ( VehicleTable [ source ] ) then destroyElement ( VehicleTable [ source ] ) end 
              local x1,y1,z1 = getElementPosition ( source ) 
              VehicleTable [source] = createVehicle ( IDCAR,x1,y1,z1 )
              warpPedIntoVehicle( source,VehicleTable [source] ) 
  end
)

addEventHandler( 'onPlayerQuit',root,
  function (  )
    if isElement ( VehicleTable [ source ] ) then 
        destroyElement( VehicleTable [ source ] ) 
        VehicleTable [ source ] = nil
      end
  end
)

 

Edited by #_iMr.[E]coo
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...