Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <engine>
- #define PLUGIN "Players Fps Shower by xflane first plugin by f0rce"
- #define VERSION "1.0"
- #define AUTHOR "xflane first plugin by f0rce"
- #define Tag "AMXX"
- new iCount[ 33 ]
- new idFps[ 33 ]
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say /fps","showmenu")
- set_task(300.0, "AMSG",_,_,_, "b");
- register_clcmd("say","SayCmd")
- }
- public AMSG(){
- ColorChat(0,"This Server Using Players Fps Shower Type /fps!");
- }
- public SayCmd(id)
- {
- new Message[192], Cmd[33], Amount[33], HisName[33];
- read_args(Message, 191);
- remove_quotes(Message);
- parse(Message, Cmd, 32, HisName, 32, Amount, 32);
- if(equali(Cmd, "/fps") )
- {
- new player = cmd_target(player, HisName, 8)
- if (player)
- {
- ColorChat(id,"%s ^3FPS : ^4%i",GetUserName(player),idFps[player]);
- }
- }
- }
- public client_PostThink( id )
- {
- iCount[ id ]++;
- static LastEndTime[ 33 ]
- if( floatround( get_gametime( ) ) == LastEndTime[ id ] )
- return;
- LastEndTime[ id ] = floatround( get_gametime( ) );
- idFps[ id ] = iCount[ id ];
- iCount[ id ] = 0;
- }
- public showmenu( id )
- {
- new nitems[100]
- formatex(nitems,99, "\r[\y %s \r]\w Players Fps Shower^n\dVersion 1.3.4",Tag)
- new menu = menu_create(nitems, "submenu" );
- new players[ 32 ], pnum, tempid;
- new szName[ 32 ], szTempid[ 10 ];
- get_players( players, pnum, "" );
- for( new i; i< pnum; i++ )
- {
- tempid = players[ i ];
- get_user_name( tempid, szName, 31 );
- num_to_str( tempid, szTempid, 9 );
- new nitem[100]
- formatex(nitem,99, "%s \rFPS : \y%i",szName,idFps[tempid])
- menu_additem( menu, nitem, nitem, 0 );
- }
- menu_display( id, menu );
- return PLUGIN_HANDLED;
- }
- public submenu( id, Menu, item )
- {
- if( item == MENU_EXIT )
- {
- menu_destroy( Menu );
- return PLUGIN_HANDLED;
- }
- menu_destroy( Menu );
- showmenu(id);
- return PLUGIN_HANDLED;
- }
- stock GetUserName( const Index )
- {
- static gName[ 32 ];
- get_user_name( Index, gName, charsmax( gName ) );
- return gName;
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...) {
- new msg[191], players[32], count = 1;
- static len; len = formatex(msg, charsmax(msg), "^4[ ^3%s^4 ]^1 ",Tag);
- vformat(msg[len], charsmax(msg) - len, string, 3);
- if(id) players[0] = id;
- else get_players(players,count,"ch");
- for (new i = 0; i < count; i++)
- {
- if(is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement