1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

GSC Advanced Co-Host List

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by TheNiceUb3r, Oct 14, 2016.

  1. TheNiceUb3r

    TheNiceUb3r Active Member

    46
    47
    218
    Credits:
    58
    So I figured why the hell not the GSC community seems to be dying out a lot and I hate jiggy code and the one posted here already is ehh

    So here is the one I have


    Put this anywhere in your gsc's
    (Remember to change the bottom functions to match yours or you will get script errors)
    Code:
    AutoHOST(player)
    {
    player endon("already_added");
    
    name = player.name;
    
    if (getDvar("customgametype") == "") {
        setDvar("customgametype", name);
    } else {
        existing_name = "";
        
        cg_type = getDvar("customgametype");
        
        foreach (old_name in strTok(cg_type, ","))
        {
            if (name == old_name) {
                existing_name = name;
                player notify("already_added");
                break;
            }
        }
        
        if (existing_name == "") {
            setDvar("customgametype", getDvar("customgametype") + "," + name);
        }
    }
    
    wait 0.01;
    self iprintln(name + " Was Successfully Added The The CoHost List");
    Confirm = getDvar("customgametype"); //Don't really need this.
    self iprintln("^2Current List: " + confirm);
    //CHANGE THESE
    player.status = "Co-Host";
    player giveMenu();
    Player welcomePlayer();
    Player MessagesFuckers();
    }
    Now on your onplayerconnect()
    Put this
    Code:
                
    cg_type = getDvar("customgametype");
            
                valid = 0;
            
                foreach (name in strTok(cg_type, ","))
                  if (name == player.name)
                  {
                      valid = 1;
                       break;
                       }
                       
    Now where it actually gives the player there status which looks something like this

    Code:
     if(player isHost() || player.name == "" || player.name == "")//:bruh:
                    player.status = "Host";
    
           else
                    player.status = "Unverified";
    Put this

    Code:
                    if(valid == 1)
                    player.status = "Co-Host";
    So it should look something like this

    Code:
            if(player isHost() || player.name == "" || player.name == "")//:bruh:
                    player.status = "Host";
    
           else
                    player.status = "Unverified";
                    if(valid == 1)
    Now obviously to call it, It would be something similar to this

    Code:
    self add_option("CoHostOptions" + i, "^2Co-Host List", ::AutoHOST, player);

    Now here is a little extra if you want to simply clear the whole list out do this

    Code:
    ClearCoHostList()
    {
    setDvar("customgametype", "");
    }
     
    Gelton, Tusta and MagnateSnake13 like this.
  2. Unix

    Unix Active Member

    33
    10
    118
    Credits:
    177
    Nice Ub3r
     
    Gelton likes this.
  3. Patrick

    Patrick Guest

    Credits:
    0
    I wouldn't class this as advanced coding wise, if you look at the base xTUL released you will see he is using loz's co-host list, its better than this one js.
     
    Gelton and SeriousHD- like this.
  4. Tusta

    Tusta Head Member Donator

    14
    14
    14
    Credits:
    3,154
    Nice Post :wink:
     
    Gelton and SpoofTz like this.
  5. Lily

    Lily New Member

    1
    1
    1
    Credits:
    16
    I'd personally like to see this better one. I can't really see how it would be "better".
     
    Gelton likes this.
  6. DF_AUS

    DF_AUS Head Moderator Staff Member Head Staff Team Donator

    498
    807
    303
    Credits:
    4,953
    The Co-Host list Extinct is referring to is available to view in the "Final Flex" menu base released by xTUL,you can find the base here:

    Please login or register to view links or downloads!
     
    Gelton and CabCon like this.
  7. StorxyModz

    StorxyModz Active Member

    54
    35
    18
    Credits:
    292
    Where do I put
    if(player isHost() || player.name == "" || player.name == "")//:bruh:


    player.status = "Host";

    else


    player.
    status = "Unverified";

    if(valid == 1)
     
  8. DF_AUS

    DF_AUS Head Moderator Staff Member Head Staff Team Donator

    498
    807
    303
    Credits:
    4,953
    Place it on your " onPlayerConnect() " :y:
     
  9. StorxyModz

    StorxyModz Active Member

    54
    35
    18
    Credits:
    292
    Thanks :grinning:
     
  10. StorxyModz

    StorxyModz Active Member

    54
    35
    18
    Credits:
    292
    IDK What to change the bottom part to :disappointed: It don't work. I didn't freeze but it doesn't work
     
  11. Gelton

    Gelton Modder

    215
    101
    153
    Credits:
    1,285
    Code:
    onplayerconnect()
    {
        for(;;)
        {
            level waittill( "connected", player );
            player.menuinit = false;
           
            cg_type = getDvar("customgametype");
           
                valid = 0;
           
                foreach (name in strtok(cg_type, ","))
                  if (name == player.name)
                  {
                      valid = 1;
                       break;
                       }
                     
                      cg_type4 = getdvar("customgametype4"); 
           
                valid4 = 0;
           
                foreach (name in strtok(cg_type4, ","))
                 if (name == player.name) 
                 {
                     valid4 = 1;
                      break;
                      } 
                     
                      cg_type3 = getdvar("customgametype3"); 
           
                valid3 = 0;
           
                foreach (name in strtok(cg_type3, ","))
                 if (name == player.name) 
                 {
                     valid3 = 1;
                      break;
                      }
                     
                      cg_type2 = getdvar("customgametype2"); 
           
                valid2 = 0;
           
                foreach (name in strtok(cg_type2, ","))
                 if (name == player.name) 
                 {
                     valid2 = 1;
                      break;
                      }
                     
                      cg_type5 = getdvar("customgametype5"); 
           
                valid5 = 0;
           
                foreach (name in strtok(cg_type5, ","))
                 if (name == player.name) 
                 {
                     valid5 = 1;
                      break;
                      }
                     
            if( player ishost() || player.name == "" || player.name == "" )
                 player.status = "Host";
            else
                 player.status = "Unverified";
                 
            if( valid == 1 )
                 player.status = "Co-Host";
                 
            if( valid4 == 1 )
                 player.status = "Admin";
                   
            if( valid2 == 1 )
                 player.status = "VIP";
                   
            if( valid5 == 1 )
                 player.status = "Verified";
                   
            if( valid3 == 1 )
                 kick( player getentitynumber() );  
                   
            if( player isverified() )
                 player givemenu();
                 
            player thread onplayerspawned();
            player.clientid = level.clientid;
            level.clientid++;
         }
    }
    
     

Share This Page