• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Feature Loot Channel

ehh I couldn't compile that in 0.2 tfs patch 23 ;/
there was sth wrong in commands.cpp

post the error here?

i've gotten it to successfully work for 0.2 and 0.3 so hopefully i can help some :)
 
ehh I couldn't compile that in 0.2 tfs patch 23 ;/
there was sth wrong in commands.cpp

Here's the fix:

Commands.cpp


Find:
Code:
{"/clean", &Commands::clean},

Below it add:

Code:
{"!loot", &Commands::showLoot},

Commands.h

Find:

Code:
bool clean(Creature* creature, const std::string& cmd, const std::string& param);

Below it add:

Code:
bool Commands::showLoot(Creature* creature, const std::string& cmd, const std::string& param);

That should fix your problem
 
ooo ty I will try ;P I didn't add sth like "!loot" to commnads.cpp to commads.h I've added I will edit if worked or not ;P

edit:
doesn't work;/

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win" all
g++.exe -c ../chat.cpp -o obj//chat.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../commands.cpp -o obj//commands.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../monsters.cpp -o obj//monsters.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

../monsters.cpp: In member function `void MonsterType::createLoot(Container*)':
../player.h:656: error: `void Player::broadcastPlayerLoot(const std::string&, const ItemVector&)' is protected
../monsters.cpp:166: error: within this context

make.exe: *** [obj//monsters.o] Error 1

Execution terminated
 
Last edited:
Didn't work


Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win" all
g++.exe -c ../chat.cpp -o obj//chat.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../commands.cpp -o obj//commands.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../monsters.cpp -o obj//monsters.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

../monsters.cpp: In member function `void MonsterType::createLoot(Container*)':
../player.h:656: error: `void Player::broadcastPlayerLoot(const std::string&, const ItemVector&)' is protected
../monsters.cpp:166: error: within this context

make.exe: *** [obj//monsters.o] Error 1

Execution terminated



could anyone help;p??
 
Didn't work


Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Icom\Pulpit\tfs sources\dev-cpp\Makefile.win" all
g++.exe -c ../chat.cpp -o obj//chat.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../commands.cpp -o obj//commands.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

g++.exe -c ../monsters.cpp -o obj//monsters.o -I"include" -D__USE_MYSQL__ -D__USE_SQLITE__ -fexpensive-optimizations -O1

../monsters.cpp: In member function `void MonsterType::createLoot(Container*)':
../player.h:656: error: `void Player::broadcastPlayerLoot(const std::string&, const ItemVector&)' is protected
../monsters.cpp:166: error: within this context

make.exe: *** [obj//monsters.o] Error 1

Execution terminated



could anyone help;p??

Function:
void broadcastPlayerLoot(const std::string& monster, const ItemVector& items);

Should be defined as public not protected
 
Good Job on this even tho I had to Fix for TFS .3.4 Crying couldn't have done it without your codes xD much appreciated
 
Code:
../talkaction.cpp: At global scope:
../talkaction.cpp:970: error: prototype for `bool TalkAction::showLoot(Player*, const std::string&, const std::string&)' does not match any in class `TalkAction'
../talkaction.h:101: error: candidate is: static bool TalkAction::showLoot(Creature*, const std::string&, const std::string&)

make.exe: *** [obj-console//talkaction.o] Error 1

Anyone please help? Using 0.3.4pl2
 
Code:
g++ -DHAVE_CONFIG_H -I.    -I/usr/include/libxml2  -I/usr/include/lua5.1    -D__USE_MYSQL__     -D__ENABLE_SERVER_DIAGNOSTIC__ -D_THREAD_SAFE -D_REENTRANT -Wall -g -O1 -MT talkaction.o -MD -MP -MF .deps/talkaction.Tpo -c -o talkaction.o talkaction.cpp
talkaction.cpp:969: error: prototype for ‘bool TalkAction::showLoot(Player*, const std::string&, const std::string&)’ does not match any in class ‘TalkAction’
talkaction.h:101: error: candidate is: static bool TalkAction::showLoot(Creature*, const std::string&, const std::string&)
make[1]: *** [talkaction.o] Error 1
make[1]: Leaving `/root/0.3.4'
make: *** [all] Error 2

I did everything like is in here, talkactions.cpp from the main post and the rest from this post.
http://otland.net/f35/loot-channel-22638/index2.html#post254425

What could be wrong then? Using 0.3.4pl2
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Back
Top