Add Player To Co-Host List

BOSSAM BEMASS

Member
Messages
2
Reaction score
0
Points
11
like in the (
(player getname());
foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host"
)

name = (player getname());
foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host";
 

ezz up

New Member
Messages
4
Reaction score
1
Points
1
I CANT GET IT TO WORK OMG



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.");
}
Put this in onplayerconnect.
Code:
 name = (player getname());
        foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host";

//Goes in onplayerconnect
Put this in init.
Code:
//goes in init

        level.cohosts = [];
        for(i=1;i<11;i++) level.cohosts[i-1] = getDvar("coHost"+i);

Plus use the same codes Magnatesnake 13 added in. It should work with that.

Credits to SeriousHD for helping me improve.
 

ezz up

New Member
Messages
4
Reaction score
1
Points
1
Yo HMU We can work on this together
KIK: littleberv
Insta: EzzUpGlitcher_Modz
Twitter: Ezz_Up_Glitcher
Skype: EzzUpGlitcher


like in the (
(player getname());
foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host"
)

name = (player getname());
foreach(cohost in level.cohosts) if(name==cohost) player.status = "Co-Host";
 
Top