local variable "len" shadows a variable at a preceding level
#1

Hello,

I'm having a little weird problem, I don't really know what's wrong, I saw someone said change the stock name.

I did it, nothing happened.

Here is the code:

PHP код:
stock Float:GetPlayerPacketLossFromServer(playerid)
{
  new 
stats[401], stringstats[70];
  
GetPlayerNetworkStats(playeridstatssizeof(stats));
  new 
len strfind(stats"PacketLoss: ");
  new 
Float:packetloss 0.0;
  if(
len != -1)
  {
      
strmid(stringstatsstatslenstrlen(stats));
      new 
len strfind(stats"Packetloss: "); <<<<<<<Line
      if(len != -1)
      {
         strdel(stats, 0, strlen(stats));
         strmid(stringstats, stats, len, strlen(stats));
         packetloss = floatstr(stats);
      }
  }
  return packetloss;

Reply


Messages In This Thread
local variable "len" shadows a variable at a preceding level - by Glossy42O - 03.02.2015, 05:48
Re: local variable "len" shadows a variable at a preceding level - by CalvinC - 03.02.2015, 05:58
Re: local variable "len" shadows a variable at a preceding level - by Glossy42O - 03.02.2015, 06:10

Forum Jump:


Users browsing this thread: 1 Guest(s)