My FPS command.
#6

It didn't work, I got few errors.

Код:
CMD:fps(playerid, params[])
{
   new
	    Float:fps = float(drunklvl_difference) / (float(timepassed_in_ms) / 1000.0),
		target,
		str[64],
		PlayerName[MAX_PLAYER_NAME];

   GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   
   fps = GetPlayerDrunkLevel(target);

   if(fps < 100) {
	  SetPlayerDrunkLevel(target, 2000);
   } else {

		if (gDrunkLevelLast[target] != fps) {

			new gfps = gDrunkLevelLast[playerid] - fps;

			if ((gfps > 0) && (gfps < 200))
				   gFPS[target] = gfps;


	   	    gDrunkLevelLast[playerid] = fps;

	  }
   }
   if (
   sscanf (
   params,
   "u", target)) target = playerid;

   format(str,sizeof(str), "SERVER: %s's fps is %d", PlayerName, gFPS[target]);
   
   SendClientMessage(playerid, -1, str);

   return true;
}
Код:
C:\Users\yan\Desktop\Battlegrounds\gamemodes\bg.pwn(401) : error 017: undefined symbol "drunklvl_difference"
C:\Users\yan\Desktop\Battlegrounds\gamemodes\bg.pwn(416) : warning 213: tag mismatch
C:\Users\yan\Desktop\Battlegrounds\gamemodes\bg.pwn(422) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
401:
Код:
Float:fps = float(drunklvl_difference) / (float(timepassed_in_ms) / 1000.0),
416:
Код:
new gfps = gDrunkLevelLast[playerid] - fps;
422:
Код:
gDrunkLevelLast[playerid] = fps;
If i remove your code it complies perfect.
Reply


Messages In This Thread
My FPS command. - by ivndosos - 12.03.2018, 21:10
Re: My FPS command. - by ivndosos - 13.03.2018, 09:57
Re: My FPS command. - by Kane - 13.03.2018, 10:02
Re: My FPS command. - by ivndosos - 13.03.2018, 10:36
Re: My FPS command. - by NaS - 13.03.2018, 18:00
Re: My FPS command. - by ivndosos - 15.03.2018, 12:10
Re: My FPS command. - by NaS - 15.03.2018, 12:35

Forum Jump:


Users browsing this thread: 1 Guest(s)