GetPlayerFps? FPS above head? - 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: GetPlayerFps? FPS above head? (
/showthread.php?tid=463890)
GetPlayerFps? FPS above head? -
Jason_Roul - 14.09.2013
How would I be off doing that? I heard people using drunklevel or something like that but I don't get what they're actually doing. Would someone be willing to help?
Thanks!
Re: GetPlayerFps? FPS above head? -
doreto - 14.09.2013
Here and for godsake search next time
Re: GetPlayerFps? FPS above head? -
Jason_Roul - 14.09.2013
Don't get so offensive.. I've already done that and that's why I found something about drunklevel but it's 0.3b
Re: GetPlayerFps? FPS above head? -
Grimrandomer - 14.09.2013
I have re-written some code by [XST]O_x (
https://sampforum.blast.hk/showthread.php?tid=172202) so that it uses 3DText's
pawn Код:
#include <a_samp>
new 3DText:fpsText[MAX_PLAYERS];
new DLlast[MAX_PLAYERS] = 0;
new FPS2[MAX_PLAYERS] = 0;
new string[64];
public OnFilterScriptInit() {
SetTimer("FPSUP",1203,true);
return 1;
}
public OnPlayerUpdate(playerid) {
new drunk2 = GetPlayerDrunkLevel(playerid);
if(drunk2 < 100) {
SetPlayerDrunkLevel(playerid,2000);
} else {
if(DLlast[playerid] != drunk2) {
new fps = DLlast[playerid] - drunk2;
if((fps > 0) && (fps < 200)) {
FPS2[playerid] = fps;
DLlast[playerid] = drunk2;
}
}
}
}
public OnPlayerSpawn(playerid) {
Attach3DTextLabelToPlayer(fpsText[playerid], playerid, 0.0, 0.0, 0.7);
return 1;
}
public OnPlayerConnect(playerid) {
fpsText[i] = Create3DTextLabel("FPS: 30",0xFFFFFFFF,0.0,0.0,0.0,10.0);
return 1;
}
public OnPlayerDisconnect(playerid) {
Delete3DTextLabel(fpsText[playerid]);
return 1;
}
forward FPSUP();
public FPSUP() {
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
format(string,sizeof(string),"FPS: %d",FPS2[i]-1);
Update3DTextLabelText(fpsText[i],0xFFFFFFFF,string);
}
continue;
}
}
Its untested by the way, and in [XST]O_x's post he says it only works on 0.3b so if it will work with 0.3x i have no clue.
Edit:
By the way, when testing, you wont see your own FPS above your head, only that of others.
Re: GetPlayerFps? FPS above head? -
Jason_Roul - 14.09.2013
I see, thanks alot for hinting that out for me and I will be checking it today!