Jump to content
  • 0

Problem updating the player ranking, Ghost's PvP System v1.3!


Tdi123

Question


  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

Problem:

1453045662_Semttulo.png.0144eb78e22c9b21c3c1c1f00e19a32c.png

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:

1804914608_Semttulo.png.d52fcd521b81bbd1dbb909623e5ee273.png

PvP Statistic:

1602684936_Semttulo.png.bb0530eada80f1995558dfdff65a9228.png

 

Thanks in advance!

Edited by Tdi123
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   7
  • Joined:  08/05/16
  • Last Seen:  

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";
	}
 }
}
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

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:

1.png.9d1578465b750ba64c8e0c7cbb98be83.png

With the function the emulator responds with the following error:

2.png.98c9d9c8fb11367c44b14c921fdf1b27.png

But I found out that the table updates when the character logg off:

1643737859_Semttulo.png.7a5d0c46323c3c337157afa1bd3bdc4f.png

But the following error appears:

3.png.261c9150948a5c4299fa88e7fda940e9.png

But you wanted the table to be updated in real time, would that be possible?

Thanks in advance!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.07
  • Content Count:  354
  • Reputation:   8
  • Joined:  04/16/18
  • Last Seen:  

18 hours ago, Tdi123 said:

Problem:

1453045662_Semttulo.png.0144eb78e22c9b21c3c1c1f00e19a32c.png

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:

1804914608_Semttulo.png.d52fcd521b81bbd1dbb909623e5ee273.png

PvP Statistic:

1602684936_Semttulo.png.bb0530eada80f1995558dfdff65a9228.png

 

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%?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

 

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 by Tdi123
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   7
  • Joined:  08/05/16
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  92
  • Topics Per Day:  0.04
  • Content Count:  192
  • Reputation:   3
  • Joined:  12/12/17
  • Last Seen:  

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:

629764459_Semttulo.png.cac97657e0b59affc160c9ee2d1a5fcb.png

Edited by Tdi123
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

×
×
  • Create New...