Jump to content

Team restriction problem.


Recommended Posts

I made a spawn marker but I want it to spawn only when someone from the Armed Forces Team steps in But it's not working what's wrong with it?

--server sided 
  
local vehicleMarker = createMarker(208.60000610352, 1920.6999511719, 16.60000038147, 'cylinder', 2.0, 40, 73, 0, 200 ) 
  
function vehicleMarkerHit ( hitElement, matchingDimension ) 
      if getPlayerTeam(source) == ("Armed Forces") then 
  if getElementType ( hitElement ) == "player" and not isPedInVehicle (hitElement) then 
        local vehicle = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) 
        warpPedIntoVehicle(hitElement, vehicle) else 
end 
end 
end 
addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) 

Link to comment
  
  
local vehicleMarker = createMarker(208.60000610352, 1920.6999511719, 16.60000038147, 'cylinder', 2.0, 40, 73, 0, 200 ) 
  
function vehicleMarkerHit ( hitElement, matchingDimension ) 
    local playerTeam = getPlayerTeam(hiElement) 
        if ( playerTeam ) then 
            local teamName = getTeamName(playerTeam) 
            if ( teamName and teamName == "Armed Forces" ) then 
                if ( getElementType ( hitElement ) == "player" and not isPedInVehicle (hitElement) ) then 
                    local theNewVeh = createVehicle ( 470, 208.60000610352, 1920.6999511719, 16.60000038147, 0, 0, 90 ) 
                        if theNewVeh then 
                        warpPedIntoVehicle(hitElement, theNewVeh)  
                        end 
                end 
            end 
        end 
end 
addEventHandler( "onMarkerHit", vehicleMarker , vehicleMarkerHit ) 
  

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