Jump to content
  • 0
Sign in to follow this  
Sikdope

gold_rank not working

Question

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;

not working.png

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0
/*
	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

 

screen2020Hercules004.jpg

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

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

not.png

Edited by Sikdope

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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)

Share this post


Link to post
Share on other sites
  • 0

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!

working.png

 

.

EDIT: solved thank you very much ma'am !

Edited by Sikdope

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.