Virus xD Posted August 31, 2011 Posted August 31, 2011 Hello guys i create gates in MTA works but conzole send error i dont now how to fix it i use mta 1.1 [2011-08-31 16:45:49] WARNING: wc_law\pd_garage.lua:15: Bad 'player' pointer @ 'getPlayerTeam'(1) [2011-08-31 16:45:49] WARNING: wc_law\pd_garage.lua:16: Bad argument @ 'getTeamName' [2011-08-31 16:45:49] WARNING: wc_law\pd_garage.lua:16: Bad argument @ 'getTeamName' [2011-08-31 16:45:52] WARNING: wc_law\pd_garage.lua:23: Bad 'player' pointer @ 'getPlayerTeam'(1) her is code ------------------------------------------------------------------------------ local dwnzgate = createColSphere ( -1572, 662, 7, 6 ) local dwnogate = createObject ( 968, -1572.19, 658.79, 6.8, 0, 269, 270 ) function pd_dgate_enter ( thePlayer ) local team = getPlayerTeam(thePlayer) if getTeamName(team) == "SWAT" or getTeamName(team) == "SFPD" then local x,y,z = getObjectRotation ( dwnogate ) moveObject ( dwnogate, 3000, -1572.19, 658.79, 6.8, 0, -1+(360-y), 0 ) end end function pd_dgate_exit ( thePlayer ) if getPlayerTeam ( thePlayer ) then local x,y,z = getObjectRotation ( dwnogate ) moveObject ( dwnogate, 2000, -1572.19, 658.79, 6.8, 0, -90+(360-y), 0 ) end end addEventHandler ( "onColShapeHit", dwnzgate, pd_dgate_enter ) addEventHandler ( "onColShapeLeave", dwnzgate, pd_dgate_exit ) ------------------------------------------------------------------------------ ty :*
SDK Posted August 31, 2011 Posted August 31, 2011 Vehicles also trigger onColShapeHit, check the type of thePlayer with getElementType(thePlayer) == 'player'.
Castillo Posted August 31, 2011 Posted August 31, 2011 ------------------------------------------------------------------------------ local dwnzgate = createColSphere ( -1572, 662, 7, 6 ) local dwnogate = createObject ( 968, -1572.19, 658.79, 6.8, 0, 269, 270 ) function pd_dgate_enter ( thePlayer ) local team = getPlayerTeam(thePlayer) if not team then return end if getTeamName(team) == "SWAT" or getTeamName(team) == "SFPD" then local x,y,z = getObjectRotation ( dwnogate ) moveObject ( dwnogate, 3000, -1572.19, 658.79, 6.8, 0, -1+(360-y), 0 ) end end function pd_dgate_exit ( thePlayer ) if getPlayerTeam ( thePlayer ) then local x,y,z = getObjectRotation ( dwnogate ) moveObject ( dwnogate, 2000, -1572.19, 658.79, 6.8, 0, -90+(360-y), 0 ) end end addEventHandler ( "onColShapeHit", dwnzgate, pd_dgate_enter ) addEventHandler ( "onColShapeLeave", dwnzgate, pd_dgate_exit ) ------------------------------------------------------------------------------
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