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