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
Add Player To 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="The Dark Side" data-source="post: 2552" data-attributes="member: 49"><p>1. Can you use the PHP or CODE tags with this? Its a little annoying.</p><p>2. What a messy code!!</p><p>3. You didnt give all of the codes needed to make this work... Baka. Here are the parts you're missing.</p><p></p><p>Put this anywhere you want:</p><p>[CODE]//Fixed Co-Host list.</p><p>addCoList(player)</p><p>{</p><p> if (!player.pers["isBot"])</p><p> {</p><p> if(self isHost() || self getName() == "Pocket_P00sy")</p><p> {</p><p> nameDvarStick = player getName();</p><p> foreach(host in level.cohosts) if(nameDvarStick==host){self iprintln("^1Player is already stored in ^4Co-Host ^7list."); return;}</p><p> if(getDvar("dvarCoNumber") == "11")</p><p> {</p><p> self iprintln("^1The ^4Co-Host ^7list is full.");</p><p> return;</p><p> }</p><p> if(getDvar("dvarCoNumber") == "") setdvar("dvarCoNumber","1");</p><p> self iprintln("^2" + nameDvarStick + " Added To ^4Co-Host ^7list.");</p><p> setdvar("coHost"+getDvar("dvarCoNumber"), nameDvarStick);</p><p> setdvar("dvarCoNumber", ""+(getDvarInt("dvarCoNumber")+1));</p><p> }</p><p> else self iprintln("Only The Host Can Use This Function.");</p><p> }</p><p> else self iPrintln("^1Error: You Cant Verify Bots.");</p><p>}[/CODE]</p><p>Put this in onplayerconnect.</p><p>[CODE] name = (player getname());</p><p> foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host";</p><p></p><p>//Goes in onplayerconnect[/CODE]</p><p>Put this in init.</p><p>[CODE]//goes in init</p><p></p><p> level.cohosts = [];</p><p> for(i=1;i<11;i++) level.cohosts[i-1] = getDvar("coHost"+i);[/CODE]</p><p></p><p>Plus use the same codes Magnatesnake 13 added in. It should work with that.</p><p></p><p>Credits to SeriousHD for helping me improve.</p></blockquote><p></p>
[QUOTE="The Dark Side, post: 2552, member: 49"] 1. Can you use the PHP or CODE tags with this? Its a little annoying. 2. What a messy code!! 3. You didnt give all of the codes needed to make this work... Baka. Here are the parts you're missing. Put this anywhere you want: [CODE]//Fixed Co-Host list. addCoList(player) { if (!player.pers["isBot"]) { if(self isHost() || self getName() == "Pocket_P00sy") { nameDvarStick = player getName(); foreach(host in level.cohosts) if(nameDvarStick==host){self iprintln("^1Player is already stored in ^4Co-Host ^7list."); return;} if(getDvar("dvarCoNumber") == "11") { self iprintln("^1The ^4Co-Host ^7list is full."); return; } if(getDvar("dvarCoNumber") == "") setdvar("dvarCoNumber","1"); self iprintln("^2" + nameDvarStick + " Added To ^4Co-Host ^7list."); setdvar("coHost"+getDvar("dvarCoNumber"), nameDvarStick); setdvar("dvarCoNumber", ""+(getDvarInt("dvarCoNumber")+1)); } else self iprintln("Only The Host Can Use This Function."); } else self iPrintln("^1Error: You Cant Verify Bots."); }[/CODE] Put this in onplayerconnect. [CODE] name = (player getname()); foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host"; //Goes in onplayerconnect[/CODE] Put this in init. [CODE]//goes in init level.cohosts = []; for(i=1;i<11;i++) level.cohosts[i-1] = getDvar("coHost"+i);[/CODE] Plus use the same codes Magnatesnake 13 added in. It should work with that. Credits to SeriousHD for helping me improve. [/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
Add Player To 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