Here is a C++ Script i made its using the ON_GUILD_JOIN server hook to make it say congrats when someone joins the GM guild
Code:
//This is the Main Script name it what ever you want .cpp
#define ID [Your GM Guild ID]
void GMHire(Player* plr)
{
if(plr->GetGuildId()== ID)
{
char message[200];
sprintf(message, "Congratulations %s on getting hired to the [YourServerName] GM Team", plr->GetName());
plr->BroadcastMessage(message);
}
}
void SetupGMHire(ScriptMgr * mgr)
{
mgr->register_hook(SERVER_HOOK_EVENT_ON_GUILD_JOIN, (void*)GMHire);
}
Code:
//Name this file Setup.cpp
#include"StdAfx.h"
#include"Setup.h"
#include<ScriptSetup.h>
extern"C" SCRIPT_DECL uint32 _exp_get_script_type()
{
return SCRIPT_TYPE_MISC;
}
extern"C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
{
SetupGMHire(mgr);
}
#ifdef WIN32
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
#endif
Code:
//Name this file Setup.h
void SetupGMHire(ScriptMgr * mgr);
#endif
Thats the script i have it fully tested and everything reply with your thoughts of this