Jump to content

Vehicle Rights


Ballasbuster

Recommended Posts

Hi guys, I have a lot problems with scritpting :P. I made script with RemovePlayerFromVehicle , but this resource doesn't work...

  
local policevehicles = { [596]=true, [528]=true, [597]=true, [598]=true, [599]=true, [427]=true, [601]=true, [490]=true, [497]=true, [523]=true }  
local policeskins = { [280]=true, [143]=true } 
function enterVehicle ( theVehicle, seat, jacked )                         
    local skinID = getPlayerSkin ( source ) 
    local vehID = getVehicleID ( theVehicle ) 
    if policevehicles[vehID] and not policeskins[skinID] then             
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 
  
local taxivehicles = { [420]=true, [438]=true }   
local taxiskins = { [20]=true, [143]=true }      
function enterVehicle ( theVehicle, seat, jacked )                          
    local skinID = getPlayerSkin ( source )                              
    local vehID = getVehicleID ( theVehicle ) 
    if taxivehicles[vehID] and not taxiskins[skinID] then               
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 
  
local mechanicvehicles = { [487]=true, [443]=true, [487]=true, [525]=true, [530]=true, [522]=true, [574]=true, [578]=true, [583]=true }   
local mechanicskins = { [16]=true, [143]=true }      
function enterVehicle ( theVehicle, seat, jacked )                          
    local skinID = getPlayerSkin ( source )                              
    local vehID = getVehicleID ( theVehicle ) 
    if mechanicvehicles[vehID] and not mechanicskins[skinID] then               
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 
  
local medicvehicles = { [563]=true, [416]=true }   
local medicskins = { [274]=true, [143]=true }      
function enterVehicle ( theVehicle, seat, jacked )                          
    local skinID = getPlayerSkin ( source )                              
    local vehID = getVehicleID ( theVehicle ) 
    if medicvehicles[vehID] and not medicskins[skinID] then               
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 
  
local beervehicles = { [584]=true, [435]=true, [450]=true, [591]=true, [403]=true, [514]=true, [515]=true,  }   
local beerskins = { [202]=true, [143]=true }      
function enterVehicle ( theVehicle, seat, jacked )                          
    local skinID = getPlayerSkin ( source )                              
    local vehID = getVehicleID ( theVehicle ) 
    if beervehicles[vehID] and not beerskins[skinID] then               
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 
  
local dilervehicles = { [414]=true, [413]=true, [428]=true, [440]=true, [456]=true, [482]=true, [498]=true, [499]=true, [609]=true }   
local dilerskins = { [143]=true }      
function enterVehicle ( theVehicle, seat, jacked )                          
    local skinID = getPlayerSkin ( source )                              
    local vehID = getVehicleID ( theVehicle ) 
    if dilervehicles[vehID] and not dilerskins[skinID] then               
        removePlayerFromVehicle ( source )                                 
        outputChatBox ( "You haven't rights.!", source ) 
    end 
end 
addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) 

Please Help me :(

Link to comment

Please, explain me again.

What is the problem?

Did you debugged the script? "/debugscript 3" may help.

If no errors are showed, check with some outputChatBox in some parts of the code, maybe you will find the problem and you will know what to do with non-working scripts ;)

Link to comment
Please, explain me again.

What is the problem?

Did you debugged the script? "/debugscript 3" may help.

If no errors are showed, check with some outputChatBox in some parts of the code, maybe you will find the problem and you will know what to do with non-working scripts ;)

my resource doesn't work at all

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