function onSay(cid, words, param)
if param == "emote" and getCreatureStorage(cid, 58678) < 1 then
doCreatureSetStorage(cid, 58678, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled emoted spells.")
elseif param == "normal" and getCreatureStorage(cid, 58678) == 1 then
doCreatureSetStorage(cid, 58678, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled emoted spells.")
end
return false
end
Pergunta
Rodrigo94 0
Boa tarde galera! estou precisando do código fonte pra compilar o emoted spells, achei um mas sem sucesso ao compilalo...
Explicando: você consegue ativar o emoted spells ON (MAGIAS SEM SPAWNAR O CHAT EM LARANJA) e desativar !emotedspells OFF (MAGIAS NO CHAT AMARELO).
Segue o código que eu tentei compilar:
game.h
bool internalCreatureSay(Creature* creature, SpeakClasses type, const std::string& text, bool ghostMode, SpectatorVec* spectators = NULL, Position* pos = NULL, bool isSpell = false);
game.cpp
bool Game::internalCreatureSay(Creature* creature, SpeakClasses type, const std::string& text, bool ghostMode, SpectatorVec* spectators/* = NULL*/, Position* pos/* = NULL*/, bool isSpell/* = false*/)
for(it = list.begin(); it != list.end(); ++it) { if(!(tmpPlayer = (*it)->getPlayer())) continue; if(!ghostMode || tmpPlayer->canSeeCreature(creature)) { if(isSpell) { // to jest spell std::string strValue; if(tmpPlayer->getStorage("58678", strValue)) { // storage jest ustawione int32_t intValue = atoi(strValue.c_str()); if(intValue) { // storage jest liczba i ma wartosc inna niz 0, typ tekstu 'monster' tmpPlayer->sendCreatureSay(creature, SPEAK_MONSTER_SAY, text, &destPos); } else { // storage rowne 0, domyslny typ tekstu tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } else { // storage nie ustawione, domyslny typ tekstu tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } else { tmpPlayer->sendCreatureSay(creature, type, text, &destPos); } } }
spells.cpp
return g_game.internalCreatureSay(player, type, ret, player->isGhost(), NULL, &pos, true) ? RET_NOERROR : RET_NOTPOSSIBLE;
Talkaction para ativar o comando
function onSay(cid, words, param) if param == "emote" and getCreatureStorage(cid, 58678) < 1 then doCreatureSetStorage(cid, 58678, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have enabled emoted spells.") elseif param == "normal" and getCreatureStorage(cid, 58678) == 1 then doCreatureSetStorage(cid, 58678, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have disabled emoted spells.") end return false end
ERRO AO COMPILAR:
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados