ChisleLP Posted January 29, 2018 Posted January 29, 2018 (edited) Hey. im fresh to MTA Skript. (I can lua already before, i just watched a little Youtube How to Script MTA, so...) I did just this Simple Check who is the owner of the car. so, it work very fine! but if i just enter a unknow car (Just spawned with admin commands) it give me everytime Boolean Console output. How can i stop it? ^^ function createvehicle(player) local user = getPlayerName ( player ) local vehicle = createVehicle ( 411, -2417.43457, -616.68573, 132.6342, 0, 0, 0, " ".. user ) setElementData(vehicle, "Owner", user) end addCommandHandler ( "justtesting", createvehicle ) function enteracar (player) local vehicle = getPedOccupiedVehicle ( player ) local owner = getElementData(vehicle, "Owner") if owner ~= nil then outputChatBox("Diesen Fahrzeug gehört " .. owner) else return end end addEventHandler("onVehicleEnter", getRootElement(), enteracar) Edited January 29, 2018 by ChisleLP
ChisleLP Posted January 29, 2018 Author Posted January 29, 2018 Fixed by myself. i have to replace false instead "nil". Thanks. have a great day.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now