Postado Agosto 25, 2016 8 anos 2 minutos atrás, pablobion disse: Na verdade não coloquei o script original agora pra ver, se eu fui tão burro a ponto disso kkkkkk mas no original ele mandava broadcast pra todos do servidor, e com as alterações suas, do enzo e do talesigorvr ele manda mensagem apenas pra quem é dono do castelo... não sei dizer quem conseguiu fazer isso hahahahah mas conseguimos chegar onde eu queria... vou dar +rep pros 3 ja que os 3 ajudaram agora só preciso saber como enviar o broadcast para todos da guild que é dona do castelo, em vez de mandar só para o lider da guild dona do castelo Vou pegar a função aqui, perai! Agora que vi, o script não é feito em metatable.. então não sei a função exata :\ Mas, se quiser dar uma olhada ai, aqui está o link dos metatables do tfs.
Postado Agosto 25, 2016 8 anos ah ta, agora você explicou, você quer que manda a mensagem para todos daquela guild? no caso a que está sendo dominada né? me manda seu script com as modificações que você fez! [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 25, 2016 8 anos Autor 2 minutos atrás, Vodkart disse: ah ta, agora você explicou, você quer que manda a mensagem para todos daquela guild? no caso a que está sendo dominada né? me manda seu script com as modificações que você fez! asuhdusahdasu simm!! no momento está mandando apenas para o lider da guild que está sendo dominada. Spoiler function getGuildLeaderName(GuildName) -- function by vodkart local leader = db.getResult("SELECT `players`.`name` FROM `players` WHERE `players`.`id` = (SELECT `guilds`.`ownerid` FROM `guilds` WHERE `guilds`.`name` = ".. db.escapeString(GuildName) .. ")") if(leader:getID() ~= -1) then return leader:getDataString("name") end return nil end function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você nao pertence a guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estao no comando do castelo, va dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) -- primeiro tile -- if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) then local leader = getGuildLeaderName(getGlobalStorageValue(COH_STATUS)) local player = getPlayerByName(leader) if player then doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then local leader = getGuildLeaderName(getGlobalStorageValue(COH_STATUS)) local player = getPlayerByName(leader) if player then doPlayerSendTextMessage(player, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atençao! A guild "..getPlayerGuildName(cid).." esta muito proxima do domíinio, ataquem!") end setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) end end return true end Scriptszinhos: Spoiler [CREATURESCRIPT] Auto TP depois de matar boss [ACTION] Clean Area [TALKACTION] !FelizAnoNovo [ACTION + MOVEMENT] Cartas ao GOD [CREATURESCRIPT] Always Emblem System [ACTION] Anihi simples [TALKACTIONS] Urinar / fazer xixi Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.
Postado Agosto 25, 2016 8 anos function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você nao pertence a guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estao no comando do castelo, va dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) -- primeiro tile -- if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) then for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atencao! A guild "..getPlayerGuildName(cid).." esta tentando dominar o castelo, preparem-se!") end end setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[Castle of Honor] Voce nao possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "[CoH]", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) > 0 and getPlayerGuildName(cid) == getGlobalStorageValue(COH_STATUS) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "[Castle of Honor] Atençao! A guild "..getPlayerGuildName(cid).." esta muito proxima do domíinio, ataquem!") end end setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) end end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Agosto 25, 2016 8 anos Autor @Vodkart Funcionou direitinho muito obrigado cara!! +rep Scriptszinhos: Spoiler [CREATURESCRIPT] Auto TP depois de matar boss [ACTION] Clean Area [TALKACTION] !FelizAnoNovo [ACTION + MOVEMENT] Cartas ao GOD [CREATURESCRIPT] Always Emblem System [ACTION] Anihi simples [TALKACTIONS] Urinar / fazer xixi Não abandone seu tópico, quando você tiver a dúvida resolvida sozinho tente ensinar aos outros como resolve-la (você pode não ser o único com o problema) e quando ela for resolvida por outra pessoa não se esqueça de marcar como melhor resposta e deixar o gostei.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.