In this function playervehicle and playername are undefined - you determine them in the other function but not in this one. You're also saving the owner of a vehicle as a player element type but call the variable "playername" which is confusing. And what is the "authorized" variable ? That's the name of the player but you don't use it. In fact, I wouldn't use the name (you're not) as it could change. Edit: I notice that you've made the variables global - that's never going to work in the long run when you've multiple people on the server.
function playerExpel ( thePlayer )
playervehicle = getPlayerOccupiedVehicle ( thePlayer )
if ( getElementData ( playervehicle, "parkedby" ) == thePlayer ) then
setVehicleFrozen ( playervehicle, false )
setVehicleDamageProof ( playervehicle, false )
setVehicleOverrideLights ( playervehicle, 0 )
setVehicleEngineState ( playervehicle, true )
outputChatBox ( "Vehicle Started", thePlayer, 255, 0, 0 )
else
removePlayerFromVehicle ( thePlayer )
outputChatBox ( "This is not your vehicle!", thePlayer, 255, 0, 0 )
end
end
Tested your code and when I spawn a vehicle it says it isn't myne when it was nobodys...