Jump to content

Autoteam :(


Pipeekz

Recommended Posts

Otra vez yo >_<

Bueno me descargue un autoteam pero miren esto, intente utilizar algunos tags de clanes para probarlo y miren lo que pasa :(

2xbp3dg.png

Este es el código :P

Names={} 
Tags={} 
Colors={} 
  
local names ={"[XPG] Xtreme Pro Gamers" "THE BOSS CLAN"} -- Team Name 
local tags  ={"XPG" "BOSS"} -- Tag 
local colors ={"#FF0000" "#0000FF"} -- Color 
  
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) 
  
function moveOnStart() 
for i,player in pairs(getElementsByType("player")) do 
check(player) 
end 
end 
addEventHandler("onResourceStart",root,moveOnStart) 
  
  
function check (player) 
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 
      end 
  
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 
  
function nick(old,new) 
setTimer(check,1000,1,source) 
setTimer(remove,1500,1) 
end 
addEventHandler("onPlayerChangeNick",root,nick) 
  
function join() 
setTimer(check,4000,1,source) 
end 
addEventHandler("onPlayerJoin",root,join) 
  
function quit(player) 
setTimer(remove,1000,1) 
end 
addEventHandler("onPlayerQuit",root,quit) 

He probado y al parecer solo pasa esto con ese tag o eso creo :S

Link to comment
  
    Names={} 
    Tags={} 
    Colors={} 
      
    local names ={"[XPG] Xtreme Pro Gamers","THE BOSS CLAN"} -- Team Name 
    local tags  ={"XPG","BOSS"} -- Tag 
    local colors ={"#FF0000","#0000FF"} -- Color 
      
    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) 
      
    function moveOnStart() 
    for i,player in pairs(getElementsByType("player")) do 
    check(player) 
    end 
    end 
    addEventHandler("onResourceStart",root,moveOnStart) 
      
      
    function check (player) 
    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 
          end 
      
    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 
      
    function nick(old,new) 
    setTimer(check,1000,1,source) 
    setTimer(remove,1500,1) 
    end 
    addEventHandler("onPlayerChangeNick",root,nick) 
      
    function join() 
    setTimer(check,4000,1,source) 
    end 
    addEventHandler("onPlayerJoin",root,join) 
      
    function quit(player) 
    setTimer(remove,1000,1) 
    end 
    addEventHandler("onPlayerQuit",root,quit) 
  

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...