Arsilex Posted March 30, 2012 Share Posted March 30, 2012 Que Diferencia hay entre addEventHandler y addEvent Link to comment
Castillo Posted March 30, 2012 Share Posted March 30, 2012 addEvent se usa para crear eventos propios, en la wiki lo dice. Link to comment
Arsilex Posted March 30, 2012 Author Share Posted March 30, 2012 mira por ejemplo ago esto addEvent ( "onOnChangeVehicle", true ) addEventHandler seria addEventHandler ( "onChangeVehicle", getRootElement(), ) Como Explico que siginifica ese evento o el script ya lo ace solo ._. es que eso no lo entiendo muy bien Link to comment
Castillo Posted March 30, 2012 Share Posted March 30, 2012 addEvent ( "onChangeVehicle", true ) addEventHandler ( "onChangeVehicle", getRootElement(), function ( ) outputChatBox ( "Hola Mundo!" ) end ) triggerEvent ( "onChangeVehicle", localPlayer ) Link to comment
Arsilex Posted March 30, 2012 Author Share Posted March 30, 2012 pos no entendi bien tio es que mira ize esto en lo de los colores addEvent("onPlayerPickUpRacePickup",true) function Colores ( ) if sort == "vehiclechange" then for _, car in ipairs ( getElementsByType 'vehicle' ) do setVehicleColor ( car, math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ); end end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),Colores) tendria que ponerlo asi addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),Colores) function Colores ( ) if sort == "vehiclechange" then for _, car in ipairs ( getElementsByType 'vehicle' ) do setVehicleColor ( car, math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ); end end end triggerEvent ( "onPlayerPickUpRacePickup", localPlayer ) Link to comment
Castillo Posted March 30, 2012 Share Posted March 30, 2012 No, para que necesitas ejecutar el evento si ya lo ejecuta el race? addEvent ( "onPlayerPickUpRacePickup", true ) addEventHandler ( "onPlayerPickUpRacePickup", root, function ( pickupID, pickupType, vehicleModel ) if ( pickupType == "vehiclechange" ) then local theVehicle = getPedOccupiedVehicle ( source ) setVehicleColor ( theVehicle, math.random ( 0, 255 ), math.random ( 0, 255 ), math.random ( 0, 255 ) ) end end ) Link to comment
Arsilex Posted March 30, 2012 Author Share Posted March 30, 2012 hmm pos que raro no me funciona cuando lo activo y paso por un pickup el color del no se cambio Link to comment
Recommended Posts