05.01.2015, 19:48
pawn Код:
new Ping;
Ping = GetPlayerPing(playerid)*NetStats_PacketLossPercent(playerid);
new Ping;
Ping = GetPlayerPing(playerid)*NetStats_PacketLossPercent(playerid);
NetStats_PacketLossPercent(playerid); is a float.
You have to convert to integer or vice-versa. https://sampwiki.blast.hk/wiki/Float https://sampwiki.blast.hk/wiki/Floatround |
new Float:Ping;
Ping = GetPlayerPing(playerid)*NetStats_PacketLossPercent(playerid);
new
colorPING,
Ping = GetPlayerPing(playerid),
Float:Packet = NetStats_PacketLossPercent(playerid),
Delay
;
drunknew = GetPlayerDrunkLevel(playerid);
Delay = Ping*Packet;
//------------[CHECK PING]-----------------
// if(NetStats_PacketLossPercent(playerid) >= 0.0 && NetStats_PacketLossPercent(playerid) <= 0.5){
if(0 > Delay < 190 ) {
colorPING = 0x00FF00FF;
TextDrawSetString(TextdrawPingMStats[playerid], "STABLE"); }
// else if(0.5 < NetStats_PacketLossPercent(playerid) <= 0.9) {
else if(190 < Delay < 230) {
colorPING = 0xFFFF00FF;
TextDrawSetString(TextdrawPingMStats[playerid], "NORMAL");}
else {
colorPING = 0xFF0000FF;
TextDrawSetString(TextdrawPingMStats[playerid], "LAGGING");}
TextDrawColor(TextdrawPingMStats[playerid], colorPING);
TextDrawShowForPlayer(playerid, TextdrawPingMStats[playerid]);
new Float:Delay = floatmul(float(GetPlayerPing(playerid)), NetStats_PacketLossPercent(playerid));
if(0 > Delay < 190 ) {