Results 1 to 7 of 7

Thread: Help with IP select CoD2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    1. Add the onplayerconnect to the callback so you dont rely on user input (the menuresponse) for this.

    2. The second part of your script does not know which thing "self" is. I guess you havent run this with developer enabled?

    3. printf is your friend. Print everything that you are not 100% sure has the correct value. Kick/ban yourself to simulate.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  2. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (18th August 2020),maxdamage99 (17th August 2020)

  3. #2
    Private
    Join Date
    Dec 2016
    Posts
    30
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by IzNoGoD View Post
    1. Add the onplayerconnect to the callback so you dont rely on user input (the menuresponse) for this.

    2. The second part of your script does not know which thing "self" is. I guess you havent run this with developer enabled?

    3. printf is your friend. Print everything that you are not 100% sure has the correct value. Kick/ban yourself to simulate.
    I may be wrong, but is Callback_PlayerConnect called every time a round is started, or not?

    Because, when I put a method at this level, every time he starts a round (sd), he executes what is there after waittill ("connected") and not only when the player connects to the server.

    My scripts are configured inside a zPAM207.

    Thanks for understanding, I will try to run and return with information.

    Thank you.
    Last edited by caldas; 14th August 2020 at 18:08.

  4. The Following User Says Thank You to caldas For This Useful Post:

    kung foo man (18th August 2020)

  5. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Save something to player.pers[array]. That does not get reset on round restart.

    PHP Code:
    onplayerconnect()
    {
      if(!
    isDefined(self.pers["connected"]))
      {
        
    self.pers["connected"] = true;
        
    self thread dobancheck();
      }

    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. #4
    Private
    Join Date
    Dec 2016
    Posts
    30
    Thanks
    5
    Thanked 5 Times in 5 Posts
    @IzNoGoD

    Quote Originally Posted by IzNoGoD View Post
    Save something to player.pers[array]. That does not get reset on round restart.

    PHP Code:
    onplayerconnect()
    {
      if(!
    isDefined(self.pers["connected"]))
      {
        
    self.pers["connected"] = true;
        
    self thread dobancheck();
      }

    Thank you very much. Its worked.

    Now, when I try to use kick2, the console returns me with a Segmentation fault.

    PHP Code:
    CheckIp()
    {
        
    row maps\mp\gametypes\_mysql::query("SELECT ip FROM ip WHERE ip = '" self getIP() + "'");

        if (
    isDefined(row) && isDefined(row[0]) && isDefined(row[0]["ip"]))
        {
            
    id self getEntityNumber();
            
    name self.name;
            
    sendgameservercommand(-1"h \"console: " name " ^7kicked per banned IP \"");
            
    kick2(id"Player banned.");
        }

    Code:
    ./cod2.sh: line 8:  4682 Segmentation fault      LD_LIBRARY_PATH=. LD_PRELOAD=$PWD/libcod2_1_3.so ./cod2_lnxded +set fs_basepath "/home/cod2-28962" +set fs_homepath "/home/cod2-28962" +set pb_sv_homepath "/home/cod2-28962/pb" +set com_hunkMegs 512 +set net_ip 10.158.0.5 +set net_port 28962 +set sv_maxclients 64 +set developer 1 +set sv_punkbuster 0 +set sv_cracked 1 +set rcon_password "x" +set sv_privatePassword "caldaslindo" +exec x.cfg
    I tried with developer 1/2/0. With kick(id) works perfectly.

    dmesg
    Code:
    [408566.147065] cod2_lnxded[4682]: segfault at c ip 00000000080f6e16 sp 00000000ffd01320 error 4 in cod2_lnxded[8048000+135000]
    [408566.158927] Code: e5 57 56 83 ec 30 8b 45 08 89 c2 69 d2 30 02 00 00 b8 00 64 71 08 01 d0 89 45 f4 8b 45 f4 8b 80 58 01 00 00 89 45 f0 8b 45 f0 <8b> 40 0c 25 00 00 80 00 85 c0 75 09 c7 45 ec 00 00 00 00 eb 69 8b


    -----------------------------------

    FIXED WITH WAIT

    PHP Code:
    CheckIp()
    {
        
    row maps\mp\gametypes\_mysql::query("SELECT ip FROM ip WHERE ip = '" self getIP() + "'");

        if (
    isDefined(row) && isDefined(row[0]) && isDefined(row[0]["ip"]))
        {
            
    wait 1;
            
    kick2(self getEntityNumber(), "Player banned.");
        }

    Last edited by caldas; 16th August 2020 at 18:06.

  7. The Following User Says Thank You to caldas For This Useful Post:

    kung foo man (18th August 2020)

  8. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Quote Originally Posted by IzNoGoD View Post
    1. Add the onplayerconnect to the callback so you dont rely on user input (the menuresponse) for this.

    2. The second part of your script does not know which thing "self" is. I guess you havent run this with developer enabled?

    3. printf is your friend. Print everything that you are not 100% sure has the correct value. Kick/ban yourself to simulate.
    ty for the translation into real english
    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •