
eusouobozo1
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
eusouobozo1 deu reputação a xWhiteWolf em [PEDIDO] Separar Playerscaricatura do script:
local pos1 = {x=XXX, y=YYY, z= ZZ} local pos 2 = {x=XXX, y=YYY, z= ZZ} local outfit1 = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} local outfit2 = {lookType = 152, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 3} local storage = {123321, 123325, 123322, 123326} function onStepIn(cid, item, position, fromPosition) c = math.random(1,100) if c > 50 then setPlayerStorageValue (storage[1], 1) setPlayerStorageValue (storage[2], 1) doTeleportThing(cid, pos1, TRUE) doSetCreatureOutfit(cid, outfit1, -1) else setPlayerStorageValue (storage[3], 1) setPlayerStorageValue (storage[4], 1) doTeleportThing(cid, pos2, TRUE) doSetCreatureOutfit(cid, outfit2, -1) end return true end agora se vc quiser que separe os times de uma maneira mais balanceada (e menos randômica) salve dois globalstorage e chame ele a cada pisada de player, o time que o player for será o global storage +1 e ele checa se o globalstorage 1 é maior que o 2.
-
eusouobozo1 deu reputação a luanluciano93 em [PEDIDO] Separar PlayersAcho que assim faz tudo que tu pediu ...
-- <movevent type="StepIn" actionid="XXXX" event="script" value="separar_times.lua"/> function onStepIn(cid, item, position, fromPosition) local conditionBlack = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlack, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlack, {lookType = 134, lookHead = 114, lookBody = 114, lookLegs = 114, lookFeet = 114}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 143, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) local storage_global = 50000 local team = { one = { name = "Black Team", -- nome time 1 storage = 140120, -- storage time 1 storage1 = 123322, storage2 = 123326, pos = {x=456, y=17, z=7} -- posição para onde eles vão ao passar pela tile (cada time tem o seu) }, two = { name = "Red Team", -- nome time 2 storage = 140121, -- storage time 2 storage1 = 123321, storage2 = 123325, pos = {x=505, y=17, z=7} -- posição para onde eles vão ao passar pela tile (cada time tem o seu) }, } if getPlayerAccess(cid) > 3 then doTeleportThing(cid, team.one.pos) return false elseif getGlobalStorageValue(storage_global) > 0 then setGlobalStorageValue(storage_global, getGlobalStorageValue(storage_global)-1) end if getGlobalStorageValue(storage_global) >= 0 then if getGlobalStorageValue(team.one.storage) < getGlobalStorageValue(team.two.storage) then setPlayerStorageValue(cid, team.one.storage, 1) doAddCondition(cid, conditionBlack) setGlobalStorageValue(team.one.storage, getGlobalStorageValue(team.one.storage)+1) setPlayerStorageValue(cid,team.one.storage1,1) setPlayerStorageValue(cid,team.one.storage2,1) doTeleportThing(cid, team.one.pos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the team " .. team.one.name .. "!") else setPlayerStorageValue(cid, team.two.storage, 1) doAddCondition(cid, conditionRed) setGlobalStorageValue(team.two.storage, getGlobalStorageValue(team.two.storage)+1) setPlayerStorageValue(cid,team.two.storage1,1) setPlayerStorageValue(cid,team.two.storage2,1) doTeleportThing(cid, team.two.pos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You will join the team " .. team.two.name .. "!") end end return true end Para configurar são essas linhas ...
one = { name = "Black Team", -- nome time 1 storage = 140120, -- storage time 1 storage1 = 123322, storage2 = 123326, pos = {x=456, y=17, z=7} -- posição para onde eles vão ao entrar no tp (cada time tem o seu) }, two = { name = "Red Team", -- nome time 2 storage = 140121, -- storage time 2 storage1 = 123321, storage2 = 123325, pos = {x=505, y=17, z=7} -- posição para onde eles vão ao entrar no tp (cada time tem o seu) }, Não testei, acho que dá certo.