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;
}
Question
Scofield
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.
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.