ahhh nononon
mira yo tengo el que tu me mandaste que te dije que ya usaba y sale esto
---------------do not change or touch this----------
Names={}
Tags={}
Colors={}
ACL={}
--------------------------------------------------------------
---------------------------here put your clans read readme for instructions---------------------------------------
local names ={"Guest Team","xR Team"}
local tags ={"","%-xR%|"}
local colors ={"#e6e6e6","#ff4500"}
local acls ={"none","none"}
-------- load------------
function loadTeams()
for i,name in pairs(names) do
Names=name
end
for i,tag in pairs(tags) do
Tags=tag
end
for i,color in pairs(colors) do
Colors = color
end
for i,acl in pairs(acls) do
ACL = acl
end
end
addEventHandler("onResourceStart",getRootElement(),loadTeams)
---------------------------------------------------
----- move on start------------------
function moveOnStart()
for i,player in pairs(getElementsByType("player")) do
check(player)
end
end
addEventHandler("onResourceStart",getRootElement(),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~="none" and not isObjectInACLGroup ( "user." ..getAccountName(account) , aclGetGroup ( ACL ) ) then
return end
local name = Names
local color = Colors
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",getRootElement(),nick)
---------------------------------------------
-------Join--------------------------------
function join()
setTimer(check,4000,1,source)
end
addEventHandler("onPlayerJoin",getRootElement(),join)
-------------------------------
---------Quit---------------------
function quit(player)
setTimer(remove,1000,1)
end
addEventHandler("onPlayerQuit",getRootElement(),quit)
------------------------------------
---------Login---------------------
function login()
setTimer(check,1000,1,source)
setTimer(remove,1500,1)
end
addEventHandler("onPlayerLogin",getRootElement(),login)
------------------------------------
---------Logout---------------------
function logout()
setTimer(check,1000,1,source)
setTimer(remove,1500,1)
end
addEventHandler("onPlayerLogout",getRootElement(),logout)
------------------------------------
----------blip--------------
function blip(player)
local team = getPlayerTeam(player)
if team then
for v,blip in pairs(getAttachedElements(player)) do
if getElementType(blip)=="blip" then
local r,g,b =getTeamColor(team)
setBlipColor(blip,r,g,b,255)
setVehicleColor ( blip,r,g,b)
end
end
end
end
function timer()
setTimer(blip,3000,1,source)
end
addEventHandler("onPlayerSpawn",getRootElement(),timer)
addEvent ( 'onPlayerPickUpRacePickup', true )
function zaa ( id, type, model )
if ( getPlayerTeam ( source ) ) then
if ( eventName == 'onPlayerPickUpRacePickup' and id == 'vehiclechange' or id == 'repair' or id == 'nitro' ) then
local r, g, b = getTeamColor ( getPlayerTeam ( source ) )
local vehicle = getPedOccupiedVehicle(source)
setVehicleColor ( vehicle, r, g, b );
else
local r, g, b = getTeamColor ( getPlayerTeam ( source ) )
local vehicle = getPedOccupiedVehicle(source)
setVehicleColor ( vehicle, r, g, b )
end
end
end
addEventHandler ( 'onPlayerVehicleEnter', root, zaa )
addEventHandler ( 'onPlayerPickUpRacePickup', root, zaa )