[Pawn] Help Add - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] Help Add (/showthread.php?tid=1719) |
Help Add - Hitler - 2021-02-27 Espa?ol: Hola, tengo un Ranking de equipos en el cual si un jugador mata a otro jugador se le dar? de puntaje?al team, el problema es que cuando reinicio el servidor cuando?un jugador mata a otro jugador la puntuaci?n del team vuelve a 1 y va sumando nuevamente, en la base de datos se?guarda bien el puntaje del team pero se pierde cuando se suma nuevamente, debe ser por esta funci?n que quiz?s est? mal. English: Hello, I have a Team Ranking in which if a player kills another player, the team will be given score, the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again, in the database the team's score is saved well but it is lost when it is added again, it must be because of this function that it may be wrong. Code: new query[250],puntaje; Espa?ol:?O cual ser?a la soluci?n? English:?Or what would be the solution? RE: Help Add - Virsenas - 2021-02-27 Quote:the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again Sounds like a loading problem. Did you debug the loading? Did you check what it loads? RE: Help Add - Hitler - 2021-02-27 (2021-02-27, 09:02 PM)Virsenas Wrote:Quote:the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again It loads well, the problem is when is added RE: Help Add - Virsenas - 2021-02-27 (2021-02-27, 09:05 PM)Hitler Wrote:(2021-02-27, 09:02 PM)Virsenas Wrote:Quote:the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again Can you show the loading code? RE: Help Add - Hitler - 2021-02-27 (2021-02-27, 09:10 PM)Virsenas Wrote:(2021-02-27, 09:05 PM)Hitler Wrote:(2021-02-27, 09:02 PM)Virsenas Wrote:Quote:the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again Code: CMD:ranking(playerid) RE: Help Add - Virsenas - 2021-02-27 (2021-02-27, 09:28 PM)Hitler Wrote:(2021-02-27, 09:10 PM)Virsenas Wrote:(2021-02-27, 09:05 PM)Hitler Wrote:(2021-02-27, 09:02 PM)Virsenas Wrote:Quote:the problem is that when I restart the server when a player kills another player, the team score returns to 1 and it is adding again Quote:It loads well, the problem is when is added I would be surprised if the code even compiled. You just created that code with no real care just to make it look like you tried putting in effort. I wondered why it took you more than 10 minutes to copy and paste your loading code. In order to make your ranking script you will need: https://www.youtube.com/watch?v=kR3nRkbGmiA for information to hold (team names, player names, score etc.) https://sampwiki.blast.hk/wiki/MySQL/R40 for loading and saving https://open.mp/docs/scripting/functions/strcat for showing ranking information in a dialog Good luck. RE: Help Add - Radical - 2021-02-27 PHP Code: mysql_tquery(con, "UPDATE `Ranking` SET `Score` = `Score` 1 WHERE `ID` = '1'"); |