I'm trying to make a script that will teleport any player that initiates PvP in a zone and or area to Gurubashi. I compile the following with no errors however it doesn't seem to wanna work, and i'm sure i'm using the wrong arguments however any help is appreciated!
Code:
#include "ScriptPCH.h"
class pvp_port : public PlayerScript
{
public:
pvp_port() : PlayerScript("pvp_port") { }
void OnUpdateZone(Player* player, uint32 /*newZone*/, uint32 newArea)
{
if (player->IsPvP() && newArea == 4089)
{
player->TeleportTo(0, -13184.7f, 311.396f, 21.8584f, 4.26875f);
ChatHandler(player->GetSession()).PSendSysMessage("|cffff6060[PvP Restriction]:|r %s has been teleported to Gurubashi for PvPing in a Non-PvP Zone.", player->GetName());
}
}
};
void AddSC_pvp_port()
{
new pvp_port();
}