Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function averageping(%t){
- schedule(0,0,$pinginuse = 1);
- schedule(0,0,$ping1 = %t.getPing());
- schedule(250,0,$ping2 = %t.getPing());
- schedule(500,0,$ping3 = %t.getPing());
- schedule(750,0,$ping4 = %t.getPing());
- schedule(1000,0,$ping5 = %t.getPing());
- schedule(1250,0,$ping6 = %t.getPing());
- schedule(1500,0,$ping7 = %t.getPing());
- schedule(1750,0,$ping8 = %t.getPing());
- schedule(2000,0,$ping9 = %t.getPing());
- schedule(2250,0,$ping10 = %t.getPing());
- schedule(2500,0,$ping11 = %t.getPing());
- schedule(2750,0,$ping12 = %t.getPing());
- $theping = $ping1 + $ping2 + $ping3 + $ping4 + $ping5 + $ping6 + $ping7 + $ping8 + $ping9 + $ping10 + $ping11 + $ping12 / 12;
- schedule(3000,0,$pinginuse = 0);
- }
- function pingmessage(%c){
- messageClient(%c,'',"\c4" @ fcbn(%t).name @ "'s \c6ping is \c3about " @ $theping @ ".");
- }
- Show's the player's ping.
- function servercmdping(%c,%t){
- if(isObject(fcbn(%t).player) && $pinginuse == 0){
- averageping(fcbn(%t));
- messageClient(%c,'',"Please wait, gathering ping average...");
- schedule(3000,0,pingmessage(%c));
- echo(%c.name @ " wanted to know what " @ fcbn(%t).name @ "'s ping was.");
- }
- if(!isObject(fcbn(%t).player)){
- messageClient(%c,'',"This player doesn't exist!");
- }
- if($pinginuse == 1){
- messageclient(%c,'',"Someone else is using /ping, please wait.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment