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
    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

  2. #2
    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.

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

    kung foo man (18th August 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
  •