kevin11 Posted June 4, 2010 Share 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 Link to comment
Dark Dragon Posted June 4, 2010 Share 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 Link to comment
dzek (varez) Posted June 4, 2010 Share Posted June 4, 2010 get player vehicle, and froze vehicle, with vehicle frozing function (i think theres one?) Link to comment
Castillo Posted June 4, 2010 Share 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) Link to comment
kevin11 Posted June 5, 2010 Author Share Posted June 5, 2010 BAD argument getoccupiedvehicle at line 4 thats error Link to comment
50p Posted June 5, 2010 Share 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. Link to comment
kevin11 Posted June 5, 2010 Author Share 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? Link to comment
50p Posted June 5, 2010 Share 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. Link to comment
kevin11 Posted June 5, 2010 Author Share Posted June 5, 2010 no no i added that in destructionderby.lua Link to comment
dzek (varez) Posted June 6, 2010 Share Posted June 6, 2010 kevin, debug! try just outputChatBox('debug') and see if it worked.. then add your code step by step, debugging it Link to comment
kevin11 Posted June 6, 2010 Author Share Posted June 6, 2010 good advice from u (strange) 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