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

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.