Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » [Plug-in] SSGM2.02 Ping Plugin  () 1 Vote
Re: [Plug-in] SSGM2.02 Ping Plugin [message #439290 is a reply to message #381102] Fri, 12 November 2010 00:41 Go to previous messageGo to previous message
Xpert is currently offline  Xpert
Messages: 1588
Registered: December 2005
Location: New York City
Karma:
General (1 Star)
This is an old bump, I know, but I was browsing the forums to see if there's anything I can make use for myself and I came across this. So I decided to show mine, I'll paste it. Maybe if Exeric still browse these forums, you can make use of it too? You don't have to put the whole player's name.


class ConnectionChatCommand : public ChatCommandClass {
 	void Triggered(int ID,const TokenClass &Text,int ChatType) {
		if (!Text[1].empty()) {
			GameObject *obj;
			std::string name = Text[1].c_str();
			std::string sender = Get_Player_Name_By_ID(ID);
			int amount = 0;
			amount = Get_Part_Names(name.c_str());
			if (amount == 1) {
				obj = Get_Part_Name(name.c_str());
				int PID = Get_Player_ID(obj);
				name = Get_Player_Name(obj);
				if (ID != PID) {
					Console_Input(StrFormat("ppage %d Connection for %s -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID,name.c_str(),Get_Ping(PID),Get_Kbits(PID),Get_Bandwidth(PID)).c_str());
				}
				else {
					Console_Input(StrFormat("ppage %d Your connection -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID,Get_Ping(ID),Get_Kbits(ID),Get_Bandwidth(ID)).c_str());
				}
			}
			else if (amount == 0) {
				Console_Input(StrFormat("ppage %d Player not found.",ID).c_str());
				return;
			}
			else if (amount > 1) {
				obj = Get_GameObj_By_Player_Name(name.c_str());
				if (!obj) {
					Console_Input(StrFormat("ppage %d There are %i players with that substring, please make the name more unique.",ID,amount).c_str());
					return;
				}
			}
		}
		else {
			Console_Input(StrFormat("ppage %d Your connection -> Ping: %d; Kbits: %d; Used bandwidth: %d;",ID, Get_Ping(ID), Get_Kbits(ID), Get_Bandwidth(ID)).c_str());
		}
	}
};
ChatCommandRegistrant<ConnectionChatCommand> ConnectionChatCommandReg("!ping;!lag",CHATTYPE_ALL,0,GAMEMODE_ALL);


http://i32.photobucket.com/albums/d42/XpertMaverick/xpertyankee.jpg

Creator of NetGuard, an IRC network regulator.
Developer of the CloudyServ 0.982-X project.
Developer of the CloudyServ Ren-X bot.

Part time streamer - https://twitch.tv/gg_wonder
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [skin] Skittles Stealth Effect
Next Topic: [Skins] Duke 3D doors
Goto Forum:
  


Current Time: Wed Aug 21 17:46:55 MST 2024

Total time taken to generate the page: 0.00901 seconds