Bom dia galera , estou com dificuldade de colocar 4 Teams nesse Script aqui:
Spoiler
WAR_TEAMS = 1 STORAGE_TEAM_ID = 12000 function getTeamMembers(id) local players = getPlayersOnline() local team = {} if #players == 0 then return team end for i, cid in ipairs(players) do if getPlayerStorageValue(cid, STORAGE_TEAM_ID) == id then ---and getPlayerGroupId(cid) == 1 then table.insert(team, cid) end end return team end
function setTeam(cid) if WAR_TEAMS ~= 1 then setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1) else local team1 = getTeamMembers(1) local team2 = getTeamMembers(2) local team3 = getTeamMembers(3) local team4 = getTeamMembers(4)
if #team1 >= #team2 then setPlayerStorageValue(cid, STORAGE_TEAM_ID, 2) doAddCondition(cid, conditionRed) else setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1) doAddCondition(cid, conditionBlue) end if #team3 >= #team4 then setPlayerStorageValue(cid, STORAGE_TEAM_ID, 4) doAddCondition(cid, conditionWhite) else setPlayerStorageValue(cid, STORAGE_TEAM_ID, 3) doAddCondition(cid, conditionBlack) end end end
Estou tentando arrumar a funçao setTeam(cid) para colocar 4 Teams mais nao estou conseguindo se alguem me ajudar fico grato
info
Grupo: Campones
Registrado: 04/04/17
Posts: 8
Reputação: 0
Gênero: Masculino
Bom dia galera , estou com dificuldade de colocar 4 Teams nesse Script aqui:
WAR_TEAMS = 1
STORAGE_TEAM_ID = 12000
function getTeamMembers(id)
local players = getPlayersOnline()
local team = {}
if #players == 0 then
return team
end
for i, cid in ipairs(players) do
if getPlayerStorageValue(cid, STORAGE_TEAM_ID) == id then ---and getPlayerGroupId(cid) == 1 then
table.insert(team, cid)
end
end
return team
end
local conditionBlue = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionBlue, {lookType = 128, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87})
local conditionRed = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionRed, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionRed, {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94})
local conditionBlack = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlack, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionBlack, {lookType = 128, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114})
local conditionWhite = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionWhite, CONDITION_PARAM_TICKS, 1800 * 1000)
addOutfitCondition(conditionWhite, {lookType = 128, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0})
function setTeam(cid)
if WAR_TEAMS ~= 1 then
setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1)
else
local team1 = getTeamMembers(1)
local team2 = getTeamMembers(2)
local team3 = getTeamMembers(3)
local team4 = getTeamMembers(4)
if #team1 >= #team2 then
setPlayerStorageValue(cid, STORAGE_TEAM_ID, 2)
doAddCondition(cid, conditionRed)
else
setPlayerStorageValue(cid, STORAGE_TEAM_ID, 1)
doAddCondition(cid, conditionBlue)
end
if #team3 >= #team4 then
setPlayerStorageValue(cid, STORAGE_TEAM_ID, 4)
doAddCondition(cid, conditionWhite)
else
setPlayerStorageValue(cid, STORAGE_TEAM_ID, 3)
doAddCondition(cid, conditionBlack)
end
end
end
Estou tentando arrumar a funçao setTeam(cid) para colocar 4 Teams mais nao estou conseguindo se alguem me ajudar fico grato