powkda Posted April 29, 2020 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 90 Reputation: 1 Joined: 11/11/17 Last Seen: 29 minutes ago Share Posted April 29, 2020 (edited) - script OnPCDieEvente#pvp1 -1,{ OnPCDieEvent: getmapxy @mapdie1$,@x,@y; if (@mapdie1$ != "coca_cola")end; set @id,getcharid(0); set @name$,""; query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@id+"",@name$; if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`deaths_pvp1`,`saldo_pvp1`) VALUES ("+@id+",'"+strcharinfo(0)+"',1)"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; end; } query_sql "UPDATE `rankpvp01` SET `deaths_pvp1` = `deaths_pvp1` + 1 WHERE `char_id`='"+getcharid(0)+"'"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; set @kill1,0; end; } Good morning guys, I'm having difficulties with the sql of the pvp arena I'm doing, the balance is not counting Would you help me? I thank you for your attention Edited April 29, 2020 by powkda Quote Link to comment Share on other sites More sharing options...
0 Chaos92 Posted April 29, 2020 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 1826 Reputation: 288 Joined: 08/03/12 Last Seen: 3 hours ago Share Posted April 29, 2020 16 minutes ago, powkda said: - script OnPCDieEvente#pvp1 -1,{ OnPCDieEvent: getmapxy @mapdie1$,@x,@y; if (@mapdie1$ != "coca_cola")end; set @id,getcharid(0); set @name$,""; query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@id+"",@name$; if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`deaths_pvp1`,`saldo_pvp1`) VALUES ("+@id+",'"+strcharinfo(0)+"',1)"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; end; } query_sql "UPDATE `rankpvp01` SET `deaths_pvp1` = `deaths_pvp1` + 1 WHERE `char_id`='"+getcharid(0)+"'"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; set @kill1,0; end; } Good morning guys, I'm having difficulties with the sql of the pvp arena I'm doing, the balance is not counting Would you help me? I thank you for your attention Have you run the SQL ? I think this script should have their own SQL which need to be query first so that the table rankpvp01 are exist. Quote Link to comment Share on other sites More sharing options...
0 powkda Posted April 29, 2020 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 90 Reputation: 1 Joined: 11/11/17 Last Seen: 29 minutes ago Author Share Posted April 29, 2020 11 hours ago, Chaos92 said: Have you run the SQL ? I think this script should have their own SQL which need to be query first so that the table rankpvp01 are exist. yes, I made the table, follow below 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; the ratio that is "saldo_pvp1" is not being accounted for I'll post the npc here for you to take a look - script OnPCDieEvente#pvp1 -1,{ OnPCDieEvent: getmapxy @mapdie1$,@x,@y; if (@mapdie1$ != "coca_cola")end; set @id,getcharid(0); set @name$,""; query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@id+"",@name$; if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`deaths_pvp1`,`saldo_pvp1`) VALUES ("+@id+",'"+strcharinfo(0)+"',1)"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; end; } query_sql "UPDATE `rankpvp01` SET `deaths_pvp1` = `deaths_pvp1` + 1 WHERE `char_id`='"+getcharid(0)+"'"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `saldo_pvp1` - 1 WHERE `char_id`='"+getcharid(0)+"'"; set @kill1,0; end; } - script OnPCKillEvent#pvp1 -1,{ OnPCKillEvent: getmapxy @map1$,@x,@y; if (@map1$!="coca_cola")end; set Antifk,killedrid; set @id,getcharid(0); set @name$,""; query_sql "SELECT `name` FROM `rankpvp01` WHERE `char_id`="+@id+"",@name$; if ( @name$ == "" ) { query_sql "INSERT INTO `rankpvp01` (`char_id`,`name`,`kills_pvp1`) VALUES ("+@id+",'"+strcharinfo(0)+"',1)"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `kills_pvp1` - `deaths_pvp1` WHERE `char_id`='"+getcharid(0)+"'"; end; } query_sql "UPDATE `rankpvp01` SET `kills_pvp1` = `kills_pvp1` + 1 WHERE `char_id`='"+getcharid(0)+"'"; query_sql "UPDATE `rankpvp01` SET `saldo_pvp1` = `kills_pvp1` - `deaths_pvp1` WHERE `char_id`='"+getcharid(0)+"'"; set @kill1,@kill1+1; } Quote Link to comment Share on other sites More sharing options...
Question
powkda
Good morning guys, I'm having difficulties with the sql of the pvp arena I'm doing, the balance is not counting
Would you help me? I thank you for your attention
Edited by powkdaLink to comment
Share on other sites
2 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.