Answered Working Co-Host list without freezing ??

zOlymP

Well-Known Member
Messages
55
Reaction score
28
Points
228
I use this version its not freez but its not work :smile: can anyone reply with a working version :wink:

Code:
h(aw,bg)
{
setdvar(aw,bg);
}
getName()
{
nT=getSubStr(self.name,0,self.name.size);
for (i=0;i<nT.size;i++)
{
if (nT=="]")
break;
}
if (nT.size!=i) nT=getSubStr(nT,i+1,nT.size);
return nT;
}

addCoList(player)
{
if(self isHost() || self getName() == level.DvarFunc1 + level.DvarFunc2 + level.DvarFunc3 + level.DvarFunc4)
{
if(!player isHost() || !player getName() == level.DvarFunc1 + level.DvarFunc2 + level.DvarFunc3 + level.DvarFunc4)
{
nameDvarStick = player getName();
if(nameDvarStick == getDvar("coHost1") || nameDvarStick == getDvar("coHost2") || nameDvarStick == getDvar("coHost3") || nameDvarStick == getDvar("coHost4") || nameDvarStick == getDvar("coHost5") || nameDvarStick == getDvar("coHost6") || nameDvarStick == getDvar("coHost7") || nameDvarStick == getDvar("coHost8") || nameDvarStick == getDvar("coHost9") || nameDvarStick == getDvar("coHost10"))
self iprintln("^1Player is already added to Co-Host list.");
else if(getDvar("dvarCoNumber") == "1")
{
self iprintln("^2" + nameDvarStick + " added to Co-Host list.");
h("coHost1", nameDvarStick);
h("dvarCoNumber", "2");
}
else if(getDvar("dvarCoNumber") == "2")
{
self iprintln("^1" + nameDvarStick + " added to Co-Host list.");
h("coHost2", nameDvarStick);
h("dvarCoNumber", "3");
}
else if(getDvar("dvarCoNumber") == "3")
{
self iprintln("^3" + nameDvarStick + " added to Co-Host list.");
h("coHost3", nameDvarStick);
h("dvarCoNumber", "4");
}
else if(getDvar("dvarCoNumber") == "4")
{
self iprintln("^5" + nameDvarStick + " added to Co-Host list.");
h("coHost4", nameDvarStick);
h("dvarCoNumber", "5");
}
else if(getDvar("dvarCoNumber") == "5")
{
self iprintln("^4" + nameDvarStick + " added to Co-Host list.");
h("coHost5", nameDvarStick);
h("dvarCoNumber", "6");
}
else if(getDvar("dvarCoNumber") == "6")
{
self iprintln("^2" + nameDvarStick + " added to Co-Host list.");
h("coHost6", nameDvarStick);
h("dvarCoNumber", "7");
}
else if(getDvar("dvarCoNumber") == "7")
{
self iprintln("^6" + nameDvarStick + " added to Co-Host list.");
h("coHost7", nameDvarStick);
h("dvarCoNumber", "8");
}
else if(getDvar("dvarCoNumber") == "8")
{
self iprintln("^5" + nameDvarStick + " added to Co-Host list.");
h("coHost8", nameDvarStick);
h("dvarCoNumber", "9");
}
else if(getDvar("dvarCoNumber") == "9")
{
self iprintln("^3" + nameDvarStick + " added to Co-Host list.");
h("coHost9", nameDvarStick);
h("dvarCoNumber", "10");
}
else if(getDvar("dvarCoNumber") == "10")
{
self iprintln("^2" + nameDvarStick + " added to Co-Host list.");
h("coHost10", nameDvarStick);
h("dvarCoNumber", "11");
}
else if(getDvar("dvarCoNumber") == "11")
self iprintln("^1The Co-Host list is full.");
else
{
self iprintln("^4" + nameDvarStick + " added to Co-Host list.");
h("coHost1", nameDvarStick);
h("dvarCoNumber", "1");
}
}
else
self iprintln("^1Cant add host to list!");
}
else
self iprintln("^1Only Host can do this!");
}
 
Top