Tdi123 Posted September 9, 2020 Posted September 9, 2020 (edited) Problem: Script: https://pastebin.com/RGxyWQup SQL Table: https://pastebin.com/dEqrkczy I added the sql table normally in phpmyadmin, the narration, the kill count is updating normally, but it doesn't appear in the player ranking! Player Ranking: PvP Statistic: Thanks in advance! Edited September 9, 2020 by Tdi123 Quote
0 Songbird Posted September 9, 2020 Posted September 9, 2020 This line... if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] I can't find any purpose for it, I recommend you to delete it. Check if script works well without it //Ghost's KDR Algorithm function script KDR_Calc { if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] if(getarg(0) >= getarg(1)){ if(getarg(1)){ set .@i, getarg(0)/getarg(1); if((getarg(0)%getarg(1)) == 0){ return .@i+".00"; } set .@j, (getarg(0)%getarg(1))*100/getarg(1); return .@i+"."+.@j; } else { return getarg(0)+".00"; } } if(getarg(0) < getarg(1)){ if(getarg(0)){ set .@i, (getarg(0)*10)/getarg(1); set .@j, ((getarg(0)*10)%getarg(1))*10/getarg(1); return "0."+.@i +.@j; } else { return "0.00"; } } } Quote
0 Tdi123 Posted September 10, 2020 Author Posted September 10, 2020 7 hours ago, Songbird said: This line... if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] I can't find any purpose for it, I recommend you to delete it. Check if script works well without it //Ghost's KDR Algorithm function script KDR_Calc { if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] if(getarg(0) >= getarg(1)){ if(getarg(1)){ set .@i, getarg(0)/getarg(1); if((getarg(0)%getarg(1)) == 0){ return .@i+".00"; } set .@j, (getarg(0)%getarg(1))*100/getarg(1); return .@i+"."+.@j; } else { return getarg(0)+".00"; } } if(getarg(0) < getarg(1)){ if(getarg(0)){ set .@i, (getarg(0)*10)/getarg(1); set .@j, ((getarg(0)*10)%getarg(1))*10/getarg(1); return "0."+.@i +.@j; } else { return "0.00"; } } } Without the function the emulator responds with the following error: With the function the emulator responds with the following error: But I found out that the table updates when the character logg off: But the following error appears: But you wanted the table to be updated in real time, would that be possible? Thanks in advance! Quote
0 IsabelaFernandez Posted September 10, 2020 Posted September 10, 2020 18 hours ago, Tdi123 said: Problem: Script: https://pastebin.com/RGxyWQup SQL Table: https://pastebin.com/dEqrkczy I added the sql table normally in phpmyadmin, the narration, the kill count is updating normally, but it doesn't appear in the player ranking! Player Ranking: PvP Statistic: Thanks in advance! hello friend, taking advantage of your post i would like to ask if apart from your problem with the ranking is the kill sound system working 100%? Quote
0 Tdi123 Posted September 10, 2020 Author Posted September 10, 2020 (edited) 5 hours ago, IsabelaFernandez said: hello friend, taking advantage of your post i would like to ask if apart from your problem with the ranking is the kill sound system working 100%? There are two problems with this script: 1° The ranking player 2° The amount of map that is allowed to do the kill count Example: To make the count of only 1 map, you must change the following line: setarray .PvPMap$[0], "guild_vs2", "pvp_y_1-1"; //List all pvp maps here (Index 0: "All" to enable all maps) Remembering that the pvp will only count the kills of the map: guild_vs2, second map is to make the system work, because if you put only 1 map, the system does not work. Example: setarray .PvPMap$[0], "guild_vs2"; //List all pvp maps here (Index 0: "All" to enable all maps) By default, it has been doing a kill count for all maps. I hope I answered your question! Edited September 10, 2020 by Tdi123 Quote
0 Songbird Posted September 10, 2020 Posted September 10, 2020 I didn't mean to remove the whole function, just this line: if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] Regarding your second question, I recommend you to call this event with "donpcevent ", for example, in your Arena PvP NPC you can write this line: prontera,158,193,3 script Arena PvP 801,{ donpcevent "Versus::OnPCLogoutEvent"; mes "[Loki]"; mes "What can I do for you today?"; switch(select("Player Ranking:PvP Statistic")){ case 1: //Player Ranking next; This way you're forcing to update when you talk with the NPC. Quote
0 Tdi123 Posted September 10, 2020 Author Posted September 10, 2020 (edited) 1 hour ago, Songbird said: I didn't mean to remove the whole function, just this line: if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] Regarding your second question, I recommend you to call this event with "donpcevent ", for example, in your Arena PvP NPC you can write this line: prontera,158,193,3 script Arena PvP 801,{ donpcevent "Versus::OnPCLogoutEvent"; mes "[Loki]"; mes "What can I do for you today?"; switch(select("Player Ranking:PvP Statistic")){ case 1: //Player Ranking next; This way you're forcing to update when you talk with the NPC. Quote prontera,158,193,3 script Arena PvP#ot 801,{ donpcevent "Versus::OnPCLogoutEvent"; Still nothing, the server still updates only when the character logs off, and now the emulator presents the following error: Edited September 10, 2020 by Tdi123 Quote
Question
Tdi123
Problem:
Script: https://pastebin.com/RGxyWQup
SQL Table: https://pastebin.com/dEqrkczy
I added the sql table normally in phpmyadmin, the narration, the kill count is updating normally, but it doesn't appear in the player ranking!
Player Ranking:
PvP Statistic:
Thanks in advance!
Edited by Tdi1236 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.