RHTM |
Posted: Sat 14:56, 07 Apr 2007 Post subject: [7.6][c++] Nie mozna wysyłac msg do GM'a. |
|
Od tak sobie maly kod ktory uniemozliwia wysylanie wiadomosci na Priv do GMa. przy czym graczowi pokazuje sie wiadomosc ktora uswiadamia mu ze wiadomosci nie dochodza.. co sprowadza sie do tego ze mniej osob bedzie sie odrazu wqrwialo i opuszczalo servery pod pretextem tego ze GM to nOOb xD
kod jest bardzo prosty hehe prezetuje tu wersje ktora mozna ustawiac w configu..
w game.cpp szukamy
Code: |
void Game::creatureSpeakTo(Creature *creature, SpeakClasses type,const std::string &receiver, const std::string &text)
{
OTSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::creatureSpeakTo");
Player* player = dynamic_cast<Player*>(creature);
if(!player)
return;
Player* toPlayer = getPlayerByName(receiver);
if(!toPlayer) {
player->sendTextMessage(MSG_SMALLINFO, "A player with this name is not online.");
return;
} |
i pod tym dodajemy:
Code: |
if(toPlayer->access >= 3 && g_config.getGlobalString("gmmsg") == "no") {
player->sendTextMessage(MSG_ADVANCE, "You cannot message to GM.");
return;
} |
w config.lua dodajemy
Code: |
--------------GM Msg-----------
gmmsg = no |
Skrypt by Palladineq |
|