SA-MP Forums Archive
Question ( Once again :p ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question ( Once again :p ) (/showthread.php?tid=494067)



Question ( Once again :p ) - Kyance - 11.02.2014

Is there a way to detect the SERVERS ping?


Re: Question ( Once again :p ) - LeGGGeNNdA - 11.02.2014

You mean this?


Re: Question ( Once again :p ) - Kyance - 11.02.2014

Eh, yeah, but via a script or something xd


Re: Question ( Once again :p ) - PrivatioBoni - 11.02.2014

There is a GetPlayerPing function. Read more about it here: https://sampwiki.blast.hk/wiki/GetPlayerPing

Good luck!


Re: Question ( Once again :p ) - Kyance - 11.02.2014

Quote:
Originally Posted by PrivatioBoni
Посмотреть сообщение
There is a GetPlayerPing function. Read more about it here: https://sampwiki.blast.hk/wiki/GetPlayerPing

Good luck!
I'm talking about the server ping, not a players ping.

What I'm trying to do, is;
pawn Код:
if(/*Function or w.e to get servers ping*/ >= 350)
{
    //Restart server script here
    return 1;
}
or w.e


Re: Question ( Once again :p ) - ProjectMan - 11.02.2014

What are you asking is similar to going to cmd prompt, and typing "ping 127.0.0.1". Your ping is ~1. You need to understand what ping is before understanding what you are trying to do here.


Re: Question ( Once again :p ) - Cole_William - 11.02.2014

I don't think you can retrieve the ping from the server directly, i think you can only get player ping.


Re: Question ( Once again :p ) - Kirollos - 11.02.2014

What do you mean with ping of the server?

The ping that is shown in the server browser is the ping of the player that is going to connect anyway.


Re: Question ( Once again :p ) - Kyance - 11.02.2014

Okay i got it ;__;


Re: Question ( Once again :p ) - iZN - 11.02.2014

0.3z RC5: - Added pawn native GetServerTickRate() to return the current tickrate (like FPS) of the server.

I am not confirmed though if it really works like that. Also, the server OWN ping would be obviously 1-10.