mafianekcek 15 Posted August 8, 2016 Share Posted August 8, 2016 Hello dev, i need problem, functions guild.get_name() or guild.name() dont work in my quests. I have 40k game Spoiler quest guild_name begin state start begin when 11000.chat."Gname" begin say(""..guild.get_name().."") end end end Where can be problem? Or how to fix it? Thanks for your tips. Link to comment Share on other sites More sharing options...
Jodie 4 Posted August 8, 2016 Share Posted August 8, 2016 int guild_get_name(lua_State * L) { if (!lua_isnumber(L, 1)) { lua_pushstring(L, ""); return 1; } CGuild * pkGuild = CGuildManager::instance().FindGuild((DWORD) lua_tonumber(L, 1)); if (pkGuild) lua_pushstring(L, pkGuild->GetName()); else lua_pushstring(L, ""); return 1; } That means, you have to enter the guild id. The function will return empty string if you don't - Jodie Link to comment Share on other sites More sharing options...
mafianekcek 15 Posted August 8, 2016 Author Share Posted August 8, 2016 38 minutes ago, Jodie said: int guild_get_name(lua_State * L) { if (!lua_isnumber(L, 1)) { lua_pushstring(L, ""); return 1; } CGuild * pkGuild = CGuildManager::instance().FindGuild((DWORD) lua_tonumber(L, 1)); if (pkGuild) lua_pushstring(L, pkGuild->GetName()); else lua_pushstring(L, ""); return 1; } That means, you have to enter the guild id. The function will return empty string if you don't - Jodie Yes, it works when i type guild.get_name(1), but i need use: g_name = mysql_query("SELECT name FROM player.guild_dungeon WHERE id='1' LIMIT 1")[1][1] if guild.get_name() == g_name then and updating for name is: update = mysql_query("UPDATE player.guild_dungeon SET name='"..guild.get_name().."' WHERE id='1' LIMIT 1")[1] and i need to work automatically can you help me please? Link to comment Share on other sites More sharing options...
Jodie 4 Posted August 8, 2016 Share Posted August 8, 2016 Then use, pc.get_guild(). It returns guild id if you have a guild. Otherwise it will return zero. guild.get_name(player.get_guild()) - Jodie Link to comment Share on other sites More sharing options...
mafianekcek 15 Posted August 8, 2016 Author Share Posted August 8, 2016 5 minutes ago, Jodie said: Then use, pc.get_guild(). It returns guild id if you have a guild. Otherwise it will return zero. guild.get_name(player.get_guild()) - Jodie Thank you very much! problem solved btw.. pc.get_guild() Link to comment Share on other sites More sharing options...
Jodie 4 Posted August 8, 2016 Share Posted August 8, 2016 Your welcome Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now