[B][I]I would like to ask for help again
I’m creating my own ‘npc_teleport’, wanna know how to get the local teleport in DataBase ‘game_tele’.
if anyone can help me thank[/I][/B]
[CODE]
#include “ScriptPCH.h”
class home_teleporter : public CreatureScript
{
public:
home_teleporter()
: CreatureScript(“home_teleporter”) { }
bool OnGossipHello(Player* pPlayer, Creature* pCreature)
{
pPlayer->ADD_GOSSIP_ITEM(4, "Teleports",GOSSIP_SENDER_MAIN,1);
pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());
return true;
}
bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /uiSender/, uint32 uiAction)
{
pPlayer->PlayerTalkClass->ClearMenus();
switch (uiAction)
{
case 1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE, "[Home] ->", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(4, "Exit",GOSSIP_SENDER_MAIN,4);
pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pCreature->GetGUID());
break;
case 2:
// How do I get the coordinates in DataBase 'game_tele' and teleport the player is to cordenada
QueryResult result = WorldDatabase.PQuery("SELECT `position_x`, `position_y`, `position_z`, `position_o`, `map` FROM `name`",pPlayer->GetGUID);
pPlayer->TeleportTo(map, position_x, position_y, position_z, position_o); //I want the player to be the coordinates of the teleporter DataBase 'game_tele'
break;
case 3:
pPlayer->CLOSE_GOSSIP_MENU();
break;
}
return true;
}
};
void AddSc_home_teleporter()
{
new home_teleporter();
}[/CODE]