View Full Version : guild AddMember method

02-11-2014, 02:11 PM
is the method AddMember() disabled ?
I get error "attempt to call method a nil value"

local Guildname = GWARZ[locid].guild_name
Guildname:AddMember(player, 4)

lol and no rush just workin on adding misc features

02-11-2014, 02:17 PM
What would Guildname be?
I assume it is a STRING not a guild object ..

02-11-2014, 02:36 PM
its a string value stored in a table. "if a player without a guild clicks a GGW flag then he will get a gossip menu offering join guild selection. so if no guild members are online I can add them to the guild that owns that flag.

02-11-2014, 03:09 PM
Guildname needs to be an object, not a string :P you can't call a method on a string like that

02-11-2014, 03:21 PM
You can do this though

local Guildname = GWARZ[locid].guild_name

GetGuildByName(Guildname):AddMember(player, 4)

02-11-2014, 03:28 PM
ahhh :facepalm: forgot something(GetGuildByName)

local Guildname =GetGuildByName(GWARZ[locid].guild_name)
Guildname:AddMember(player, xx)

now it works....
but is there a way to identify the lowest rank of a guild (due to being able to add more ranks lol) 4 wont allways work and tried 99 thinking it just might default to the lowest lol nope alien rank xD

02-11-2014, 03:51 PM
There is no method .. I guess you may need to query DB for it atm.

02-11-2014, 04:00 PM
yea was figuring may have to do it that way maybe table each guild rank names and level value
kewl no prob thanx guyz :D