Jump to content

aclGroupAddObject Error


damien111

Recommended Posts

I tryed to make it so the script checks the acl group, and if it is not in any it is spawned in a point, and if in one of the acl groups then spawn at the given coords. but it wont spawn the player at all. heres my code

--Markers-- 
LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
 -- 
 accountName = getPlayerAccount(thePlayer) 
  
 --handles the joining of countries-- 
  
 function LVSpawn ( source ) 
 aclGroupAddObject ( aclGetGroup("LVCiv"), "user."..accountName ) 
 end 
 addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
 function SFSpawn ( source ) 
 aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..accountName ) 
 end 
 addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
 function LSSpawn ( source ) 
 aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..accountName ) 
 end 
 addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
  
  
  
  -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
addEventHandler("onPlayerLogin", root, 
  function() 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "SFCiv" ) ) then 
    spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
    elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "LVCiv" ) ) then 
    spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
    elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "LSCiv" ) ) then 
    spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
    else 
    spwanPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
  end 
  end 
)   

Edited by Guest
Link to comment
--Markers-- 
LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
  
--handles the joining of countries-- 
  
function LVSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
  
function SFSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
  
function LSSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
  
  -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
addEventHandler("onPlayerLogin", root, 
function() 
    if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "SFCiv" ) ) then 
    spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LVCiv" ) ) then 
    spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LSCiv" ) ) then 
    spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
    else 
    spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
  end 
end 
) 

Link to comment
--Markers-- 
LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
  
--handles the joining of countries-- 
  
function LVSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
  
function SFSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
  
function LSSpawn ( source ) 
    aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
end 
addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
  
  -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
addEventHandler("onPlayerLogin", root, 
function() 
    if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "SFCiv" ) ) then 
    spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LVCiv" ) ) then 
    spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LSCiv" ) ) then 
    spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
    else 
    spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
  end 
end 
) 

I took care of the access problem, but it cant spawn the player unless in a gamemode like play. How to fix this? Thanks

Link to comment
  
    --Markers-- 
    LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
    SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
    LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
      
    --handles the joining of countries-- 
      
    function LVSpawn ( source ) 
        aclGroupAddObject ( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
        spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
    end 
    addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
      
    function SFSpawn ( source ) 
        aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
        spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
    end 
    addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
      
    function LSSpawn ( source ) 
        aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(source)) ) 
        spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
    end 
    addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
      
      -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
    addEventHandler("onPlayerLogin", root, 
    function() 
        if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "SFCiv" ) ) then 
        spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
        elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LVCiv" ) ) then 
        spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
        elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ( "LSCiv" ) ) then 
        spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
        else 
        spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
      end 
    end 
    ) 

i dont understand, but it says that at the aclGroupAddObject events that there is a argument error, but i do not see whats wrong with it

Link to comment

try this:

  
    --Markers-- 
    LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
    SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
    LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
      
    --handles the joining of countries-- 
      
    function LVSpawn ( sourcePlayer ) --source is the marker 
        aclGroupAddObject( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, 1685.8544921875, 993.6201171875, 10.8203125) 
    end 
    addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
      
    function SFSpawn ( sourcePlayer ) 
        aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, -2624.373046875, 1412.80078125, 7.09375 ) 
    end 
    addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
      
    function LSSpawn ( sourcePlayer ) 
        aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, 1727.70703125, -1118.552734375, 24.085935592651) 
    end 
    addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
      
      -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
    addEventHandler("onPlayerLogin", root, 
    function(_,curAcc) 
        if isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "SFCiv" ) ) then 
            spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LVCiv" ) ) then 
            spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LSCiv" ) ) then 
            spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
        else 
            spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
      end 
    end 
    ) 

Link to comment
try this:
  
    --Markers-- 
    LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
    SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
    LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
      
    --handles the joining of countries-- 
      
    function LVSpawn ( sourcePlayer ) --source is the marker 
        aclGroupAddObject( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, 1685.8544921875, 993.6201171875, 10.8203125) 
    end 
    addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
      
    function SFSpawn ( sourcePlayer ) 
        aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, -2624.373046875, 1412.80078125, 7.09375 ) 
    end 
    addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
      
    function LSSpawn ( sourcePlayer ) 
        aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        spawnPlayer ( sourcePlayer, 1727.70703125, -1118.552734375, 24.085935592651) 
    end 
    addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
      
      -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
    addEventHandler("onPlayerLogin", root, 
    function(_,curAcc) 
        if isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "SFCiv" ) ) then 
            spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LVCiv" ) ) then 
            spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LSCiv" ) ) then 
            spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
        else 
            spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
      end 
    end 
    ) 

i basically get the same error

WARNING: Spawn/Server.lua:10:Bad argument @ 'aclGroupAddObject' 

Link to comment

try this:

  
    --Markers-- 
    LVMarker = createMarker ( -47.673049926758, -62.346290588379, -10.607986450195, "cylinder", 1.5, 255, 0, 0, 170 ) 
    SFMarker = createMarker ( -47.673049926758, -67.268165588379, -10.607986450195, "cylinder", 1.5, 0, 255, 0, 170 ) 
    LSMarker = createMarker ( -47.673049926758, -71.514259338379, -10.607986450195, "cylinder", 1.5, 0, 0, 255, 170 ) 
      
    --handles the joining of countries-- 
      
    function LVSpawn ( sourcePlayer ) --source is the marker 
        if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("LVCiv") then 
              aclGroupAddObject( aclGetGroup("LVCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        end 
        spawnPlayer ( sourcePlayer, 1685.8544921875, 993.6201171875, 10.8203125) 
    end 
    addEventHandler( "onMarkerHit", LVMarker, LVSpawn ) 
      
    function SFSpawn ( sourcePlayer ) 
        if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("SFCiv") then 
              aclGroupAddObject ( aclGetGroup("SFCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        end 
        spawnPlayer ( sourcePlayer, -2624.373046875, 1412.80078125, 7.09375 ) 
    end 
    addEventHandler( "onMarkerHit", SFMarker, SFSpawn ) 
      
    function LSSpawn ( sourcePlayer ) 
        if not isObjectInACLGroup("user."..getAccountName(getPlayerAccount(sourcePlayer)), aclGetGroup("LSCiv") then 
              aclGroupAddObject ( aclGetGroup("LSCiv"), "user."..getAccountName(getPlayerAccount(sourcePlayer)) ) 
        end 
        spawnPlayer ( sourcePlayer, 1727.70703125, -1118.552734375, 24.085935592651) 
    end 
    addEventHandler( "onMarkerHit", LSMarker, LSSpawn ) 
      
      -- Checks if the player is in one of the ACL Groups and if not spawns him in a place to choose 
    addEventHandler("onPlayerLogin", root, 
    function(_,curAcc) 
        if isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "SFCiv" ) ) then 
            spawnPlayer ( source, -2624.373046875, 1412.80078125, 7.09375 ) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LVCiv" ) ) then 
            spawnPlayer ( source, 1685.8544921875, 993.6201171875, 10.8203125) 
        elseif isObjectInACLGroup ("user."..getAccountName(curAcc), aclGetGroup ( "LSCiv" ) ) then 
            spawnPlayer ( source, 1727.70703125, -1118.552734375, 24.085935592651) 
        else 
            spawnPlayer ( source, -81.016799926758, -81.045509338379, -10.607986450195 ) 
      end 
    end 
    ) 

Link to comment
  • 1 month later...

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