myonlake Posted September 21, 2011 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 If I helped you, please click the like button on the right Thanks!
JR10 Posted September 21, 2011 Posted September 21, 2011 getPedOccupiedVehicle -- getting a ped's vehicle getPedOccupiedVehicleSeat -- getting a ped's seat getVehicleController -- getting vehicle's controller/driver Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
myonlake Posted September 21, 2011 Author 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 If I helped you, please click the like button on the right Thanks!
Castillo Posted September 21, 2011 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. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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