Jump to content

فزعتكم لآهنتم :(


Recommended Posts

السلام عليكم

لاهنتم ي عيال انا مسوي مود إذآ ضغط على الزر يجيب آلي محدده من القريد لست وينقله ل مكان محدد

لكن مب رآضي يضبط وهذا الكود

addEventHandler( "onClientGUIClick", resourceRoot, function (     ) 
        if ( source == Jailbu ) then 
           if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
           local playerjailed = getPlayerFromName ( guiGridListGetSelectedItemText ( gridlistp )) 
           setSerialData(getPlayerSerial ( playerjailed ) , "Jailed" , 1) 
           setElementPosition ( playerjailed, 1515.2204589844,-1465.6856689453,9.5 ) 
           triggerServerEvent ( "outputjail", localPlayer ) 
            end 
        elseif ( source == bluebu ) then 
            blowVehicle ( isPedDrivingVehicle ( playerjailed )) 
        elseif ( source == givecarbu ) then 
            id = guiGetText ( caridbu ) 
            x , y , z = getElementPosition ( playerjailed ) 
            veh = createVehicle ( id, x , y , z ) 
            triggerServerEvent ( "warptovehicle", localPlayer ) 
         end 
     end 
end ) 

ونفس الحكايه مع bluebu

And givecarbu

ومآيطلع شي بآلديبوق بخصوص آل Jailbu

لو حددت على نفسي انا ينقلني , لكن لو حددت على أحد غيري وضغطت مآينقله :(

Link to comment

للمعلومية لازم تسوي انشاء السيارة بججانب سيرفر . . . :

addEventHandler( "onClientGUIClick", resourceRoot, function (     ) 
   if ( source == Jailbu ) then 
     if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
           local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
           setSerialData(getPlayerSerial ( playerjailed ) , "Jailed" , 1) 
           setElementPosition ( playerjailed, 1515.2204589844,-1465.6856689453,9.5 ) 
           triggerServerEvent ( "outputjail", localPlayer ) 
            end 
    elseif ( source == bluebu ) then 
    if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
        local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
        blowVehicle ( isPedDrivingVehicle ( playerjailed )) 
    end    
    elseif ( source == givecarbu ) then 
     if ( guiGetText ( caridbu ) ~= "" ) then 
      if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
       local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
       id = guiGetText ( caridbu ) 
       x , y , z = getElementPosition ( playerjailed ) 
       veh = createVehicle ( id, x , y , z ) 
      triggerServerEvent ( "warptovehicle", localPlayer ) 
   end 
  end 
 end 
end ) 
Link to comment

سويته لكـ بطريقة افضل .. :

addEventHandler( "onClientGUIClick", resourceRoot, function (     ) 
  if ( source == Jailbu ) then 
   if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
        local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
        setSerialData(getPlayerSerial ( playerjailed ) , "Jailed" , 1) 
        setElementPosition ( playerjailed, 1515.2204589844,-1465.6856689453,9.5 ) 
        triggerServerEvent ( "outputjail", localPlayer ) 
    end 
   elseif ( source == bluebu ) then 
    if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
      local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
      if ( getPedOccupiedVehicle ( playerjailed ) ) then 
         triggerServerEvent ( "blowHisVehicle!", getPedOccupiedVehicle ( playerjailed ) ) 
      end   
    end 
   elseif ( source == givecarbu ) then 
    if ( guiGetText ( caridbu ) ~= "" ) then 
     if ( guiGridListGetSelectedItem ( gridlistp ) ~= -1 ) then 
      local playerjailed = getPlayerFromName ( guiGridListGetItemText ( gridlistp, guiGridListGetSelectedItem ( gridlistp ), 1 ) ) 
      triggerServerEvent ( "giveCar!", playerjailed, guiGetText ( caridbu ) ) 
   end 
  end 
 end 
end ) 

local vehicle = {     }; 
  
addEvent ( "blowHisVehicle!", true ) 
addEventHandler ( "blowHisVehicle!", root, function (    ) 
    blowVehicle ( source ) 
end )   
  
addEvent ( "giveCar!", true ) 
addEventHandler ( "giveCar!", root, function (  id  ) 
   if ( isElement ( vehicle[ source ] ) ) then destroyElement ( vehicle[ source ] ) end 
   local x, y, z = getElementPosition ( source ) 
   vehicle [ source ] = createVehicle ( tonumber ( id ), x, y, z ) 
   if ( vehicle [ source ] ) then 
     warpPedIntoVehicle ( source, vehicle [ source ] ) 
  end 
end ) 
  
addEventHandler ( "onPlayerQuit", root, function (   ) 
 if ( vehicle [ source ] ) then 
   destroyElement ( vehicle [ source ] ) 
   vehicle [ source ] = nil 
 end 
end ) 
  
addEventHandler ( "onVehicleExplode", resourceRoot, function (   ) 
    setTimer( destroyElement, 3000, 1, source ) 
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...