Jump to content

[Help Need] Gates Error


Virus xD

Recommended Posts

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 :*

Link to comment
------------------------------------------------------------------------------ 
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 ) 
------------------------------------------------------------------------------ 

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...