SHOW:
|
|
- or go back to the newest paste.
1 | /* Small C++ script, credits to AuxProductions. */ | |
2 | ||
3 | #include "StdAfx.h" | |
4 | #include "Setup.h" | |
5 | ||
6 | ||
7 | #ifdef WIN32 | |
8 | #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float' | |
9 | #endif | |
10 | ||
11 | ||
12 | ||
13 | ||
14 | void OnFirstEnterWorld(Player * pPlayer) | |
15 | { | |
16 | - | char message[500]; |
16 | + | static const char* classes[12] = {"None", "Warrior", "Paladin", "Hunter", "Rogue", "Priest", "Death Knight", "Shaman", "Mage", "Warlock", "None", "Druid"}; |
17 | - | sprintf(message, "[SERVERNAME] Welcome our new player, %s to the server!", pPlayer->GetName()); |
17 | + | char message[500]; |
18 | - | sWorld.SendWorldWideScreenText(message); |
18 | + | sprintf(message, "[SERVERNAME] Welcome our new %s, %s to the server!", classes[pPlayer->getClass()], pPlayer->GetName()); |
19 | sWorld.SendWorldWideScreenText(message); | |
20 | } | |
21 | ||
22 | ||
23 | ||
24 | void SetupOnFirstEnterWorld(ScriptMgr * mgr) | |
25 | { | |
26 | mgr->register_hook(SERVER_HOOK_EVENT_ON_FIRST_ENTER_WORLD, OnFirstEnterWorld); | |
27 | } |