Jump to content

getPedOccupiedVehicle and getResourceState


Recommended Posts

  1. addEventHandler("onPlayerInteriorChange", getRootElement( ), 
  2.    function( a, b, toDimension, toInterior)    
  3.         if toDimension then
  4.             triggerEvent("frames:loadInteriorTextures", source, toDimension) -- Adams
  5.             setElementDimension(source, toDimension)
  6.         end
  7.         if toInterior then
  8.             setElementInterior(source, toInterior)
  9.         end
  10.         local vehicle = getPedOccupiedVehicle ( source ) 
  11.         if not vehicle then
  1.         end
  2.         
  3.         fadeCamera ( source, false, 0, 0, 0, 0 )
  4.         fadeCamera ( source, true, 1, 0, 0, 0 )
  5.         setElementFrozen(source, false)
  6.         setElementAlpha(source, 255)
  7.         interiorTimer[source] = false
  8.     end
  9. )

and

  1. function switchGroundSnow(toggle)
  2.     if getResourceState ( getResourceFromName( "shader_snow_ground" ) ) == "running" then
  3.         triggerClientEvent( thePlayer, "switchGoundSnow", thePlayer, toggle)
  4.     end
  5. 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 by JamesCaeser
Link to comment
13 minutes ago, koragg said:

I searched the wiki and there is no such eventHandler for MTA :S 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...