Jump to content

Help with ACL markers please


Resmurf

Recommended Posts

local myMarker = createMarker( -303.26, 1601.41, 1054.69, 'cylinder', 2.0, 0, 0, 255, 150 )

function MarkerHit( hitElement, matchingDimension )

setElementModel(hitElement,164)

giveWeapon ( hitElement, 3, 700, true )

setPlayerTeam ( hitElement, teamcia )

end

addEventHandler( "onMarkerHit", myMarker, MarkerHit )

I did this when players join the marker join a team, but how i do it for example, for acl group CIA

please help, i want when player join the marker move to team, but only people on the acl group

Link to comment
markers = {} 
markers[1] = createMarker(-303.26, 1601.41, 1054.69, 'cylinder', 2.0, 0, 0, 255, 150) 
  
--marker ID, ACL name, Team name, Skin, Weapon, Ammo. 
teamACL = { 
[1] = {"CIA","CIA Team",164,3,700}, 
} 
  
function onMarkerHitSetTeam(hitPlayer,matchingDimension) 
for i,v in pairs(markers) do 
if (source == v) then 
if getElementType(hitPlayer) == "player" and matchingDimension then 
local account = getPlayerAccount(hitPlayer) 
if not account then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup("user."..accountName,aclGetGroup(teamACL[i][1])) then 
setPlayerTeam(hitPlayer, getTeamFromName(teamACL[i][2])) 
giveWeapon(hitPlayer,teamACL[i][4],teamACL[i][5],true) 
setElementModel(hitPlayer,teamACL[i][3]) 
    end 
   end 
  end 
 end 
end 
addEventHandler("onMarkerHit",getRootElement(),onMarkerHitSetTeam) 

Edited by Guest
Link to comment

i tried to do the same with army and dont work :( tell me whats wrong here please

  
markers = {} 
markers[15] = createMarker(88.91, 2081.20, 16.78, 'cylinder', 2.0, 0, 0, 255, 150) 
  
--marker ID, ACL name, Team name, Skin, Weapon, Ammo. 
teamACL = { 
[15] = {"LVarmy","Military",287,3,700}, 
} 
  
function onMarkerHitSetTeam(hitPlayer,matchingDimension) 
for i,v in pairs(markers) do 
if (source == v) then 
if getElementType(hitPlayer) == "player" and matchingDimension then 
local account = getPlayerAccount(hitPlayer) 
if not account then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup("user."..accountName,aclGetGroup(teamACL[i][15])) then 
setPlayerTeam(hitPlayer, getTeamFromName(teamACL[i][16])) 
giveWeapon(hitPlayer,teamACL[i][18],teamACL[i][19],true) 
setElementModel(hitPlayer,teamACL[i][17]) 
    end 
   end 
  end 
 end 
end 
addEventHandler("onMarkerHit",getRootElement(),onMarkerHitSetTeam) 
  

i changed the numbers since they are already inuse with the CIA team

error

bad argument "aclgetgroup"

Link to comment

Dude... you are using the same code for CIA, right? that's stupid and won't work, the point of my script is to make a GLOBAL team changer, so you just add markers[1], markers[2] and change teamACL table acording to the marker, ex:

--marker ID, ACL name, Team name, Skin, Weapon, Ammo. 
teamACL = { 
[1] = {"CIA","CIA",164,3,700}, 
[2] = {"LVarmy","Military",287,3,700}, 
} 

The rest is already done by the script, nothing else is required.

Link to comment
Can you post here your FULL code? with CIA and Military.

ok

  
  
markers = {} 
markers[1] = createMarker(-303.26, 1601.41, 1054.69, 'cylinder', 2.0, 0, 0, 255, 150) 
markers[2] = createMarker(88.91, 2081.20, 16.78, 'cylinder', 2.0, 0, 0, 255, 150) 
  
--marker ID, ACL name, Team name, Skin, Weapon, Ammo. 
teamACL = { 
[1] = {"CIA","CIA",164,3,700}, 
[2] = {"LVarmy","Military",287,3,700}, 
} 
  
function onMarkerHitSetTeam(hitPlayer,matchingDimension) 
for i,v in pairs(markers) do 
if (source == v) then 
if getElementType(hitPlayer) == "player" and matchingDimension then 
local account = getPlayerAccount(hitPlayer) 
if not account then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup("user."..accountName,aclGetGroup(teamACL[i][1])) then 
setPlayerTeam(hitPlayer, getTeamFromName(teamACL[i][2])) 
giveWeapon(hitPlayer,teamACL[i][4],teamACL[i][5],true) 
setElementModel(hitPlayer,teamACL[i][3]) 
    end 
   end 
  end 
 end 
end 
addEventHandler("onMarkerHit",getRootElement(),onMarkerHitSetTeam) 
  
function onMarkerHitSetTeam(hitPlayer,matchingDimension) 
for i,v in pairs(markers) do 
if (source == v) then 
if getElementType(hitPlayer) == "player" and matchingDimension then 
local account = getPlayerAccount(hitPlayer) 
if not account then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup("user."..accountName,aclGetGroup(teamACL[i][1])) then 
setPlayerTeam(hitPlayer, getTeamFromName(teamACL[i][2])) 
giveWeapon(hitPlayer,teamACL[i][4],teamACL[i][5],true) 
setElementModel(hitPlayer,teamACL[i][3]) 
    end 
   end 
  end 
 end 
end 
addEventHandler("onMarkerHit",getRootElement(),onMarkerHitSetTeam) 
  
  

Link to comment

See? you did what I told you not to... you only need one function.

markers = {} 
markers[1] = createMarker(-303.26, 1601.41, 1054.69, 'cylinder', 2.0, 0, 0, 255, 150) 
markers[2] = createMarker(88.91, 2081.20, 16.78, 'cylinder', 2.0, 0, 0, 255, 150) 
  
--marker ID, ACL name, Team name, Skin, Weapon, Ammo. 
teamACL = { 
[1] = {"CIA","CIA",164,3,700}, 
[2] = {"LVarmy","Military",287,3,700}, 
} 
  
function onMarkerHitSetTeam(hitPlayer,matchingDimension) 
for i,v in pairs(markers) do 
if (source == v) then 
if getElementType(hitPlayer) == "player" and matchingDimension then 
local account = getPlayerAccount(hitPlayer) 
if not account then return end 
local accountName = getAccountName(account) 
if isObjectInACLGroup("user."..accountName,aclGetGroup(teamACL[i][1])) then 
setPlayerTeam(hitPlayer, getTeamFromName(teamACL[i][2])) 
giveWeapon(hitPlayer,teamACL[i][4],teamACL[i][5],true) 
setElementModel(hitPlayer,teamACL[i][3]) 
    end 
   end 
  end 
 end 
end 
addEventHandler("onMarkerHit",getRootElement(),onMarkerHitSetTeam) 

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