myonlake Posted September 21, 2011 Share Posted September 21, 2011 (edited) Hey again, I would like to know the functions that I would need to use to detect the driver seat player and mine. I would like to give the driver some money when I enter as a passenger. So, give me the functions and I'll try to fix my script. PS. What about the "toggleCameraFixedMode", it looks like to not be working anymore, what's the new one? No fix at Wiki. Thanks Edited May 30, 2019 by myonlake Link to comment
JR10 Posted September 21, 2011 Share Posted September 21, 2011 getPedOccupiedVehicle -- getting a ped's vehicle getPedOccupiedVehicleSeat -- getting a ped's seat getVehicleController -- getting vehicle's controller/driver Link to comment
myonlake Posted September 21, 2011 Author Share Posted September 21, 2011 Well, I got this far. function giveMoneyToTaxi(player, seat, jacked) local seat = getPedOccupiedVehicleSeat(player) local veh = getPedOccupiedVehicle(player) local occupants = getVehicleOccupants(veh) local driver = getVehicleOccupant(veh) taxi = {[420]=true, [438]=true} skin = {[253]=true, [255]=true} if (driver) and (taxi[getElementModel(source)]) and (not skin[getElementModel(player)]) and (not seat == 0) then givePlayerMoney(source) else return false end end addEventHandler("onPlayerVehicleEnter", rElement, giveMoneyToTaxi) 5, 6, 7, 8 lines doing errors. Don't tell me that it's a minor error now Link to comment
Castillo Posted September 21, 2011 Share Posted September 21, 2011 That's because "player" is not a player element, "source" is the player element of onPlayerVehicleEnter. function giveMoneyToTaxi(veh, seat, jacked) local seat = getPedOccupiedVehicleSeat(source) local occupants = getVehicleOccupants(veh) local driver = getVehicleOccupant(veh) taxi = {[420]=true, [438]=true} skin = {[253]=true, [255]=true} if (driver) and (taxi[getElementModel(veh]) and (not skin[getElementModel(source)]) and (not seat == 0) then givePlayerMoney(source, 1) else return false end end addEventHandler("onPlayerVehicleEnter", rElement, giveMoneyToTaxi) Try with that. 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