Jump to content
  • 0

Script error MVP Ranker


Fantastik

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   1
  • Joined:  12/03/11
  • Last Seen:  

fro,103,119,4	script	MVP Ranking Board	857,{
	
query_sql( "SELECT `name`,`Count` FROM `E-MVPRank` ORDER BY `Count` DESC LIMIT 5",.@Name$,.@Count );
if( getarraysize( .@Name$ ) ){
for( set .@i,0; .@i < getarraysize( .@Name$ ); set .@i,.@i + 1 )
  mes "[ "+( .@i + 1 )+". ] "+.@Name$[.@i]+" - "+.@Count[.@i]+" Points";
}else{
mes "No Record Found.";
}
close;
OnInit:
setarray .mvp_list[0],1002,1002,1002,1002;
for( .@i = 0; .@i < getarraysize( .mvp_list ); .@i++ )
setd( ".mvp_"+.mvp_list ),1;
end;
OnNPCKillEvent:
if( getd( ".mvp_"+.mvp_list ) )
query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`name`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1" );
end;

Can anybody help me convert this script to eathena? Thank you.

 

Im having this error

    parse_line: expect command, missing function name or calling undeclared func
tion
    10 : mes "No Record Found.";
    11 : }
    12 : close;
    13 : OnInit:
    14 : setarray .mvp_list[0],1002,1002,1002,1002;
*   15 : for( '.'@i = 0; .@i < getarraysize( .mvp_list ); .@i++ )
    16 : setd( ".mvp_"+.mvp_list ),1;
    17 : end;
    18 : OnNPCKillEvent:
    19 : if( getd( ".mvp_"+.mvp_list ) )
    20 : query_sql( "INSERT INTO `E-MVPRank` SET `char_id`='"+getcharid(0)+"',`n
ame`='"+strcharinfo(0)+"',`Count`='1' ON DUPLICATE KEY UPDATE `Count`=`Count`+1"
 );
Link to comment
Share on other sites

1 answer to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  949
  • Reputation:   174
  • Joined:  06/12/12
  • Last Seen:  

Change line to

for(set .@i,0; .@i < getarraysize( .mvp_list ); set .@i,.@i+1 )

That means your files are outdated

Edited by Emistry
Fixed typo.
Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...