Get Guild Level on Script

OverLord

New member
Messages
168
Points
0
Age
36
Location
Brazil
Emulator
I would like to make a weapon system and NPC that vary according to the level of the guild. How can I do to get this information? I looked in the manual but I did not command that returns to the guild level.

 
@@OverLord

There is no actual function to do this but you could create one on your own like this:

Code:
function	script	getGuildLvl	{	.@res = query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '" +  getarg( 0 ) + "'", .@guild_lv;	if( .@res )		return .@guild_lv;			return 0;}
 
Last edited by a moderator:
@@Winterfox Very thx!!! You thinking this funcion add guild level in ATK bonus its a problem ? or ok?

 
Last edited by a moderator:
@@OverLord

Since you can call functions in any kind of scripts globally it should also work in such cases.

 
or you can use my scriptcommand :v

BUILDIN(getguildlvl){ int guild_id; struct guild* g; guild_id = script_getnum(st,2); if( ( g = guild->search(guild_id) ) != NULL ) script_pushint(st,g->guild_lv); else script_pushint(st,0); return true;}
Code:
BUILDIN_DEF(getguildlvl, "i"),
Usage:

Code:
getguildlvl(guild_id)
 
Last edited by a moderator:
Back
Top