kevin11 Posted June 4, 2010 Posted June 4, 2010 (edited) its not working and no errors addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function ( winner ) setPedFrozen ( winner, not isPedFrozen ( sourcePlayer ) ) end Edited June 6, 2010 by Guest
Dark Dragon Posted June 4, 2010 Posted June 4, 2010 there is no such event and if it existed sourcePlayer would still be missing, beside that i doubt setPedFrozen will have any effect on a ped/player in a vehicle
dzek (varez) Posted June 4, 2010 Posted June 4, 2010 get player vehicle, and froze vehicle, with vehicle frozing function (i think theres one?)
Castillo Posted June 4, 2010 Posted June 4, 2010 i guess this is what u wanted. addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function ( ) local veh = getPedOccupiedVehicle(winner) if veh then setVehicleFrozen ( veh, true, not isVehicleFrozen ( veh) ) end end)
kevin11 Posted June 5, 2010 Author Posted June 5, 2010 BAD argument getoccupiedvehicle at line 4 thats error
50p Posted June 5, 2010 Posted June 5, 2010 BAD argument getoccupiedvehicle at line 4thats error Line 3, function has no parameters so winner is nil. Add winner to function parameters.
kevin11 Posted June 5, 2010 Author Posted June 5, 2010 i guess this is what u wanted. addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function ( winner ) local veh = getPedOccupiedVehicle(winner) if veh then setVehicleFrozen ( veh, true, not isVehicleFrozen ( veh) ) end end) like this?
50p Posted June 5, 2010 Posted June 5, 2010 Yes but remember this even needs to be triggered by some script, if race resource doesn't trigger it don't expect this to work. If you said you get an error in this function, the event gets triggered and if the first parameter is the player who wins then it should work.
dzek (varez) Posted June 6, 2010 Posted June 6, 2010 kevin, debug! try just outputChatBox('debug') and see if it worked.. then add your code step by step, debugging it
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