Amine#TN Posted February 23, 2017 Share Posted February 23, 2017 addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() exports [ "scoreboard" ]:addScoreboardColumn ( "Vehicle:", 3 ) end ) setTimer ( function ( ) local players = getElementsByType "player" for k, v in ipairs ( players ) do if ( isPedInVehicle(v) ) then local vehicle = getPedOccupiedVehicle(v) local carname = getVehicleName(vehicle) setElementData ( v, "Vehicle:", tostring(carname) ) else setElementData ( v, "Vehicle:", "On foot") end end end, 2500, 0 ) ------------ why this is not working Link to comment
pro-mos Posted February 23, 2017 Share Posted February 23, 2017 addEventHandler("onResourceStart", resourceRoot, function () exports.scoreboard:scoreboardAddColumn('Vehicle:') end ) setTimer(function () local players = getElementsByType "player" for k, v in ipairs ( players ) do if ( isPedInVehicle(v) ) then local vehicle = getPedOccupiedVehicle(v) local carname = getVehicleName(vehicle) setElementData ( v, "Vehicle:", tostring(carname) ) else setElementData ( v, "Vehicle:", "On foot") end end end, 2500, 0) You had the function name wrong 1 Link to comment
Amine#TN Posted February 24, 2017 Author Share Posted February 24, 2017 thanx man it is workorking Link to comment
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