Postado Abril 20, 2016 10 anos Este é um post popular. Preview Descrição A cada 1 minuto, o player vai receber +1 na storage e a cada 5 points = 1 mês. Se você mudar 60000 por 120000, será 1 ponto a cada 2 minutos. Script globalevents/scripts/age.lua function onThink(interval) if #getPlayersOnline() >= 1 then for i = 1,#getPlayersOnline() do doPlayerSetStorageValue(getPlayersOnline()[i],6723, getPlayerStorageValue(getPlayersOnline()[i],6723) + 1) end end return true end globalevents.xml <globalevent name="age" interval="60000" event="script" value="age.lua"/> game.cpp, procure por: if(player->hasCustomFlag(PlayerCustomFlag_CanSeePosition)) { ss << std::endl << "Position: [X: " << thingPos.x << "] [Y: " << thingPos.y << "] [Z: " << thingPos.z << "]"; if(Tile* tile = getTile(thingPos)) { if(House* house = tile->getHouse()) ss << " [House: " << house->getId() << "]"; } ss << "."; } Acima disso adicione: std::string year; if (const Creature* creature = thing->getCreature()) { if (const Player* destPlayer = creature->getPlayer()) { destPlayer->getStorage("6723", year); int32_t YearSay = atoi(year.c_str()) / 60; int32_t MonthSay = ((atoi(year.c_str()) / 5) % 12)+1; if (MonthSay > 0 || YearSay > 0) { if (thing != player) ss << std::endl << "He is " << std::floor(YearSay) << " Years, " << std::floor(MonthSay) << " Months old."; else ss << std::endl << "You are " << std::floor(YearSay) << " Years, " << std::floor(MonthSay) << " Months old."; } else { if (thing != player) ss << std::endl << "He Was Just Born."; else ss << std::endl << "You Were Just Born"; } } } Caso não funcione, tente: if (const Creature* creature = thing->getCreature()) { if (const Player* destPlayer = creature->getPlayer()) { destPlayer->getStorage("6723", year); int32_t YearSay = atoi(year.c_str()) / 60; int32_t MonthSay = ((atoi(year.c_str()) / 5) % 12)+1; if (MonthSay > 0 || YearSay > 0) { if (thing != player) ss << std::endl << (destPlayer->getSex(false) == PLAYERSEX_FEMALE ? "She" : "He") << "is" << std::floor(YearSay) << " Years, " << std::floor(MonthSay) << " Months old."; else ss << std::endl << "You are " << std::floor(YearSay) << " Years, " << std::floor(MonthSay) << " Months old."; } else { if (thing != player) ss << std::endl << (destPlayer->getSex(false) == PLAYERSEX_FEMALE ? "She" : "He") << " Was Just Born."; else ss << std::endl << "You Were Just Born"; } } } Créditos: tetra20
Postado Abril 20, 2016 10 anos LARISSA @Azhaurn, EU TE AMO! VOU FAZER ISSO P O BAIAKAO! Editado Abril 20, 2016 10 anos por vankk (veja o histórico de edições) Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
Postado Abril 20, 2016 10 anos No meu game.cpp nao existe isso if(player->hasCustomFlag(PlayerCustomFlag_CanSeePosition)) { ss << std::endl << "Position: [X: " << thingPos.x << "] [Y: " << thingPos.y << "] [Z: " << thingPos.z << "]"; if(Tile* tile = getTile(thingPos)) { if(House* house = tile->getHouse()) ss << " [House: " << house->getId() << "]"; } ss << "."; }
Postado Abril 20, 2016 10 anos 2 minutos atrás, gabrieldalla disse: No meu game.cpp nao existe isso if(player->hasCustomFlag(PlayerCustomFlag_CanSeePosition)) { ss << std::endl << "Position: [X: " << thingPos.x << "] [Y: " << thingPos.y << "] [Z: " << thingPos.z << "]"; if(Tile* tile = getTile(thingPos)) { if(House* house = tile->getHouse()) ss << " [House: " << house->getId() << "]"; } ss << "."; } Porque esse código é pra tfs 0.4. Editado Abril 20, 2016 10 anos por christensen (veja o histórico de edições) Se o jogo do poder é inevitável, vale mais ser um artista do que negar ou agir desastradamente. Contato : Skype - linus.1759 , Whats - 14-99809-9550, Email - [email protected]
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.