-Xero

[Help] Problem creating private cars

Recommended Posts

Hi everyone, i found a script with works on team system, i edited the script to work with gang system, but dont work, the player can enter in the vehicle without being in the gang.. here is the code..

Kami = { 
  
createVehicle ( 422, -1217.5534667969, 1830.9927978516, 46.3984375, 0, 0, 0 ),  
  
} 
  
for i,car in ipairs(Kami) do 
     setElementData(car,"Gang","kami") 
end 
  
  
addEventHandler("onVehicleStartEnter", root, 
function(player) 
     local gangName = getPlayerGang(player) and getGangName(getPlayerGang(player)) 
     if  gangName ~= getElementData(source,"Gang") then 
          cancelEvent() 
     end 
end) 

Captura.png

 

Share this post


Link to post

You are getting the error because getPlayerGang is not defined in your script.

You must define it in your script to use it.

Try copying the getPlayerGang function to this code.

Share this post


Link to post

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.