Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    shailm_85's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0
    My Mood
    Happy

    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

  2. #2
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    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

  3. #3
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    Boon Pek is right, it's not possible.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  4. #4
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    i thought it was like " + self.ping + "
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  5. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    Quote Originally Posted by jimmynguyen3030 View Post
    i thought it was like " + self.ping + "
    epic fail.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  6. #6
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    Quote Originally Posted by master131 View Post
    epic fail.
    lol hahaha

    cuz self.GUID works self.maxhealth works self.name works so...

  7. #7
    shailm_85's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    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

  8. #8
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    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
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  9. #9
    shailm_85's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    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.

  10. #10
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    If I remember right, it has something with
    setDvarIfUnitialized("", );

    Can't really remember.

  11. #11
    shailm_85's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    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"

  12. #12
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    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...
    Last edited by Boon Pek; 01-20-2011 at 08:59 AM.
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  13. #13
    shailm_85's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    13
    Reputation
    10
    Thanks
    0
    My Mood
    Happy
    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"

  14. #14
    Boon Pek's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    188
    Reputation
    10
    Thanks
    389
    My Mood
    Inspired
    setDvarIfUnitialized isn't a function in MW2, which is why it does not work.
    My minecraft launcher!

    A full-featured, actively-developed windows-only Minecraft Launcher! It allows you to download older versions of minecraft.jar through the options menu, multi-username support, RAM allocation support, non-legit logins and more!








    [img]https://i61.photobucke*****m/albums/h56/damwickid/pscs5.png[/img]


  15. #15
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    ^
    |
    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

Page 1 of 2 12 LastLast