Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////////////////////////////////////////////////////
- // Creditos: //
- // By Adoniiz/AdonisxD, JerneiL y the_chaoz por darme la idea de su inc, callbackz.//
- /////////////////////////////////////////////////////////////////////////////////////
- #include <a_samp>
- #pragma tabsize 0
- #define Blanco 0xFFFFFFFF
- #define Rojo 0xFF0000FF
- new VerFPS[MAX_PLAYERS];
- new VarFPS;
- new pDrunkLevelLast[MAX_PLAYERS];
- new pFPS[MAX_PLAYERS];
- new Text:FPS[MAX_PLAYERS];
- forward ActFPS(playerid);
- public OnFilterScriptInit()
- {
- print("\n\n -------------------------------");
- print(" | FPS 0.1 By Adoniiz/AdonisxD |");
- print(" -------------------------------\n");
- for(new playerid = 0; playerid < GetMaxPlayers(); playerid ++)
- {
- FPS[playerid] = TextDrawCreate(596.000000, 0.000000, "_");
- TextDrawBackgroundColor(FPS[playerid], 255);
- TextDrawFont(FPS[playerid], 3);
- TextDrawLetterSize(FPS[playerid], 0.669999, 1.900000);
- TextDrawColor(FPS[playerid], -65281);
- TextDrawSetOutline(FPS[playerid], 0);
- TextDrawSetProportional(FPS[playerid], 1);
- TextDrawSetShadow(FPS[playerid], 1);
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n\n--------------------------");
- print("FPS 0.1 By Adoniiz/AdonisxD");
- print("--------------------------\n");
- }
- public OnPlayerConnect(playerid)
- {
- VerFPS[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- VerFPS[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/fps", true) || !strcmp(cmdtext, "/verfps", true))
- {
- if(VerFPS[playerid] == 0)
- {
- VarFPS = SetTimerEx("ActFPS", 500, true, "i",playerid);
- SendClientMessage(playerid, Blanco, "{0094FF}[>] {FFFFFF}Has activado los FPS, para verlos mira arriba en la parte superior derecha y veras unas numeros {FFD800}amarillos");
- VerFPS[playerid] = 1;
- }
- else if(VerFPS[playerid] == 1)
- {
- KillTimer(VarFPS);
- VerFPS[playerid] = 0;
- TextDrawHideForPlayer(playerid, FPS[playerid]);
- SendClientMessage(playerid, Rojo,"Has desactivado los FPS");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerUpdate(playerid)
- {
- 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;
- }
- }
- return 1;
- }
- public ActFPS(playerid)
- {
- new string[128];
- format(string, sizeof(string), "%i",GetPlayerFPS(playerid));
- TextDrawSetString(FPS[playerid], string);
- TextDrawShowForPlayer(playerid, FPS[playerid]);
- return 1;
- }
- stock GetPlayerFPS(playerid) return pFPS[playerid];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement