/fps command
#1

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.
Reply
#2

Check this thread: https://sampforum.blast.hk/showthread.php?tid=172085
Make the command with optional playerid parameter check sscanf, and use pFPS variable.
Reply
#3

This is a place to get help with your scripts or with scripting in general, not a place to request scripts.
Reply
#4

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
Reply
#5

Код:
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...
Reply
#6

works now /close this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)