local config = {
storageTeamOne = 3000,
storageTeamTwo = 3001,
teamOne = { outfitMale = {lookType = 128, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}, -- 94 representa a cor vermelha.
outfitFemale = {lookType = 136, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94},
templeId = 1
},
teamTwo = { outfitMale = {lookType = 128, lookHead = 107, lookBody = 107, lookLegs = 107, lookFeet = 107}, -- 107 representa a cor Azul.
outfitFemale = {lookType = 136, lookHead = 107, lookBody =107, lookLegs = 107, lookFeet = 107},
templeId = 2
}
}
function onLogin(cid)
local vermelho = getGlobalStorageValue(config.teamOne)
local verde = getGlobalStorageValue(config.storageTeamTwo)
if getPlayerGroupId(cid) < 6 then
if vermelho > verde then
if getPlayerSex(cid) == 0 then
doCreatureChangeOutfit(cid, config.teamTwo.outfitFemale)
else
doCreatureChangeOutfit(cid, config.teamTwo.outfitMale)
end
doTeleportThing(cid, getTownTemplePosition(config.teamTwo.templeId))
setGlobalStorageValue(config.storageTeamTwo, verde+1)
setPlayerStorageValue(cid, config.storageTeamTwo, 1)
else
if getPlayerSex(cid) == 0 then
doCreatureChangeOutfit(cid, config.teamOne.outfitFemale)
else
doCreatureChangeOutfit(cid, config.teamOne.outfitMale)
end
doTeleportThing(cid, getTownTemplePosition(config.teamOne.templeId))
setGlobalStorageValue(config.teamOne, vermelho+1)
setPlayerStorageValue(cid, config.teamOne, 1)
end
end
registerCreatureEvent(cid, "LogoutTeam")
registerCreatureEvent(cid, "DeathTeam")
return true
end
function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
setPlayerStorageValue(cid, config.storageTeamTwo, 0)
setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
setPlayerStorageValue(cid, config.teamOne, 0)
setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end
function onLogout(cid)
if getPlayerStorageValue(cid, config.storageTeamTwo) == 1 then
setPlayerStorageValue(cid, config.storageTeamTwo, 0)
setGlobalStorageValue(config.storageTeamTwo, getGlobalStorageValue(config.storageTeamTwo)-1)
else
setPlayerStorageValue(cid, config.teamOne, 0)
setGlobalStorageValue(config.teamOne, getGlobalStorageValue(config.teamOne)-1)
end
return true
end