Raised This Month: $51 Target: $400
 12% 

Fps Shower Edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Porcay
Junior Member
Join Date: Sep 2018
Old 04-16-2020 , 14:54   Fps Shower Edit
Reply With Quote #1

Anyone can make these say messages:


- If player's fps is lower than 60 "^x04%s^x03 has^x04 %d^x03 FPS and a bad PC!"
- If player's fps is lower than 40 "^x04%s^x03 has^x04 %d^x03 FPS (someone buy this guy a new pc)"



Also, is it possible to make the messages for lang folder?



Please no misunderstanding, it's just for fun.



PHP Code:
/*

* rFPSometer:


* CVars:
*         rfps        1/0 // Enable/Disable rFPSometer.        Default: 1/on.
*         rfpsall        1/0 // Print rFPSometer MSG to all players?    Default: 1/on.
*         rfpsvisual    1/0 // Show/Hide /fps chat message?        Default: 1/on.

* Usage:
*         Type " /fps <nick/#userid> " in say.
*         Type " /rfps " 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 Counting by newbie.


* By: raggy
* Email: [email protected]
* HomePage: http://www.rayish.com
* IRC: #rayish @ QuakeNet

*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN_NAME        "rFPSometer"
#define PLUGIN_VERSION        "1.1.1"
#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_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SERVER|FCVAR_SPONLY);
    
    
g_irFPS        register_cvar("rfps",        "1");
    
g_irFPSAll    register_cvar("rfpsall",    "1");
    
g_irFPSVisual    register_cvar("rfpsvisual",    "1");
    
    
register_forward(FM_PlayerPreThink"fwdPlayerPreThink");
    
    
register_clcmd("say",            "sayHandle");
    
register_clcmd("say /rfps",        "cmdAboutrFPS");
    
register_clcmd("say_team /rfps",    "cmdAboutrFPS");
}

public 
fwdPlayerPreThink(id)
{
    if ( !
get_pcvar_num(g_irFPS) )
        return 
FMRES_IGNORED;
    
    static 
Float:fGameTimeFloat: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(szArgscharsmax(szArgs));
    
remove_quotes(szArgs);
    
trim(szArgs);
    
    if ( !
szArgs[0] )
        return 
PLUGIN_HANDLED;
    
    if ( 
szArgs[0] != '/' )
        return 
PLUGIN_CONTINUE;
    
    
    
//Command
    
new szTarget[32];
    
    
parse(szArgs,\
    
szArgscharsmax(szArgs),\
    
szTargetcharsmax(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(idid"Please^x04 wait %.0f seconds^x03 between commands!"fCommandDelay);
        return 
PLUGIN_HANDLED;
    }
    
//Delay
    
    
    //Display
    
trim(szTarget);
    
    if ( !
szTarget[0] )
        
fCommandUsed[id] = displayFPS(ididfCommandDelay);
    else {
        new 
targetId cmd_target(idszTarget2);
        
        if ( 
targetId )
            
fCommandUsed[id] = displayFPS(idtargetIdfCommandDelay);
        else {
            
printMessage(idid"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(idtargetIdFloat:fCommandDelay)  
{
    new 
szName[32];
    
get_user_name(targetIdszNamecharsmax(szName));
    
    new 
szMsg[192];
    
formatex(szMsgcharsmax(szMsg), "^x04%s^x03 has^x04 %d^x03 FPS"szNameg_iUserFPS[targetId]);
    
    
printMessage(idget_pcvar_num(g_irFPSAll) ? idszMsg);
    
    return 
get_gametime() + fCommandDelay;
}

public 
cmdAboutrFPS(id)
{
    
printMessage(idid"^x04%s^x03 Version^x04 %s^x03 By^x04 %s^x03 -> Status^x04 %s^x03 Command is^x04 %s"PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHORget_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(idtargetId, const sMsg[], any:...)
{
    new 
szMessage[192];
    
    
vformat(szMessagecharsmax(szMessage), sMsg4);
    
format(szMessagecharsmax(szMessage), "%c[rFPS] %s"COLORszMessage);
    
    static 
iSayText;
    
    if ( !
iSayText )
        
iSayText get_user_msgid("SayText");
    
    
message_begin(targetId MSG_ONE_UNRELIABLE MSG_BROADCASTiSayText, {000}, targetId);
    
write_byte(id);
    
write_string(szMessage);
    
message_end();


Last edited by Porcay; 04-16-2020 at 15:01.
Porcay is offline
Porcay
Junior Member
Join Date: Sep 2018
Old 04-17-2020 , 14:48   Re: Fps Shower Edit
Reply With Quote #2

anyone?
Porcay is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-17-2020 , 16:18   Re: Fps Shower Edit
Reply With Quote #3

Quote:
Originally Posted by Porcay View Post
anyone?
not in another 2 weeks
tarsisd2 is offline
Porcay
Junior Member
Join Date: Sep 2018
Old 04-17-2020 , 18:48   Re: Fps Shower Edit
Reply With Quote #4

Quote:
Originally Posted by tarsisd2 View Post
not in another 2 weeks
I think there's at least one scripter who has enough experince to make an edit like this so im tryin to make people see the post, i have to wait 2 week for a damn edit?
Porcay is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-17-2020 , 19:42   Re: Fps Shower Edit
Reply With Quote #5

Quote:
Originally Posted by Porcay View Post
I think there's at least one scripter who has enough experince to make an edit like this so im tryin to make people see the post, i have to wait 2 week for a damn edit?
No, you *unofficially* need to wait 2 weeks before bumping the thread.
Nobody here is getting paid to make plugins, so there's no point in getting mad over it.
__________________

Last edited by OciXCrom; 04-17-2020 at 19:44.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode