You have to check if 'seat' is different to '0', then stop the function.
vehicle1 = createVehicle ( 602, 2279.1000976563, -1671.1999511719, 15.10000038147, 0, 0, 272 ) -----this car can be found at LS Grove Street near PoolBar
vehicle = createVehicle ( modelID, x, y, z, rotX, rotY, rotZ )
state = setVehicleDoorState ( vehicle, 1, 1 )
setVehicleDamageProof ( vehicle, true ) -----car won't take damage (change it to false if you want to take damage)
function lockPrivate( player, seat, jacked )
if ( source == vehicle1 ) then
if ( seat ~= 0 ) then -- If the seat isn't '0' ( driver's seat )
return -- Stop the function from executing.
end
local playerTeam = getPlayerTeam ( player )
local oldTeamName = ( playerTeam and getTeamName ( playerTeam ) or "" )
if ( oldTeamName ~= "admin" ) then
cancelEvent ( )
outputChatBox ( "This vehicle is locked for following team: admin ", player, 255, 0, 0, false )
else
outputChatBox ( "Welcome to your vehicle,Sir!", player, 0, 255, 0, false )
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate )
-----Made by Alen141(ingame name:Jimboy)------
-----Special thanks to : Solidsnake14(ingame name:Castillo)-----
-----Visit SAUR Utopia RPG, IP: 128.204.203.103:22003-----
-----Feel free to edit script on your own-----
-----Don't remove credits-----