JamesCaeser Posted May 29, 2017 Share Posted May 29, 2017 (edited) addEventHandler("onPlayerInteriorChange", getRootElement( ), function( a, b, toDimension, toInterior) if toDimension then triggerEvent("frames:loadInteriorTextures", source, toDimension) -- Adams setElementDimension(source, toDimension) end if toInterior then setElementInterior(source, toInterior) end local vehicle = getPedOccupiedVehicle ( source ) if not vehicle then end fadeCamera ( source, false, 0, 0, 0, 0 ) fadeCamera ( source, true, 1, 0, 0, 0 ) setElementFrozen(source, false) setElementAlpha(source, 255) interiorTimer[source] = false end ) and function switchGroundSnow(toggle) if getResourceState ( getResourceFromName( "shader_snow_ground" ) ) == "running" then triggerClientEvent( thePlayer, "switchGoundSnow", thePlayer, toggle) end end Warnings: 1. Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got root] 2. Bad argument @ 'getResourceState' [Expected resource-data at argument 1, got boolean] Edited May 29, 2017 by JamesCaeser Link to comment
koragg Posted May 29, 2017 Share Posted May 29, 2017 "onPlayerInteriorChange" is a SA-MP event http://wiki.sa-mp.com/wiki/OnPlayerInteriorChange Try this for the second warning: function switchGroundSnow(toggle) if getResourceFromName( "shader_snow_ground" ) and getResourceState ( getResourceFromName( "shader_snow_ground" ) ) == "running" then triggerClientEvent( thePlayer, "switchGoundSnow", thePlayer, toggle) end end Link to comment
JamesCaeser Posted May 29, 2017 Author Share Posted May 29, 2017 So, the 2nd warning was removed, it remains to deal with the 1st, thank you very much Link to comment
koragg Posted May 29, 2017 Share Posted May 29, 2017 Quote "onPlayerInteriorChange" is a SA-MP event http://wiki.sa-mp.com/wiki/OnPlayerInteriorChange I searched the wiki and there is no such eventHandler for MTA only for SA-MP 1 Link to comment
JamesCaeser Posted May 29, 2017 Author Share Posted May 29, 2017 Thank you, you helped me a lot! Link to comment
pa3ck Posted May 29, 2017 Share Posted May 29, 2017 13 minutes ago, koragg said: I searched the wiki and there is no such eventHandler for MTA only for SA-MP That would actually be a really nice event to have, you can do it with a timer or script whenever you change the interior/dimension for the player, I know... but still.. could come handy 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