-
Notifications
You must be signed in to change notification settings - Fork 1
/
TextDraw-FPS.pwn
105 lines (97 loc) · 3.63 KB
/
TextDraw-FPS.pwn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* Filterscript TextDraw FPS
© [2024] [Calasans]. Todos os direitos reservados.
Discord: ocalasans
Youtube: Calasans
Instagram: ocalasans
SA:MP Programming Comunnity©: https://abre.ai/samp-spc
*/
#define FILTERSCRIPT
//
#include <a_samp>
//
main(){}
//
#define TFF_function:%0(%1) forward %0(%1);\
public %0(%1)
//
static TFF_cronometro[MAX_PLAYERS],
PlayerText:TFF_text_fps[MAX_PLAYERS];
//
stock TFF_obter_fps(playerid)
{
SetPVarInt(playerid, "TFF_drunk", GetPlayerDrunkLevel(playerid));
//
if(GetPVarInt(playerid, "TFF_drunk") <= 100)
SetPlayerDrunkLevel(playerid, 2000);
//
else
{
if(GetPVarInt(playerid, "TFF_drunk_ii") != GetPVarInt(playerid, "TFF_drunk"))
{
new TFF_obter = GetPVarInt(playerid, "TFF_drunk_ii") - GetPVarInt(playerid, "TFF_drunk");
//
if((TFF_obter >= 1) && (TFF_obter <= 300))
SetPVarInt(playerid, "TFF_fps", TFF_obter);
//
SetPVarInt(playerid, "TFF_drunk_ii", GetPVarInt(playerid, "TFF_drunk"));
}
return GetPVarInt(playerid, "TFF_fps");
}
//
return false;
}
TFF_function:TFF_timer_fps(playerid)
{
new TFF_string[10];
//
format(TFF_string, sizeof(TFF_string), "FPS: %d", TFF_obter_fps(playerid));
PlayerTextDrawSetString(playerid, TFF_text_fps[playerid], TFF_string);
//
return true;
}
public OnFilterScriptInit()
{
print(" ");
print("__________________________________________________________________");
print("||==============================================================||");
print("|| ||");
print("|| Filterscript TextDraw FPS ||");
print("|| ||");
print("|| By: Calasans ||");
print("|| Discord: abre.ai/samp-spc ||");
print("|| ||");
print("||==============================================================||");
print("__________________________________________________________________");
print(" ");
//
return true;
}
public OnPlayerConnect(playerid)
{
TFF_text_fps[playerid] = CreatePlayerTextDraw(playerid, 1.000000, 137.000000, "FPS: 0");
PlayerTextDrawBackgroundColor(playerid, TFF_text_fps[playerid], 255);
PlayerTextDrawFont(playerid, TFF_text_fps[playerid], 1);
PlayerTextDrawLetterSize(playerid, TFF_text_fps[playerid], 0.140000, 0.799998);
PlayerTextDrawColor(playerid, TFF_text_fps[playerid], 0xB4B5B7FF);
PlayerTextDrawSetOutline(playerid, TFF_text_fps[playerid], 0);
PlayerTextDrawSetProportional(playerid, TFF_text_fps[playerid], 1);
PlayerTextDrawSetShadow(playerid, TFF_text_fps[playerid], 1);
PlayerTextDrawUseBox(playerid, TFF_text_fps[playerid], 1);
PlayerTextDrawBoxColor(playerid, TFF_text_fps[playerid], 255);
PlayerTextDrawTextSize(playerid, TFF_text_fps[playerid], 23.000000, -311.000000);
PlayerTextDrawSetSelectable(playerid, TFF_text_fps[playerid], 0);
//
PlayerTextDrawShow(playerid, TFF_text_fps[playerid]);
//
TFF_cronometro[playerid] = SetTimerEx("TFF_timer_fps", 0, true, "i", playerid);
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(TFF_cronometro[playerid]);
//
PlayerTextDrawHide(playerid, TFF_text_fps[playerid]);
//
return true;
}