Aqui una pequeña mejor al codigo de flaky, para detectar la cuenta y ademas para cancelar si eres invitado.
vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 )
state = setVehicleDoorState ( vehicle1, 1, 1 )
--setVehicleDamageProof ( vehicle1, true ) -- god
--setVehicleColor ( vehicle1, 145, 0, 161, 124, 0, 0 ) -- color del auto
--setVehicleHeadLightColor ( vehicle1, 150, 255, 0 )-- luzes de color
vehicle1 = createVehicle( 411, 0, 0, 10, 0, 0, 0 )
state = setVehicleDoorState ( vehicle1, 1, 1 )
function lockPrivate( player, seat, Login )
if ( source == vehicle1 ) then
local account = getPlayerAccount( player )
--Deteccion de cuenta invitado
if isGuestAccount ( account ) then
cancelEvent ()
end
--Fin de deteccion
local accountName = getAccountName ( account )
if not( accountName == "Paolo" ) then
cancelEvent()
outputChatBox("-|ExM|-:#fdfdfdEste Auto Pertenece a Paolo", player, 187, 255, 0, true) --- Mensaje
else
setVehicleDamageProof(source, true)
outputChatBox("-|ExM|- :#fdfdfdBienvenido A tu Auto "..accountName, player, 187, 255, 0, true) --- MSG
end
end
end
addEventHandler ( "onVehicleStartEnter", getRootElement(), lockPrivate )