Jump to content

castillo's gang system


Monty

Recommended Posts

Posted

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 ) 

ANY SCRIPT REQUEST FOR FREE HERE: http://www.stolka.altervista.org

Posted

That's because you're using "client" as player element, but your player element is: "thePlayer".

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Bad argument where?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
[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] 

ANY SCRIPT REQUEST FOR FREE HERE: http://www.stolka.altervista.org

Posted

client is source, as far as I know.

Source in those events is the marker, not the player element.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted

Source in those events is the marker, not the player element.

"[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007

Posted
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 ) 

ING : [xXx]~Al3grab

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