Jump to content

castillo's gang system


Monty

Recommended Posts

why the console says bad argument?

    basegate = createObject ( 3115, 1728.8000488281, -1378.0999755859, 13.5, 0, 90, 0 ) 
    basecol = createColCircle ( 1728.8000488281, -1378.0999755859, 13.5, 7 ) 
      
    function openbase_area69gates ( thePlayer ) 
          local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( client ) ) ) --changed source to client (for safety reasons) 
      if ( gang == "SWAT" ) then 
            moveObject ( basegate, 5000, 1728.8000488281, -1378.0999755859, 0 ) 
        end 
    end 
    addEventHandler ( "onColShapeHit", basecol, openbase_area69gates ) 
  
function closebase_area69gates(thePlayer) 
    local gang = exports [ 'ROADgang' ]:getAccountGang ( getAccountName ( getPlayerAccount ( client ) ) ) --changed source to client (for safety reasons) 
      if ( gang == "SWAT" ) then 
       moveObject (basegate, 5000, 1728.8000488281, -1378.0999755859, 13.5 ) 
   
end 
end 
addEventHandler( "onColShapeLeave", basecol, closebase_area69gates ) 

Link to comment
[2012-06-20 19:50:03] WARNING: ROADadmin\base_area69.lua:6: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] 
[2012-06-20 19:50:08] WARNING: ROADadmin\base_area69.lua:15: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] 

Link to comment
basegate = createObject ( 3115, 1728.8000488281, -1378.0999755859, 13.5, 0, 90, 0 ) 
basecol = createColCircle ( 1728.8000488281, -1378.0999755859, 13.5, 7 ) 
  
function openbase_area69gates ( thePlayer ) 
    if not getElementType(thePlayer) == "player" then return end -- if the hit element isn't a player then cancel .. 
    local acc = getPlayerAccount(thePlayer) -- get the player account 
    if isGuestAccount(acc) then return end -- if it is a guest account then cancel 
    local accName = getAccountName(acc) -- get the account name 
    if not accName then return end -- if didn't got it then cancel 
    local gang = exports [ 'ROADgang' ]:getAccountGang (accName) --changed source to client (for safety reasons) 
    -- 
    if ( gang and tostring(gang) == "SWAT" ) then 
        moveObject ( basegate, 5000, 1728.8000488281, -1378.0999755859, 0 ) 
    end 
end 
addEventHandler ( "onColShapeHit", basecol, openbase_area69gates ) 
  
function closebase_area69gates(thePlayer) 
    if not getElementType(thePlayer) == "player" then return end -- if the hit element isn't a player then cancel .. 
    local acc = getPlayerAccount(thePlayer) -- get the player account 
    if isGuestAccount(acc) then return end -- if it is a guest account then cancel 
    local accName = getAccountName(acc) -- get the account name 
    if not accName then return end -- if didn't got it then cancel 
    local gang = exports [ 'ROADgang' ]:getAccountGang (accName) --changed source to client (for safety reasons) 
    -- 
    if ( gang and tostring(gang) == "SWAT" ) then 
        moveObject (basegate, 5000, 1728.8000488281, -1378.0999755859, 13.5 ) 
    end 
end 
addEventHandler( "onColShapeLeave", basecol, closebase_area69gates ) 

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