SA-MP Forums Archive
warning tag mismatch - 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: warning tag mismatch (/showthread.php?tid=554943)



warning tag mismatch - Cerealguy - 05.01.2015

pawn Код:
new Ping;

Ping = GetPlayerPing(playerid)*NetStats_PacketLossPercent(playerid);
? S:


Re: warning tag mismatch - Divergent - 05.01.2015

Hmm. I've never worked with that function, but maybe try something like this?

new ping = GetPlayerPing(playerid);
new packetLoss = NetStats_PacketLossPercent(playerid);

new whatever = ping*packetLoss;

If not, post the actual error code.


Re: warning tag mismatch - Larceny - 05.01.2015

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


Respuesta: warning tag mismatch - Cerealguy - 05.01.2015

Same error...


Re: warning tag mismatch - Larceny - 05.01.2015

Show your code.


Re: warning tag mismatch - xVIP3Rx - 05.01.2015

Quote:
Originally Posted by Larceny
Посмотреть сообщение
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
As Larceny said, Like this
pawn Код:
new Float:Ping;
Ping = GetPlayerPing(playerid)*NetStats_PacketLossPercent(playerid);



Respuesta: warning tag mismatch - Cerealguy - 05.01.2015

no work, do not get the error but the ping goes: 10048451520

ping no is float , i need this:

Example: Ping : 190 and Packetloss is 0.4 ... 190*0.4


Re: warning tag mismatch - Beckett - 05.01.2015

Show what you did.


Respuesta: warning tag mismatch - Cerealguy - 05.01.2015

pawn Код:
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]);



Re: warning tag mismatch - Larceny - 05.01.2015

pawn Код:
new Float:Delay = floatmul(float(GetPlayerPing(playerid)), NetStats_PacketLossPercent(playerid));
Btw:

Код:
if(0 > Delay < 190 ) {
Delay will never be negative.