Jump to content

is this right??


Baseplate

Recommended Posts

well I have took Puma autoteams and I did some changes is this right?

                                                               ---------Made by |DGT|Puma-------------- 
  
---------------do not change or touch this---------- 
Names={} 
Tags={} 
Colors={} 
-------------------------------------------------------------- 
  
---------------------------here put your clans read readme for instructions--------------------------------------- 
local names ={"FWC Admin"} 
local tags  ={"%FWC%"} 
local colors ={#fffafa} 
  
-------- load------------ 
  
function loadTeams() 
 for i,name in pairs(names) do 
Names[i]=name 
end 
  
for i,tag in pairs(tags) do 
Tags[i]=tag 
end 
  
for i,color in pairs(colors) do 
Colors[i] = color 
end 
 end 
  
addEventHandler("onResourceStart",root,loadTeams) 
  
--------------------------------------------------- 
  
----- move on start------------------ 
  
function moveOnStart() 
for i,player in pairs(getElementsByType("player")) do 
check(player) 
end 
end 
  
addEventHandler("onResourceStart",root,moveOnStart) 
------------------------------------------------------------------------- 
  
-----------check---------------------------- 
  
function check (player) 
      end 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
setPlayerTeam(player,nil) 
 for i,tag in pairs(tags) do 
    if string.find(getPlayerName(player),tag) then 
local name = Names[i] 
local color = Colors[i] 
  if  not getTeamFromName(name) then 
createTeam(name,getColorFromString(color)) 
end 
local team = getTeamFromName(name) 
setPlayerTeam(player,team) 
  
end 
   end 
  
-------------------------------- 
  
  
----------remove Empty Team ---------- 
  
function remove() 
 for t,teams in pairs(names) do  
 local team = getTeamFromName(teams) 
  if team then  
     if  countPlayersInTeam ( team )==0 then 
         destroyElement(team) 
end 
   end 
       end 
          end  
  
----------------------------------------------------- 
  
-------NickChange------------- 
  
function nick(old,new) 
setTimer(check,1000,1,source) 
setTimer(remove,1500,1) 
end 
  
addEventHandler("onPlayerChangeNick",root,nick) 
--------------------------------------------- 
  
-------Join-------------------------------- 
  
function join() 
setTimer(check,4000,1,source) 
end 
  
addEventHandler("onPlayerJoin",root,join) 
------------------------------- 
  
---------Quit--------------------- 
  
function quit(player) 
setTimer(remove,1000,1) 
end 
  
addEventHandler("onPlayerQuit",root,quit) 
------------------------------------ 
  
  

Link to comment
---------Made by |DGT|Puma-------------- 
  
---------------do not change or touch this---------- 
Names={} 
Tags={} 
Colors={} 
-------------------------------------------------------------- 
  
---------------------------here put your clans read readme for instructions--------------------------------------- 
local names ={"FWC Admin"} 
local tags  ={"%FWC%"} 
local colors ={#fffafa} 
  
-------- load------------ 
  
function loadTeams() 
 for i,name in pairs(names) do 
Names[i]=name 
end 
  
for i,tag in pairs(tags) do 
Tags[i]=tag 
end 
  
for i,color in pairs(colors) do 
Colors[i] = color 
end 
 end 
  
addEventHandler("onResourceStart",root,loadTeams) 
  
--------------------------------------------------- 
  
----- move on start------------------ 
  
function moveOnStart() 
for i,player in pairs(getElementsByType("player")) do 
check(player) 
end 
end 
  
addEventHandler("onResourceStart",root,moveOnStart) 
------------------------------------------------------------------------- 
  
-----------check---------------------------- 
  
function check (player) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then 
setPlayerTeam(player,nil) 
 for i,tag in pairs(tags) do 
    if string.find(getPlayerName(player),tag) then 
local name = Names[i] 
local color = Colors[i] 
    end 
  if  not getTeamFromName(name) then 
createTeam(name,getColorFromString(color)) 
end 
local team = getTeamFromName(name) 
setPlayerTeam(player,team) 
  
end 
   end 
 end 
  
-------------------------------- 
  
  
----------remove Empty Team ---------- 
  
function remove() 
 for t,teams in pairs(names) do 
 local team = getTeamFromName(teams) 
  if team then 
     if  countPlayersInTeam ( team )==0 then 
         destroyElement(team) 
end 
   end 
       end 
          end 
  
----------------------------------------------------- 
  
-------NickChange------------- 
  
function nick(old,new) 
setTimer(check,1000,1,source) 
setTimer(remove,1500,1) 
end 
  
addEventHandler("onPlayerChangeNick",root,nick) 
--------------------------------------------- 
  
-------Join-------------------------------- 
  
function join() 
setTimer(check,4000,1,source) 
end 
  
addEventHandler("onPlayerJoin",root,join) 
------------------------------- 
  
---------Quit--------------------- 
  
function quit() 
setTimer(remove,1000,1) 
end 
  
addEventHandler("onPlayerQuit",root,quit) 
------------------------------------ 

Link to comment

this is not right xD

local names ={"FWC Admin"}

local tags ={"%FWC%"}

local colors ={#fffafa}

here test it whit this

local names ={"FWC Admin"}

local tags ={"%FW%C"} --- % need to be first and last by one

local colors ={"#fffafa"} -- color code need to be in ""

BT (i am Puma xD) you try to check ACl right's for a team if i am right

Try this not tested but sould work

                                                                ---------Made by |DGT|Puma-------------- 
  
---------------do not change or touch this---------- 
Names={} 
Tags={} 
Colors={} 
ACL={} 
-------------------------------------------------------------- 
  
---------------------------here put your clans read readme for instructions--------------------------------------- 
local names ={"FWC Admin"} 
local tags  ={"%FWC%>"} 
local colors ={"#fffafa"} 
local acls={"Admin"} --- put the acl name if you wanna check ACL group or "none" if you don't wanna check  
  
-------- load------------ 
  
function loadTeams() 
 for i,name in pairs(names) do 
Names[i]=name 
end 
  
for i,tag in pairs(tags) do 
Tags[i]=tag 
end 
  
for i,color in pairs(colors) do 
Colors[i] = color 
end 
  
  
for i,acl in pairs(acls) do 
ACL[i] = acl 
end 
 end 
  
  
addEventHandler("onResourceStart",root,loadTeams) 
  
--------------------------------------------------- 
  
----- move on start------------------ 
  
function moveOnStart() 
for i,player in pairs(getElementsByType("player")) do 
check(player) 
end 
end 
  
addEventHandler("onResourceStart",root,moveOnStart) 
------------------------------------------------------------------------- 
  
-----------check---------------------------- 
  
function check (player) 
setPlayerTeam(player,nil) 
 for i,tag in pairs(tags) do 
    if string.find(getPlayerName(player),tag) then 
local account=getPlayerAccount(player) 
   if ACL[i]~="none" and not  isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL[i] ) ) then 
return end  
local name = Names[i] 
local color = Colors[i] 
  if  not getTeamFromName(name) then 
createTeam(name,getColorFromString(color)) 
end 
local team = getTeamFromName(name) 
setPlayerTeam(player,team) 
  
end 
   end 
      end 
  
  
-------------------------------- 
  
  
----------remove Empty Team ---------- 
  
function remove() 
 for t,teams in pairs(names) do  
 local team = getTeamFromName(teams) 
  if team then  
     if  countPlayersInTeam ( team )==0 then 
         destroyElement(team) 
end 
   end 
       end 
          end  
  
----------------------------------------------------- 
  
-------NickChange------------- 
  
function nick(old,new) 
setTimer(check,1000,1,source) 
setTimer(remove,1500,1) 
end 
  
addEventHandler("onPlayerChangeNick",root,nick) 
--------------------------------------------- 
  
-------Join-------------------------------- 
  
function join() 
setTimer(check,4000,1,source) 
end 
  
addEventHandler("onPlayerJoin",root,join) 
------------------------------- 
  
---------Quit--------------------- 
  
function quit(player) 
setTimer(remove,1000,1) 
end 
  
addEventHandler("onPlayerQuit",root,quit) 
------------------------------------ 
  
  

Edited by Guest
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...