/fps yazınca fps gösteren pluıgin
Moderatör: Moderatörler
-
Konu Sahibi - Mesajlar: 57
- Kayıt: Cum Oca 01, 2021 3:26 pm
- Konum: İstanbul | Bağcılar
- Server Ip/DNS: 213.238.171.52
/fps yazınca fps gösteren pluıgin
selamlar bi swde gördüm oyuncular /fps yazınca oyun chatine örnek : xXx : 250 fps yazıyor yani /fps yazanlar hem kendi fpslerini görüyor chatte hemde diğer kişiler görüyor biliyorsanız bu plugini atabilirmisiniz.
Link: | |
Linklerini gizle |
-
- Mesajlar: 124
- Kayıt: Çrş Ara 23, 2020 12:38 pm
/fps yazınca fps gösteren pluıgin
Kod: Tümünü seç
/*
*
* FPS:
*
*
* CVars:
* cfps 1/0 // Enable/Disable FPS. Default: 1/on.
* cfpsall 1/0 // Print FPS MSG to all players? Default: 1/on.
* cfpsvisual 1/0 // Show/Hide /fps chat message? Default: 1/on.
*
* Usage:
* Type " /fps <nick/#userid> " in say.
* Type " /cfps " in say/say_team for about plugin.
*
* Notes:
* To change delay between user /fps command, edit DELAY_COMMAND and recompile.
* This is engine FPS.
* Original FPS Code by newbie.
*/
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#define PLUGIN_NAME "FPS.Meter"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "raggy"
#pragma semicolon 1
#define DELAY_COUNT 1.0 //Delay between frame counts, adjust this according to server ticrate. MUST BE FLOAT
#define DELAY_COMMAND 5.0 //Delay between user /fps command. MUST BE FLOAT
#define COLOR 0x03 //0x01 normal, 0x04 green, 0x03 other. MUST BE CHAR
#define MAX_PLAYERS 32 + 1
new g_iUserFPS[MAX_PLAYERS];
new g_irFPS;
new g_irFPSAll;
new g_irFPSVisual;
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_cvar(PLUGIN_NAME, PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY);
g_irFPS = register_cvar("cfps", "1");
g_irFPSAll = register_cvar("cfpsall", "1");
g_irFPSVisual = register_cvar("cfpsvisual", "1");
register_forward(FM_PlayerPreThink, "fwdPlayerPreThink");
register_clcmd("say", "sayHandle");
register_clcmd("say /cfps", "cmdAboutrFPS");
register_clcmd("say_team /cfps", "cmdAboutrFPS");
}
public fwdPlayerPreThink(id)
{
if ( !get_pcvar_num(g_irFPS) )
return FMRES_IGNORED;
static Float:fGameTime, Float:fCountNext[MAX_PLAYERS], iCountFrames[MAX_PLAYERS];
if ( fCountNext[id] >= (fGameTime = get_gametime()) )
{
iCountFrames[id]++;
return FMRES_IGNORED;
}
g_iUserFPS[id] = iCountFrames[id];
iCountFrames[id] = 0;
fCountNext[id] = fGameTime + DELAY_COUNT;
return FMRES_IGNORED;
}
public sayHandle(id)
{
if ( !get_pcvar_num(g_irFPS) )
return PLUGIN_CONTINUE;
new szArgs[64];
read_args(szArgs, charsmax(szArgs));
remove_quotes(szArgs);
trim(szArgs);
if ( !szArgs[0] )
return PLUGIN_HANDLED;
if ( szArgs[0] != '/' )
return PLUGIN_CONTINUE;
//Command
new szTarget[32];
parse(szArgs,\
szArgs, charsmax(szArgs),\
szTarget, charsmax(szTarget));
if ( !equali(szArgs, "/fps", 4) )
return PLUGIN_CONTINUE;
//Command
//Delay
new Float:fCommandDelay = DELAY_COMMAND;
static Float:fCommandUsed[MAX_PLAYERS];
if ( fCommandUsed[id] > get_gametime() )
{
printMessage(id, id, "Please^x04 wait %.0f seconds^x03 between commands!", fCommandDelay);
return PLUGIN_HANDLED;
}
//Delay
//Display
trim(szTarget);
if ( !szTarget[0] )
fCommandUsed[id] = displayFPS(id, id, fCommandDelay);
else {
new targetId = cmd_target(id, szTarget, 2);
if ( targetId )
fCommandUsed[id] = displayFPS(id, targetId, fCommandDelay);
else {
printMessage(id, id, "There is no OR multiple players with that name ->^x04 %s", szTarget);
return PLUGIN_HANDLED;
}
}
//Display
return get_pcvar_num(g_irFPSVisual) ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
}
Float:displayFPS(id, targetId, Float:fCommandDelay)
{
new szName[32];
get_user_name(targetId, szName, charsmax(szName));
new szMsg[192];
formatex(szMsg, charsmax(szMsg), "^x04%s^x03 has^x04 %d^x03 FPS", szName, g_iUserFPS[targetId]);
printMessage(id, get_pcvar_num(g_irFPSAll) ? 0 : id, szMsg);
return get_gametime() + fCommandDelay;
}
public cmdAboutrFPS(id)
{
printMessage(id, id, "^x04%s^x03 Version^x04 %s^x03 By^x04 %s^x03 -> Status^x04 %s^x03 Command is^x04 %s", PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR, get_pcvar_num(g_irFPS) ? "enabled" : "disabled", get_pcvar_num(g_irFPSVisual) ? "not blocked" : "blocked");
return get_pcvar_num(g_irFPSVisual) ? PLUGIN_CONTINUE : PLUGIN_HANDLED;
}
printMessage(id, targetId, const sMsg[], any:...)
{
new szMessage[192];
vformat(szMessage, charsmax(szMessage), sMsg, 4);
format(szMessage, charsmax(szMessage), "%c[FPS] %s", COLOR, szMessage);
static iSayText;
if ( !iSayText )
iSayText = get_user_msgid("SayText");
message_begin(targetId ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, iSayText, {0, 0, 0}, targetId);
write_byte(id);
write_string(szMessage);
message_end();
}
Link: | |
Linklerini gizle |
-
Konu Sahibi - Mesajlar: 57
- Kayıt: Cum Oca 01, 2021 3:26 pm
- Konum: İstanbul | Bağcılar
- Server Ip/DNS: 213.238.171.52
-
- Mesajlar: 124
- Kayıt: Çrş Ara 23, 2020 12:38 pm
/fps yazınca fps gösteren pluıgin
Sma olarak sitede yoktu. Sma ya da çevirirsin ya zor değil.
Link: | |
Linklerini gizle |