46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
string SetupPCNames()
|
|
{
|
|
int PCCount = GetLocalInt(GetPCSpeaker(), "PLAYERS_SHIFTED");
|
|
object oPC = GetFirstPC();
|
|
int Shift = 0;
|
|
while(GetIsObjectValid(oPC))
|
|
{
|
|
if(!GetIsDM(oPC))
|
|
{
|
|
if(Shift == PCCount)
|
|
{
|
|
Shift++;
|
|
break;
|
|
}
|
|
Shift++;
|
|
}
|
|
oPC = GetNextPC();
|
|
}
|
|
SetLocalInt(GetPCSpeaker(), "PLAYERS_SHIFTED", Shift);
|
|
SetLocalObject(GetPCSpeaker(), "PLAYER_TARGETED", oPC);
|
|
string Name = GetName(oPC);
|
|
string NameOfArea = GetName(GetArea(oPC));
|
|
if(Name != "")
|
|
{ return Name + " [ " + NameOfArea + " ]"; }
|
|
return Name;
|
|
}
|
|
|
|
|
|
|
|
int StartingConditional()
|
|
{
|
|
int iResult = TRUE;
|
|
string NameOfTarget = SetupPCNames();
|
|
if(NameOfTarget == "")
|
|
{
|
|
SetCustomToken(6869, "[ There are no more players ]");
|
|
SetLocalInt(GetPCSpeaker(), "BROWSE_NEXT", 100);
|
|
DeleteLocalInt(GetPCSpeaker(), "PLAYERS_SHIFTED");
|
|
DeleteLocalObject(GetPCSpeaker(), "PLAYER_TARGETED");
|
|
return iResult;
|
|
}
|
|
SetCustomToken(6869, NameOfTarget);
|
|
return iResult;
|
|
|
|
}
|