Mefisto_PL Posted August 1, 2013 Posted August 1, 2013 I've got a problem with removing vehicle owner. Debugscript say that I have bad arguments at getElementData. ( could be, I think it's because I made so much an events ) function usunWlasciciela ( vehicle, thePlayer ) local wlasciciel = getElementData ( vehicle, "veh_owner" ) local pojazd = getElementData ( wlasciciel, "vehicle_owner" ) if wlasciciel then if pojazd then removeElementData ( vehicle, "veh_owner" ) removeElementData ( thePlayer, "vehicle_owner" ) setVehicleLocked ( vehicle, false ) end end end addEventHandler ( "onPlayerQuit", getRootElement(), usunWlasciciela ) addEventHandler ( "onPlayerLogout", getRootElement(), usunWlasciciela ) addEventHandler ( "onVehicleRespawn", getRootElement(), usunWlasciciela ) addEventHandler ( "onVehicleExplode", getRootElement(), usunWlasciciela ) addEventHandler ( "onResourceStop", getResourceRootElement(getThisResource()), usunWlasciciela )
Castillo Posted August 1, 2013 Posted August 1, 2013 These two arguments will be always "nil". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Mefisto_PL Posted August 1, 2013 Author Posted August 1, 2013 Why? So I must do that in new functions? For example that: ( I think it's not good ;d ) function quitHandler ( vehicle ) usunWlasciciela ( source ) end addEventHandler ( "onPlayerQuit", getRootElement(), quitHandler
Wei Posted August 1, 2013 Posted August 1, 2013 Your parameters are wrong, every event has difrend parameters! Diet with russian vodka, lose 3 days in one week !
iMr.3a[Z]eF Posted August 1, 2013 Posted August 1, 2013 Five events in one function, is that possible? To Visit Us Press Here: mtasa://5.9.206.180:22002
Wei Posted August 1, 2013 Posted August 1, 2013 Yes it is, but you can't use it if you wanna have it on element like source or parameter... From where you wanna get the vehicle element ? Diet with russian vodka, lose 3 days in one week !
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