Jump to content

[Help]Autoteaming


Recommended Posts

  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

o cmon let me make that snake!:D

Make it if u got problems call me xD

o.. okay ill just try it,

watch the biggest fail, never worked with acl's before xD

ill just take your script and add some lines :)

He asked for give weapons if im right then add lines "giveWeapon(source,weaponid,ammo)"

Link to comment

i already did add them :P

function isZarAccount(account)
 local nick = ""
 local group = aclGetGroup("[Z.A.R.S]")
 if (account and group) then
   nick = string.lower(getAccountName(account) or "")
   for _, object in ipairs(aclGroupListObjects(group) or {}) do
     if (gettok(object, 1, string.byte('.')) == "user") then
       if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
         return true
	  giveWeapon (source, 3, 1)
	  giveWeapon (source, 24, 500)
	  giveWeapon (source, 29, 500)
	  giveWeapon (source, 31, 500)
	  giveWeapon (source, 17, 500)
       end
     end
   end
 end
 return false
end

i added:

- nightstick

- desert eagle

- mp5

- m4

- tear gass

Link to comment
i already did add them :P

function isZarAccount(account)
 local nick = ""
 local group = aclGetGroup("[Z.A.R.S]")
 if (account and group) then
   nick = string.lower(getAccountName(account) or "")
   for _, object in ipairs(aclGroupListObjects(group) or {}) do
     if (gettok(object, 1, string.byte('.')) == "user") then
       if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
         return true
	  giveWeapon (source, 3, 1)
	  giveWeapon (source, 24, 500)
	  giveWeapon (source, 29, 500)
	  giveWeapon (source, 31, 500)
	  giveWeapon (source, 17, 500)
       end
     end
   end
 end
 return false
end

i added:

- nightstick

- desert eagle

- mp5

- m4

- tear gass

I dont think this will work :P, maybe u should try like this,

local root = getRootElement()
 
addEventHandler("onResourceStart", root,
function()
team = createTeam ("Z.A.R.S.", 0, 0, 255)
end
)
 
function login()
local taccount = getPlayerAccount ( source )
if isZarAccount(taccount) then
setPlayerTeam ( source, team)
outputChatBox ("Welcome to Zombie Apocalypse Rescue Squad HQ", source)
spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, math.random(0,264), team )
giveWeapon (source, 3, 1)
giveWeapon (source, 24, 500)
giveWeapon (source, 29, 500)
giveWeapon (source, 31, 500)
giveWeapon (source, 17, 500)
fadeCamera (source, true)
setCameraTarget (source, true)
else
end
end
addEventHandler("onPlayerLogin", root,login)
 
function isZarAccount(account)
local nick = ""
local group = aclGetGroup("[Z.A.R.S]")
if (account and group) then
   nick = string.lower(getAccountName(account) or "")
for _, object in ipairs(aclGroupListObjects(group) or {}) do
if (gettok(object, 1, string.byte('.')) == "user") then
if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
return true
end
end
end
end
return false
end

Link to comment

allright so the code would look like this or ?

local root = getRootElement()
 
addEventHandler("onResourceStart", root,
function()
team = createTeam ("Z.A.R.S", 0, 0, 255)
end
)
 
function login()
local taccount = getPlayerAccount ( source )
 if isZarAccount(taccount) then
  setPlayerTeam ( source, team)
  outputChatBox ("Welcome to Zombie Apocalypse Rescue Squad HQ", source)
  spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, 281, team )
  fadeCamera (source, true)
  setCameraTarget (source, true)
  else
  end
end
addEventHandler("onPlayerLogin", root,login)
 
function isZarAccount(account)
 local nick = ""
 local group = aclGetGroup("[Z.A.R.S]")
 if (account and group) then
   nick = string.lower(getAccountName(account) or "")
   for _, object in ipairs(aclGroupListObjects(group) or {}) do
     if (gettok(object, 1, string.byte('.')) == "user") then
       if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
         return true
       giveWeapon (source, 3, 1)
       giveWeapon (source, 24, 500)
       giveWeapon (source, 29, 500)
       giveWeapon (source, 31, 500)
       giveWeapon (source, 17, 500)
       end
     end
   end
 end
 return false
end

Link to comment
BTW guys :D

how can i do so if an zars member is killed he will be respawned at hes base again ?

local root = getRootElement()
 
addEventHandler("onResourceStart", root,
function()
team = createTeam ("Z.A.R.S.", 0, 0, 255)
end
)
 
function login()
local taccount = getPlayerAccount ( source )
if isZarAccount(taccount) then
setPlayerTeam ( source, team)
outputChatBox ("Welcome to Zombie Apocalypse Rescue Squad HQ", source)
spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, math.random(0,264), team )
giveWeapon (source, 3, 1)
giveWeapon (source, 24, 500)
giveWeapon (source, 29, 500)
giveWeapon (source, 31, 500)
giveWeapon (source, 17, 500)
fadeCamera (source, true)
setCameraTarget (source, true)
else
end
end
addEventHandler("onPlayerLogin", root,login)
 
function isZarAccount(account)
local nick = ""
local group = aclGetGroup("[Z.A.R.S]")
if (account and group) then
   nick = string.lower(getAccountName(account) or "")
for _, object in ipairs(aclGroupListObjects(group) or {}) do
if (gettok(object, 1, string.byte('.')) == "user") then
if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
return true
end
end
end
end
return false
end
 
function spawn(source)
spawnPlayer (source, -2246.7751464844, 2283.3193359375, 5, 90, math.random(0,264), team )
giveWeapon (source, 3, 1)
giveWeapon (source, 24, 500)
giveWeapon (source, 29, 500)
giveWeapon (source, 31, 500)
giveWeapon (source, 17, 500)
fadeCamera (source, true)
setCameraTarget (source, true)
end
 
addEventHandler("onPlayerWasted", root,
function()
local taccount = getPlayerAccount ( source )
if isZarAccount(taccount) then
setTimer(spawn, 1800, 1, source)
end
end
)

this should work, at least works for me :D

Link to comment
  • 3 months later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...