Kamras

Member
I know there has to be a way to do this, I've been searching PM and Guild scripts, cannot find the proper argument to put in to have a toon automatically added to a guild upon creation... Anyone have any clues to this? Idea, such as a New Player Guild or something like that.
 
Actually as I posted that.. I think I found what I was looking for..

Code:
 guildname.AddMember(player)

maybe. I will see if that arg works out
 
Check at the Guild.cs in the core.
public static BaseGuild FindByName( string name )

but it's abstract, so you could try:
Guild.FindByName("New players guild")

Or you could go directly by the id of the guild.
 
I checked guild.html, I did find a lot of information however I'm actually having a rough time making sense of it. I do see the
Code:
void AddMember (Mobile m)
however my question is, how can you actually define an existing guild? more so, if I wanted to get the guild ID, how would I obtain that? typically I can find most attributes to modify in the PM or even the props menu, however that is where im truly getting stuck..
 
You will have to find the Guild first so for that you can use (like Po0ka mentioned)
Code:
	BaseGuild.Find(int id) 					// returns BaseGuild
	BaseGuild.FindByName(string name) 		// returns BaseGuild
	BaseGuild.FindByAbbrev(string abbr) 	// returns BaseGuild
	BaseGuild.Search(string find) 			// returns List<BaseGuild>

Once you got the Guild you would call the AddMember on that Guild to add the player to the guild on creation.
So there are more ways than the id if you do not know it.
 
So this is what I've identified so far however it fails to compile
Code:
                Guild.FindByName("Human");
                Human.AddMember(player);

Code:
    CS0103: Line 254: The name 'Human' does not exist in the current context
    CS0103: Line 254: The name 'player' does not exist in the current context

Could you please post an example of how a guild name could be called and then applied via script after being called?
 
Sure thing,
Code:
Guild g = BaseGuild.FindByName("Begginers Guild") as Guild;
if(g != null)
{
	g.AddMember(from);
}
 
Oy.. I wasn't even close... Some days this stuff is easy, other days. I should just go to sleep. Well Pyr0! Thank you for your assistance! and Po0ka as well.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back