05.12.2017, 19:56
Quote:
Tenho dois mйtodos, porem o primeiro nгo tenho certeza se ira funcionar.
|
mas vlw pelo comentбrio, eu quero algo automбtico.
Como ngm me ajudou acho que vou usar isso aqui mesmo, mas nгo sei se vai funcionar 100 %
Code:
public OnPlayerUpdate(playerid) { if(!IsPlayerNPC(playerid)) { new szString[144], Float:Pocket, Nome[24]; GetPlayerPacketloss(playerid,Pocket); if(Pocket >= 10.0) { PacketAltoAvisos[playerid] ++; if(PacketAltoAvisos[playerid] >= 30) { GetPlayerName(playerid, Nome, 24); format(szString, sizeof(szString), "[Aviso]: %s(id:%d) Possнvelmente estб de RT - Packet Loss:%0.1f", Nome, playerid, Pocket); SendClientMessageToAll(-1, szString); } } else PacketAltoAvisos[playerid] = 0; } return 1; } stock GetPlayerPacketloss(playerid,&Float:packetloss) { /* Returns the packetloss percentage of the given playerid - Made by Fusez */ if(!IsPlayerConnected(playerid)) return 0; new nstats[400+1], nstats_loss[20], start, end; GetPlayerNetworkStats(playerid, nstats, sizeof(nstats)); start = strfind(nstats,"packetloss",true); end = strfind(nstats,"%",true,start); strmid(nstats_loss, nstats, start+12, end, sizeof(nstats_loss)); packetloss = floatstr(nstats_loss); return 1; }