Jump to content

Help with ACL markers please


Resmurf

Recommended Posts

Posted

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

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

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

That's because forum has a bug with setPlayerTeam, copy the code again.

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 (edited)

works but it dont change team, but i think i can fix it

i gotta change CIA team to teamcia rite?\

this is my team create

teamcia = createTeam ( "CIA", 0, 0, 255 )

Edited by Guest
Posted (edited)

It does change team, but you need to insert the EXACT team name in the table.

Edited by Guest

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

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"

Posted

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.

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

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

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

Posted

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) 

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.

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