• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] GetSessionDbcLocal

Status
Not open for further replies.

faiver

Esteemed Member
could help me with this error.
when I try to compile

14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2039: 'GetSessionDbcLocal' : no es un miembro de 'ChatHandler'
14> C:/Users/fear/Downloads/TrinityCore/src/server/game/Chat\Chat.h(49) : vea la declaración de 'ChatHandler'

--------------------------

ChatHandler handler(pPlayer->GetSession());
char* skill_name;

SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
skill_name = SkillInfo->name[handler.GetSessionDbcLocal()];
----------------------------------------
 

Tommy

Founder
Do it like this:

Code:
char* skill_name;
 
SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
skill_name = SkillInfo->name[ChatHandler(player->GetSession()).GetSessionDbcLocal()];
 

Hamar

BETA Tester
could help me with this error.
when I try to compile

14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2039: 'GetSessionDbcLocal' : no es un miembro de 'ChatHandler'
14> C:/Users/fear/Downloads/TrinityCore/src/server/game/Chat\Chat.h(49) : vea la declaración de 'ChatHandler'

--------------------------

ChatHandler handler(pPlayer->GetSession());
char* skill_name;

SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
skill_name = SkillInfo->name[handler.GetSessionDbcLocal()];
----------------------------------------

ChatHandler handler(pPlayer->GetSession());

ChatHandler* handler = (ChatHandler*)player->GetSession();

- - - Updated - - -

Or ChatHandler handler = ChatHandler(player->GetSession());
 

Tommy

Founder
ChatHandler handler(pPlayer->GetSession());

ChatHandler* handler = (ChatHandler*)player->GetSession();

- - - Updated - - -

Or ChatHandler handler = ChatHandler(player->GetSession());

Less messy code, more of what I wrote. :p
 

faiver

Esteemed Member
erros :(

14> achievement_scripts.cpp
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2512: 'ChatHandler::ChatHandler' : no hay disponible un constructor predeterminado adecuado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2228: el operando izquierdo de '.GetSessionDbcLocal' debe tener class/struct/union
14> areatrigger_scripts.cpp

---------------------------
70- ChatHandler handler = ChatHandler(player->GetSession());
71- char* skill_name;
72-
73- SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
74- skill_name = SkillInfo->name[ChatHandler(player->GetSession()).GetSessionDbcLocal()];
 

Hamar

BETA Tester
erros :(

14> achievement_scripts.cpp
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2512: 'ChatHandler::ChatHandler' : no hay disponible un constructor predeterminado adecuado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2228: el operando izquierdo de '.GetSessionDbcLocal' debe tener class/struct/union
14> areatrigger_scripts.cpp

---------------------------
70- ChatHandler handler = ChatHandler(player->GetSession());
71- char* skill_name;
72-
73- SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
74- skill_name = SkillInfo->name[ChatHandler(player->GetSession()).GetSessionDbcLocal()];

Could you please provide the whole script or atleast the whole function this snippet is from.
 

Tommy

Founder
erros :(

14> achievement_scripts.cpp
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(70): error C2512: 'ChatHandler::ChatHandler' : no hay disponible un constructor predeterminado adecuado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2065: 'player' : identificador no declarado
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2227: el operando izquierdo de '->GetSession' debe señalar al tipo class/struct/union/generic
14> el tipo es ''unknown-type''
14>C:\Users\fear\Downloads\TrinityCore\src\server\scripts\Custom\profesion.cpp(74): error C2228: el operando izquierdo de '.GetSessionDbcLocal' debe tener class/struct/union
14> areatrigger_scripts.cpp

---------------------------
70- ChatHandler handler = ChatHandler(player->GetSession());
71- char* skill_name;
72-
73- SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
74- skill_name = SkillInfo->name[ChatHandler(player->GetSession()).GetSessionDbcLocal()];

If you look your Player class variable isn't 'player', it is 'pPlayer' which I didn't put because I hate when people do variables like that. :/
 
Status
Not open for further replies.
Top