hey guys I'm trying to make a script that checks if the player is in the car and then tells the player that he's in a car, but it doesn't work, what can i do?.
I want the script to work through command I don't want events.
Code :
function insideCar( source , player )
local pos = getElementPosition(getLocalPlayer(player))
if isPlayerInVehicle(pos) then
outputChatBox("You're in the car"..getPlayerName(source), source)
else
outputChatBox("You're on foot", source)
end
end
addCommandHandler("check",insideCar)
thanks.