/fps command - 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: /fps command (
/showthread.php?tid=562218)
/fps command -
Airman123 - 07.02.2015
Hello, i need a /fps command. I saw there is thread which shows "textdraw" at bottom of screen near map but i don't need that.
Can some one make me a simple fps command, which shows Target fps.
e.g i type /fps xx (playername)
output: xx's current fps is : 36
Also i want if i only type /fps without any ID it should show my fps instead of showing USAGE.
Thanks in advance.
Re: /fps command -
MicroD - 07.02.2015
Check this thread:
https://sampforum.blast.hk/showthread.php?tid=172085
Make the command with optional playerid parameter check sscanf, and use pFPS variable.
Re: /fps command -
CalvinC - 07.02.2015
This is a place to get help with your scripts or with scripting in general, not a place to request scripts.
Re: /fps command -
Puppy - 07.02.2015
You can get the player's rough FPS using drunk levels.
Quote:
Originally Posted by Jernelj
new pDrunkLevelLast[MAX_PLAYERS];
new pFPS[MAX_PLAYERS];
public OnPlayerConnect(playerid) {
pDrunkLevelLast[playerid] = 0;
pFPS[PlayerID] = 0;
}
public OnPlayerUpdate(playerid) {
// handle fps counters.
new drunknew;
drunknew = GetPlayerDrunkLevel(playerid);
if (drunknew < 100) { // go back up, keep cycling.
SetPlayerDrunkLevel(playerid, 2000);
} else {
if (pDrunkLevelLast[playerid] != drunknew) {
new wfps = pDrunkLevelLast[playerid] - drunknew;
if ((wfps > 0) && (wfps < 200))
pFPS[playerid] = wfps;
pDrunkLevelLast[playerid] = drunknew;
}
}
}
|
Source:
https://sampforum.blast.hk/showthread.php?tid=172085
Re: /fps command -
Airman123 - 07.02.2015
Код:
COMMAND:fps(playerid,params[])
{
if(sscanf(params, "u", TargetID))
{
SendClientMessage(playerid, COLOR_RED, "USAGE: /fps (nick/id) - Enter a valid Nick / ID");
return 1;
}
new string[128];
format(string, sizeof(string), "%s (%d) Fps is: %d", PlayerName(TargetID), TargetID, pFPS);
SendClientMessage(playerid, COLOR_HOTPINK, string);
return 1;
}
i made this but it shows 1 fps not changes...
Re: /fps command -
Airman123 - 07.02.2015
works now /close this