PDA

View Full Version : Player Commands



StickyIcky
02-08-08, 04:05 PM
//---------------------
// Name: Player Commands
// Author: WigSplitta
//---------------------

#include "StdAfx.h"
#include "Setup.h"

#define map Insert Map ID Here
#define x Insert X Coords Here
#define y Insert Y Coords Here
#define z Insert Z Coords Here
#define o Insert Orientation Here

#ifdef WIN32
#pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
#endif

//If set to true, will enable players to #event while in combat
static bool bypassCombat = false;

static string mall = "#mall";

void PlrCom(Player * Plr, uint32 Type, uint32 Lang, const char * Message, const char * Misc)
{
if(Message == mall)
{
if(Plr->IsPvPFlagged())
{
Plr->BroadcastMessage("You can't be PVP Flagged when porting to the mall.");
}
else
{
if(Plr->CombatStatus.IsInCombat())
{
Plr->BroadcastMessage("You can't port while in combat.");
}
else
{
Plr->EventTeleport(map, x, y, z);
Plr->SetOrientation(o);
}
}
}
}

void SetupPlayerCommands(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_CHAT, &PlrCom);
}
If people want me to make them custom commands or custom player commands, just ask here (http://www.mmopro.net/forums/c-modules/32-wigsplittas-c-request-thread.html).

Chmun
02-08-08, 10:30 PM
This is cool, now i can make more comamnds :D .. GJ +3 rep
Did u make it or Copy it?