Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › MultiPlayer Game Hacks & Cheats › Call of Duty Hacks & Cheats › Call of Duty 6 - Modern Warfare 2 (MW2) Hacks › Call of Duty Modern Warfare 2 Server / GSC Modding › Call of Duty Modern Warfare 2 GSC Modding Help/Discussion › how can i getting player ping

how can i getting player ping

Posts 1–15 of 18 · Page 1 of 2
SH
shailm_85
how can i getting player ping
hi guys,

1.
can u tell me how to get player's ping (latency)
or Self ping.

2.
how can i make console commands
eg. when i costume command in the console say

changenextgame "mp_rust" "sd"

it should run my function in my mod
i.e.
changenextgame(nextmap, nexttype)
{
setDvar("sv_maprotation", "gametype " + nextmap + " map " + nexttype + " " + getDvar("sv_maprotation"));
}

Regards
#1 · 15y ago
Boon Pek
Boon Pek
1) You can't get a players ping via a function, as I know.

2) Custom functions won't be recognized by the console. What you can do though is make a function that reads the custom variable and set the other one manually, if you get what I mean
#2 · 15y ago
master131
[MPGH]master131
Boon Pek is right, it's not possible.
#3 · 15y ago
jimmynguyen3030
jimmynguyen3030
i thought it was like " + self.ping + "
#4 · 15y ago
master131
[MPGH]master131
Quote Originally Posted by jimmynguyen3030 View Post
i thought it was like " + self.ping + "
epic fail.
#5 · 15y ago
jimmynguyen3030
jimmynguyen3030
Quote Originally Posted by master131 View Post
epic fail.
lol hahaha

cuz self.GUID works self.maxhealth works self.name works so...
#6 · 15y ago
SH
shailm_85
Quote Originally Posted by Boon Pek View Post
1) You can't get a players ping via a function, as I know.

2) Custom functions won't be recognized by the console. What you can do though is make a function that reads the custom variable and set the other one manually, if you get what I mean
Thanks for replying

but
1) can u tell me the function name to get the ping

2) how do i declare custom variable
level.nextmap = "mp_rust" (didnt work)
or self.nextmap = "mp_rust"
or some other
#7 · 15y ago
Boon Pek
Boon Pek
1) there is not a function (in game func, ofc) to get a player's ping.
2) level.nextmap does indeed set a custom variable a global variable called nextmap
#8 · 15y ago
SH
shailm_85
Quote Originally Posted by Boon Pek View Post
1) there is not a function (in game func, ofc) to get a player's ping.
2) level.nextmap does indeed set a custom variable a global variable called nextmap
1) so ther any way i can get player ping to my mod

2) level.nextmap is not accessible from console
i mean a like Dvar g_gametype "war"
How can Create a Dvar which is accessible from console

Regards.
#9 · 15y ago
Arasonic
Arasonic
If I remember right, it has something with
setDvarIfUnitialized("", );

Can't really remember.
#10 · 15y ago
SH
shailm_85
Quote Originally Posted by Arasonic View Post
If I remember right, it has something with
setDvarIfUnitialized("", );

Can't really remember.
Not working
tryed
setDvarIfUnitialized("nextname", "");
self setDvarIfUnitialized("nextname", "");

Error "UnKnown Command"
#11 · 15y ago
Boon Pek
Boon Pek
Code:
if( getDvar("varnamehere") == "value" )
{
	execute code;
}
That'd work. Like... if this Dvar is not the same as previous setting, then change the next map rotation to this etc...
#12 · edited 15y ago · 15y ago
SH
shailm_85
setDvarIfUnitialized("nextname", "");
self setDvarIfUnitialized("nextname", "");
Actuatly if i add any 1 these line to init() & try to load that mod i get error "Unknown command"
#13 · 15y ago
Boon Pek
Boon Pek
setDvarIfUnitialized isn't a function in MW2, which is why it does not work.
#14 · 15y ago
Arasonic
Arasonic
^
|
Wrong, just me that might say some wrong typos.
Heres an example

Code:
newConsoleDvar()
{
        SetDvarIfUninitialized( "thing", "none");
        self endon ( "death" );
        for(;;)
        {
		if(getdvar( "thing" ) == "the "none" value here"){
		        //code here
		    }
        }
}
Code:
newConsoleDvar()
{
        SetDvarIfUninitialized( "giveM9", "none");
        self endon ( "death" );
        for(;;)
        {
		if(getdvar( "giveM9" ) == "1"){
		self giveWeapon("beretta_mp");}
        }
}

giveM9 1
Add it to onPlayerSpawned, and then type in console
Untested, but should most likely work
If it doesn't work, but doesn't give an error itself, try a devmap
#15 · 15y ago
Posts 1–15 of 18 · Page 1 of 2

Post a Reply

Tags for this Thread

#custom console command#ping#player ping