Jump to content

تصحيح كود إنفجار المركبة


Recommended Posts

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

وانا ابغيه يكون لسيارات محدده + تصحيح للكود

  
  
Client Side -- 
  
addEventHandler("onClientVehicleEnter", getRootElement(), 
function ( thePlayer ) 
               local RedTeam = getTeamName ( getTeamFromName ( "RedTeam" ) ) 
                local playervehicle = getPlayerOccupiedVehicle ( thePlayer ) 
        if ( playervehicle ) then  
        if RedTeam then 
           blowVehicle ( playervehicle ) 
  
                     end  
              end 
             
        end  
    ) 

وشكراً

Link to comment

-- # Server Side : 
local VehicleIDs = { id,id,id } 
  
addEventHandler('onVehicleStartEnter',root, 
    function ( player ) 
      local team = getPlayerTeam ( player ) 
        if team then 
            local red = getTeamFromName( 'RedTeam' )  
               if red then 
                if team == red then 
                    for _,key in ipairs ( VehicleIDs ) do 
                        if getElementModel ( source ) == key then 
                            blowVehicle ( source ) 
                        end 
                    end 
                end 
            end 
        end 
    end 
) 
  

حط الايديات اللي تبي بالجدول

Link to comment
-- # Server Side : 
local VehicleIDs = { id,id,id } 
  
addEventHandler('onVehicleStartEnter',root, 
    function ( player ) 
      local team = getPlayerTeam ( player ) 
        if team then 
            local red = getTeamFromName( 'RedTeam' )  
               if red then 
                if team == red then 
                    for _,key in ipairs ( VehicleIDs ) do 
                        if getElementModel ( source ) == key then 
                            blowVehicle ( source ) 
                        end 
                    end 
                end 
            end 
        end 
    end 
) 
  

حط الايديات اللي تبي بالجدول

شكراً و جاري التجربةة :roll:

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