coding error

Hello.

i got an error when i tried to compile this script:

bool OnGossipSelectCode(Player *pPlayer, Creature *pCreature, uint32 sender, uint32 action, const char *pCode)
{
switch(sender)
{
case ARENA_GAMBLER_MENU_CHALLENGE_PLAYER:
{
if(Player *pDefender = sObjectMgr->GetPlayer(pCode))
{
if(sGamblingSystem.CanHaveMatch(pPlayer, pDefender) == false)
{
// General Error Message: Match not possible because:
ChatHandler(pPlayer->GetSession()).PSendSysMessage(ARENA_GAMBLER_MSG_MATCH_NOT_POSSIBLE);

error C2039: ‘GetPlayer’ : is not a member of ‘ObjectMgr’

please help me

Assuming the code is the name of a player, use this :

sObjectAccessor->FindPlayerByName(pCode)

thx you are awesome !

/emoticons/default_wink.png no problem