Jump to content

SOLVED


Bean666

Recommended Posts

hi guys , is there anyway there will be 2 skins that can enter this vehicle with restriction?

i have 125 as restriction and i also want to add 285.

function cars () 
    c1 = createVehicle ( 520, -2891.84765625, 460.4560546875, 4.9140625, 0, 0, 90 ) 
end 
  
addEventHandler ( "onResourceStart", resourceRoot, cars ) 
  
function onEnter(thePlayer) 
    if (getElementModel(thePlayer) ~= 125) then 
        cancelEvent() 
        outputChatBox("This Vehicle Is Locked for The Soprano Vipers", thePlayer, 0, 255, 0) 
    end 
end 
  
addEventHandler("onVehicleStartEnter", getRootElement(), onEnter) 

Edited by Guest
Link to comment
  
    function cars () 
        c1 = createVehicle ( 520, -2891.84765625, 460.4560546875, 4.9140625, 0, 0, 90 ) 
    end 
      
    addEventHandler ( "onResourceStart", resourceRoot, cars ) 
      
    function onEnter(thePlayer) 
        if (getElementModel(thePlayer) ~= 125 or getElementModel(thePlayer) ~= 285) then 
            cancelEvent() 
            outputChatBox("This Vehicle Is Locked for The Soprano Vipers", thePlayer, 0, 255, 0) 
        end 
    end 
      
    addEventHandler("onVehicleStartEnter", getRootElement(), onEnter) 

Link to comment
function cars() 
     c1 = createVehicle(520, -2891,84765625, 460.4560546875, 4.9140625, 0, 0, 90) 
end 
addEventHandler("onResourceStart", resourceRoot, cars) 
  
function onEnter(thePlayer) 
     if getElementModel(thePlayer) ~= 125 and getElementModel(thePlayer) ~= 285 then 
        cancelEvent() 
        outputChatBox("This Vehicle Is Locked for The Soprano Vipers", thePlayer, 0, 255, 0) 
    end 
end 
addEventHandler("onVehicleStartEnter", root, onEnter) 

Link to comment
doesn't work please help.
local skins = {[125]=true,[285]=true} 
  
function cars () 
    c1 = createVehicle ( 520, -2891.84765625, 460.4560546875, 4.9140625, 0, 0, 90 ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, cars ) 
  
function onEnter(thePlayer) 
    if thePlayer and isElement(thePlayer) and getElementType(therPlayer) == "player" then 
      if source == c1 then  
        local model = getElementModel(thePlayer) 
        if not (skins[model]) then 
            outputChatBox("This Vehicle Is Locked for The Soprano Vipers", thePlayer, 0, 255, 0) 
            cancelEvent()   
           end  
        end 
    end  
end 
addEventHandler("onVehicleStartEnter", getRootElement(), onEnter) 

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