Autor Wiadomość
narkotic
PostWysłany: Pią 6:50, 08 Cze 2007    Temat postu: [7.6][C++] Spells tylko dla PACC

Szukamy w game.cpp:

Cytuj:
bool Game::creatureSaySpell(Creature *creature, const std::string &text)
{
OTSYS_THREAD_LOCK_CLASS lockClass(gameLock, "Game::creatureSaySpell()");

bool ret = false;

Player* player = dynamic_cast<Player*>(creature);
std::string temp, var;
unsigned int loc = (uint32_t)text.find( "\"", 0 );
if( loc != string::npos && loc >= 0){
temp = std::string(text, 0, loc-1);
var = std::string(text, (loc+1), text.size()-loc-1);
}
else {
temp = text;
var = std::string("");
}

std::transform(temp.begin(), temp.end(), temp.begin(), (int(*)(int))tolower);

A pod tym wrzucamy:

Kod:
#ifdef RUL_PREMMYSPELLS
if(temp == "utani hur" && player && !player->premmium) {
player->sendTextMessage(MSG_SMALLINFO,"You need premium account to use this spell.");
return false;
}
#endif //RUL_PREMMYSPELLSNastepnie w Projekt > Opcje projektu > Paramentry / Kompilator C++ Dodajemy:

Kod:
-DRUL_PREMMYSPELLSW linijce:
if(temp == "utani hur" && player && !player->premmium) {
utani hur oznacza ze jest to czar tylko dla pacc.
Zeby zrobic kolejne czary dla pacc nalezy pod tym kodem:

Kod:
if(temp == "utani hur" && player && !player->premmium) {
player->sendTextMessage(MSG_SMALLINFO,"You need premium account to use this spell.");
return false;
}Dodaj kolejny ten sam kod:

Kod:
if(temp == "utani hur" && player && !player->premmium) {
player->sendTextMessage(MSG_SMALLINFO,"You need premium account to use this spell.");
return false;
}I zmienic jaki ma to byc czar.Wszystko ma byc w

Kod:
#ifdef RUL_PREMMYSPELLS
#endif //RUL_PREMMYSPELLSMyślę, że całość jest zrozumiała i nie będzie problemów.

Powered by phpBB © 2001,2002 phpBB Group