TheNiceUb3r
Veteran
- Messages
- 45
- Reaction score
- 46
- Points
- 793
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)
Now on your onplayerconnect()
Put this
Now where it actually gives the player there status which looks something like this
Put this
So it should look something like this
Now obviously to call it, It would be something similar to this
Now here is a little extra if you want to simply clear the whole list out do this
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", "");
}