Jump to content
  • 0
Sign in to follow this  
horeak

rank pvp ratio is not counted

Question

Good night guys, I'm using this table

CREATE TABLE `rankpvp01` (
  `char_id` int(11) NOT NULL,
  `name` varchar(23) DEFAULT NULL,
  `kills_pvp1` int(11) DEFAULT NULL,
  `deaths_pvp1` int(11) DEFAULT NULL,
  `saldo_pvp1` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

and the following commands

-	script	OnPCDieEvent#1	-1,{

OnPCDieEvent:

getmapxy @mapdie1$,@x,@y;

if (@mapdie1$ != "coca_cola") end;

		set @CID,getcharid(0);set @name$,"";set @points,0;
					query_sql "SELECT `deaths_pvp1` FROM `rankpvp01` WHERE `char_id`="+@CID+"",@points;
					query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@CID+"",@name$;
			if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`deaths_pvp1`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1)",@esc$; end; }
					query_sql "UPDATE `rankpvp01` SET `deaths_pvp1` = `deaths_pvp1` + 1 WHERE `char_id`="+@CID+"",@esc$;
						end;
}

and

-	script	OnPCKillEvent#pvp1	-1,{

OnPCKillEvent:

getmapxy @map1$,@x,@y;
if ( @map1$ != "coca_cola" ) end;

		set @CID,getcharid(0);set @name$,"";set @points,0;
					query_sql "SELECT `kills_pvp1` FROM `rankpvp01` WHERE `char_id`="+@CID+"",@points;
					query_sql "SELECT `saldo_pvp1` FROM `rankpvp01` WHERE `char_id`="+@CID+"",@saldo;
					query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@CID+"",@name$;

			if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`kills_pvp1`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1)",@esc$; dispbottom "Você Matou seu primeiro jogador"; end; }
					query_sql "UPDATE `rankpvp01` SET `kills_pvp1` = `kills_pvp1` +1 WHERE `char_id`="+@CID+"",@esc$;
					query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` +1 WHERE `char_id`="+@CID+"",@esc$;
		set @points,@points+1;
		announce "Você matou [ "+rid2name(killedrid)+" ] e chegou a "+@points+" jogadores mortos.",bc_self,0x90FFFF;
						end;

}

 

but the saldo_pvp1 is not being accounted for
I want that every time the player dies she loses 1 point in the saldo_pvp1 and every time he kills he gets 1 point
already tried everything and does not leave 0

 

someone who can help me? thank you very much 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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