Jump to content
  • 0

Ranking PvP SQL does not show the class


Scofield

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.03
  • Content Count:  265
  • Reputation:   11
  • Joined:  01/11/13
  • Last Seen:  

Hello, I have this pvp sql ranking, the problem is that he is not registering the class, the kills and deaths part works well, just not computing the class.

	-    script    Rank2    -1,{
	OnPCKillEvent:
	    getmapxy @map$,@x,@y,0;
    if ( @map$ == "amatsu" ) goto Kill;
    
    end;
    
Kill:
if( @last_killed$ == rid2name( killedrid ) ) end;
set @last_killed$, rid2name( killedrid );
Announce "The player [ " + strcharinfo(0)+" ] defeated the player [ " + rid2name(killedrid) + " ] and now it has " + @points + " wins!", bc_map, 0xFF7F50;
set @CID,getcharid(0);
set @pvp,0;
set @name$,"";
set @Job$,jobname(Class);
	query_sql "SELECT `kills` FROM `pvp` WHERE `char_id`="+@CID+"",@pvp;
query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$;
query_sql "SELECT `classe` FROM `pvp` WHERE `char_id`="+@CID+"",@Job$;
	if (@name$ == ""){
query_sql "INSERT INTO `pvp` (`char_id`,`name`,`kills`,`classe`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1,'"+jobname(Class)+"',1)",@esc$;
    set @points,@points+1;
dispbottom " Your Score: "+@points;
end;
}
	query_sql "UPDATE `pvp` SET `kills` = `kills` +1 WHERE `char_id`="+@CID+"",@esc$;
    set @points,@points+1;
dispbottom " Your Score: "+@points;
end;
	}
	
-    script    Rank3    -1,{
	OnPCDieEvent:
	    getmapxy @map$,@x,@y,0;
    if ( @map$ == "amatsu" ) goto Deat;
    
end;
    
Deat:
set @CID,getcharid(0);
set @pvp,0;
set @name$,"";
set @Job$,jobname(Class);
	query_sql "SELECT `deaths` FROM `pvp` WHERE `char_id`="+@CID+"",@pvp;
query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$;
query_sql "SELECT `classe` FROM `pvp` WHERE `char_id`="+@CID+"",@Job$;
	if (@name$ == ""){
query_sql "INSERT INTO `pvp` (`char_id`,`name`,`deaths`,`classe`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1,'"+jobname(Class)+"',-1)",@esc$;
    set @points,@points+1;
end;
}
	query_sql "UPDATE `pvp` SET `deaths` = `deaths` +1 WHERE `char_id`="+@CID+"",@esc$;
    set @points,@points+1;
end;
	}
	

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...