[DiscordArchive] Are u asking for starter guilds?
[DiscordArchive] Are u asking for starter guilds?
Archived author: M'Dic • Posted: 2023-04-30T20:23:07.056000+00:00
Original source
Are u asking for starter guilds?
Archived author: M'Dic • Posted: 2023-04-30T20:23:17.721000+00:00
Original source
That script is already done
Archived author: Tea • Posted: 2023-04-30T20:23:33.027000+00:00
Original source
why are you making a new guild object instead of using sGuildMgr->GetGuildById to find the one you want
Archived author: LaHonder • Posted: 2023-04-30T20:34:26.426000+00:00
Original source
https://i.imgur.com/teYKGiu.jpeghttps://...om/teYKGiu
Archived author: LaHonder • Posted: 2023-04-30T20:34:29.319000+00:00
Original source
Yay
Archived author: LaHonder • Posted: 2023-04-30T20:34:33.628000+00:00
Original source
that worked
Archived author: Tea • Posted: 2023-04-30T20:36:18.327000+00:00
Original source
also, remove sScriptMgr->OnGuildAddMember from your script
Archived author: Tea • Posted: 2023-04-30T20:36:30.940000+00:00
Original source
guild->AddMember already calls it
Archived author: LaHonder • Posted: 2023-04-30T20:37:03.096000+00:00
Original source
ok will test it using dynamic script then i not must always restart server
worls well, thank you
Archived author: M'Dic • Posted: 2023-04-30T20:47:27.829000+00:00
Original source
This is the ancient guild on new player script (gon) or starter guild script. about 4 or 5 years old
```cpp
#include "ScriptMgr.h"
#include "Player.h"
#include "GuildMgr.h"
#include "Config.h"
#include "Guild.h"
class gon_playerscripts : public PlayerScript
{
public:
gon_playerscripts() : PlayerScript("gon_playerscripts") { }
void OnLogin(Player* player, bool firstLogin)
{
if (firstLogin)
{
uint32 GUILD_ID_ALLIANCE = sConfigMgr->GetIntDefault("StartGuild.Alliance", 0);
uint32 GUILD_ID_HORDE = sConfigMgr->GetIntDefault("StartGuild.Horde", 0);
Guild* guild = sGuildMgr->GetGuildById(player->GetTeam() == ALLIANCE ? GUILD_ID_ALLIANCE : GUILD_ID_HORDE);
if (guild)
guild->AddMember(player->GetGUID());
}
}
};
void AddSC_gon_playerscripts()
{
new gon_playerscripts();
}
```