function script GuildRanker {
query_sql("select name from `guild` where guild_id = '"+.@gid+"'", .@gname$);
query_sql "CREATE TABLE IF NOT EXISTS `woe_extension`(`guild_id` int(11) unsigned NOT NULL,`guild_points` smallint(6) unsigned NOT NULL default '0')";
set .@TempGuild_id, .@gid;
query_sql("SELECT guild_points FROM woe_extension WHERE guild_id="+.@TempGuild_id, .@TempGuild_Points);
if ( .@TempGuild_id != 0 && .@TempGuild_Points == 0 ) {// guild not listed yet
set .@TempGuild_Points, .@TempGuild_Points + 1;
query_sql "INSERT INTO woe_extension (guild_id, guild_points) VALUES ("+.@TempGuild_id+","+.@TempGuild_Points+")";
announce "Guild ["+.@gname$+"] has just added One [1] WoE Points by conquering a Castle and with a running Guild Conqueror Points of "+.@TempGuild_Points+" !",bc_all;
}
if ( .@TempGuild_id != 0 && .@TempGuild_Points >= 1 ) { // guild is listed
set .@TempGuild_Points, .@TempGuild_Points + 1;
query_sql("UPDATE woe_extension SET guild_points="+.@TempGuild_Points+" WHERE guild_id="+.@TempGuild_id);
announce "Guild ["+.@gname$+"] has just added another One [1] WoE Points by conquering a Castle and with a running Guild Conqueror Points of "+.@TempGuild_Points+" !",bc_all;
}
return;
It's working and giving the points and it's recorded on the sql..
I want to integrate this point in the guild ranking feature of flux or maybe another ranking feature but i'm finding it hard to do so cause i can't understand the code such as:
$col = "g.guild_id, g.name, g.guild_lv, g.exp, g.average_lv, g.emblem_len,";
$col .= "(SELECT COUNT(char_id) FROM {$server->charMapDatabase}.`char` WHERE `char`.guild_id = g.guild_id) AS members, ";
$col .= "(SELECT COUNT(castle_id) FROM {$server->charMapDatabase}.guild_castle WHERE guild_castle.guild_id = g.guild_id) AS castles";
$sql = "SELECT $col FROM {$server->charMapDatabase}.guild AS g ";
$sql .= "LEFT JOIN {$server->charMapDatabase}.`char` AS ch ON ch.char_id = g.char_id ";
$sql .= "LEFT JOIN {$server->loginDatabase}.login ON login.account_id = ch.account_id ";
Question
Elijah23
Hello everyone..
So i've used a script for guild points..
It's working and giving the points and it's recorded on the sql..
I want to integrate this point in the guild ranking feature of flux or maybe another ranking feature but i'm finding it hard to do so cause i can't understand the code such as:
I tried to make a code but it's not working..
Thanks in advance..
Link to comment
Share on other sites
1 answer to this question
Recommended Posts