damien111 Posted October 2, 2012 Share Posted October 2, 2012 (edited) 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 October 3, 2012 by Guest Link to comment
Vision Posted October 2, 2012 Share Posted October 2, 2012 --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
damien111 Posted October 2, 2012 Author Share Posted October 2, 2012 --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
damien111 Posted October 3, 2012 Author Share Posted October 3, 2012 --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
Jaysds1 Posted October 4, 2012 Share Posted October 4, 2012 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
damien111 Posted October 4, 2012 Author Share Posted October 4, 2012 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
Renkon Posted October 4, 2012 Share Posted October 4, 2012 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
damien111 Posted November 13, 2012 Author Share Posted November 13, 2012 i didnt give it permissions, forgot to post this earlier, but yeah, that was the problem.. Link to comment
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