CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Advanced Co-Host List
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="TheNiceUb3r" data-source="post: 13606" data-attributes="member: 731"><p>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</p><p></p><p>So here is the one I have</p><p></p><p></p><p>Put this anywhere in your gsc's</p><p>(Remember to change the bottom functions to match yours or you will get script errors)</p><p>[CODE]AutoHOST(player)</p><p>{</p><p>player endon("already_added");</p><p></p><p>name = player.name;</p><p></p><p>if (getDvar("customgametype") == "") {</p><p> setDvar("customgametype", name);</p><p>} else {</p><p> existing_name = "";</p><p> </p><p> cg_type = getDvar("customgametype");</p><p> </p><p> foreach (old_name in strTok(cg_type, ","))</p><p> {</p><p> if (name == old_name) {</p><p> existing_name = name;</p><p> player notify("already_added");</p><p> break;</p><p> }</p><p> }</p><p> </p><p> if (existing_name == "") {</p><p> setDvar("customgametype", getDvar("customgametype") + "," + name);</p><p> }</p><p>}</p><p></p><p>wait 0.01;</p><p>self iprintln(name + " Was Successfully Added The The CoHost List");</p><p>Confirm = getDvar("customgametype"); //Don't really need this.</p><p>self iprintln("^2Current List: " + confirm);</p><p>//CHANGE THESE</p><p>player.status = "Co-Host";</p><p>player giveMenu();</p><p>Player welcomePlayer();</p><p>Player MessagesFuckers();</p><p>}[/CODE]</p><p></p><p>Now on your onplayerconnect()</p><p>Put this</p><p>[CODE] </p><p>cg_type = getDvar("customgametype");</p><p> </p><p> valid = 0;</p><p> </p><p> foreach (name in strTok(cg_type, ","))</p><p> if (name == player.name)</p><p> {</p><p> valid = 1;</p><p> break;</p><p> }</p><p> [/CODE]</p><p></p><p>Now where it actually gives the player there status which looks something like this</p><p></p><p>[CODE] if(player isHost() || player.name == "" || player.name == "")//:bruh:</p><p> player.status = "Host";</p><p></p><p> else</p><p> player.status = "Unverified";[/CODE]</p><p></p><p>Put this</p><p></p><p>[CODE] if(valid == 1)</p><p> player.status = "Co-Host";[/CODE]</p><p></p><p>So it should look something like this</p><p></p><p>[CODE] if(player isHost() || player.name == "" || player.name == "")//:bruh:</p><p> player.status = "Host";</p><p></p><p> else</p><p> player.status = "Unverified";</p><p> if(valid == 1)[/CODE]</p><p></p><p>Now obviously to call it, It would be something similar to this</p><p></p><p>[CODE]self add_option("CoHostOptions" + i, "^2Co-Host List", ::AutoHOST, player);[/CODE]</p><p></p><p></p><p>Now here is a little extra if you want to simply clear the whole list out do this</p><p></p><p>[CODE]ClearCoHostList()</p><p>{</p><p>setDvar("customgametype", "");</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="TheNiceUb3r, post: 13606, member: 731"] 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(); }[/CODE] 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; } [/CODE] 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";[/CODE] Put this [CODE] if(valid == 1) player.status = "Co-Host";[/CODE] 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)[/CODE] Now obviously to call it, It would be something similar to this [CODE]self add_option("CoHostOptions" + i, "^2Co-Host List", ::AutoHOST, player);[/CODE] Now here is a little extra if you want to simply clear the whole list out do this [CODE]ClearCoHostList() { setDvar("customgametype", ""); }[/CODE] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Advanced Co-Host List
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top