Sikdope 0 Posted September 26, 2020 Hello everyone can you help me why the top hunter does not appear in the script .. but there is no problem with the script thanks guys! here the script: alter table `char` add `gold_rank` int(11) unsigned default 0 after unban_time, add index (gold_rank); */ mes "[ ^C6A518Top 30 Gold Hunters^000000 ]"; .@nb = query_sql( "select name, gold_rank from `char` where gold_rank > 0 order by gold_rank desc limit 2", .@name$, .@gold ); if ( !.@nb ) { mes "No ranking yet"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$ +" killed "+ .@gold +" Golden Peco"; close; OnNPCKillEvent: if ( strcharinfo(3) == "ordeal_1-2" && killedrid == 1369 ) query_sql "update `char` set gold_rank = gold_rank +1 where char_id = "+ getcharid(0); end; Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted September 27, 2020 (edited) /* alter table `char` add `gold_rank` int(11) unsigned default 0 after unban_time, add index (gold_rank); */ prontera,155,185,5 script kjdshfksfh 1_F_MARIA,{ mes "[ ^C6A518Top 30 Gold Hunters^000000 ]"; .@nb = query_sql( "select name, gold_rank from `char` where gold_rank > 0 order by gold_rank desc limit 2", .@name$, .@gold ); if ( !.@nb ) { mes "No ranking yet"; close; } for ( .@i = 0; .@i < .@nb; .@i++ ) mes .@name$[.@i] +" killed "+ .@gold[.@i] +" Golden Peco"; close; OnNPCKillEvent: if ( strcharinfo(3) == "ordeal_1-2" && killedrid == 1369 ) query_sql "update `char` set gold_rank = gold_rank +1 where char_id = "+ getcharid(0); end; } it is working fine, tested Edited September 27, 2020 by AnnieRuru Quote Share this post Link to post Share on other sites
0 Sikdope 0 Posted September 27, 2020 (edited) thank you mam! but when I include it in the goldroom script it doesn't work anymore.. if killed a lot of grand peco it will not add to the guild_rank in goldroom script here the script! () I apologize because I did not fix it. and sorry for my bad english PS: its ok too you. can u make me the script just like that Edited September 28, 2020 by Sikdope Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted September 27, 2020 that's because the monster with event labels doesn't trigger OnNPCKillEvent this has been discuss for years and there are no perfect solution to solve this issue EDIT: it seems there is, Kenpachi suggest we add another flag to monster spawn with or without event labels anyway this is developer talk ... to fix your problem just need to remove the OnNPCKillEvent label and incorporate it into OnKill label by the way I have no idea why your screenshot shows so many kills, the `gold_rank` field has been default to 0 in the SQL syntax... try create another table to solve those incorrect value kills then I don't think its a good idea to run query_sql inside OnNPCKillEvent label, since this script is made for high rate server and players can kill peco fast so I made minor changes https://gist.github.com/AnnieRuru/6f41d54b03417a768167820ee6f1f037 Quote Share this post Link to post Share on other sites
0 Sikdope 0 Posted September 28, 2020 Hello mam, sorry for the late reply thankyou for the help but i got error on script [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: monster (7 parameters): [Debug]: Data: string value="ordeal_1-2" [Debug]: Data: number value=0 [Debug]: Data: number value=0 [Debug]: Data: string value="Golden Peco" [Debug]: Data: variable name='GRAND_PECO' index=0 [Debug]: Data: number value=500 [Debug]: Data: string value="Gold Room#tst::OnKilled" [Debug]: Source (NPC): Gold Room#tst at prontera (165,155) [Warning]: script:get_val: cannot access player variable 'GRAND_PECO', defaulting to 0 [Warning]: buildin_monster: Attempted to spawn non-existing monster class 0 [Debug]: Source (NPC): Gold Room#tst at prontera (165,155) Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted September 28, 2020 you are using rathena ? Quote Share this post Link to post Share on other sites
0 Sikdope 0 Posted September 28, 2020 sorry for the inconvenience mam! yes mam im using rathena hope you help me again mam thank you! Quote Share this post Link to post Share on other sites
0 AnnieRuru 957 Posted September 28, 2020 https://gist.github.com/AnnieRuru/cbee08cbd9d82868ccbcd2a2e4d3bf4f Quote Share this post Link to post Share on other sites
0 Sikdope 0 Posted September 28, 2020 (edited) Hello mam its working but im trying two accounts in the gold room but the second account or name did not appear in gold_rank.. and is that top 10 of max guild rank and how many max its top rank? thankyou so much! . EDIT: solved thank you very much ma'am ! Edited September 28, 2020 by Sikdope Quote Share this post Link to post Share on other sites
Hello everyone can you help me why the top hunter does not appear in the script .. but there is no problem with the script thanks guys!
here the script:
alter table `char` add `gold_rank` int(11) unsigned default 0 after unban_time, add index (gold_rank);
*/
mes "[ ^C6A518Top 30 Gold Hunters^000000 ]";
.@nb = query_sql( "select name, gold_rank from `char` where gold_rank > 0 order by gold_rank desc limit 2", .@name$, .@gold );
if ( !.@nb ) {
mes "No ranking yet";
close;
}
for ( .@i = 0; .@i < .@nb; .@i++ )
mes .@name$ +" killed "+ .@gold +" Golden Peco";
close;
OnNPCKillEvent:
if ( strcharinfo(3) == "ordeal_1-2" && killedrid == 1369 )
query_sql "update `char` set gold_rank = gold_rank +1 where char_id = "+ getcharid(0);
end;
Share this post
Link to post
Share on other sites