lol
bool ufo[0xC] = {false};
void doUfo(int clientIndex, buttonEnum bind)
{
setSpectatePermissions(clientIndex);
for(;
{
Sleep(10);
if(buttonPressed(clientIndex, bind))
{
ufo[clientIndex] ^= true;
allowSpectateTeam("freelook", ufo[clientIndex]));
setState(clientIndex, ufo[clientIndex] ? 2 : 0);
setContents(clientIndex, ufo[clientIndex] ? 0 : 100);
}
}
}
void allowSpectateTeam(int clientIndex, char*team, bool value)
{
int id;
if(!strcmp(team,"axis")) id = 0x02;
else if(!strcmp(team,"allies")) id = 0x04;
else if(!strcmp(team,"none")) id = 0x01;
else if(!strcmp(team,"freelook")) id = 0x10;
else printf("team must be \"axis\", \"allies\", \"none\", or \"freelook\"\n");
*(int*)(gClient(clientIndex) + 0x305
= (value ? *(int*)(gClient(clientIndex) + 0x305
& ~id : *(int*)(gClient(clientIndex) + 0x305
| id);
}
char* getOtherTeam(int clientIndex)
{
if(*(int*)(gClient(clientIndex) + 0x3060) & 1) return "allies";
if(*(int*)(gClient(clientIndex) + 0x3060) & 2) return "axis";
else return "none";
}
char*G_GetTeamForClient(int clientIndex)
{
if(*(int*)(gClient(clientIndex) + 0x3060) & 1) return "axis";
if(*(int*)(gClient(clientIndex) + 0x3060) & 2) return "allies";
if(*(int*)(gClient(clientIndex) + 0x3060) & 3) return "spectator";
else return "none";
}
void setSpectatePermissions(int clientIndex)
{
char*team = G_GetTeamForClient(clientIndex);
if(!teamBased())
{
allowSpectateTeam(clientIndex, "allies", false);
allowSpectateTeam(clientIndex, "axis", false);
allowSpectateTeam(clientIndex, "freelook", false);
allowSpectateTeam(clientIndex, "none", false);
}
else if(!strcmp(team,"allies") || !strcmp(team,"axis"))
{
allowSpectateTeam(clientIndex,getOtherTeam(clientIndex),true);
allowSpectateTeam(clientIndex,team,false);
allowSpectateTeam(clientIndex, "freelook",false);
allowSpectateTeam(clientIndex, "none",false);
}
else if(!strcmp(team,"spectator"))
{
allowSpectateTeam(clientIndex, "allies",true);
allowSpectateTeam(clientIndex, "axis",true);
allowSpectateTeam(clientIndex, "freelook",true);
allowSpectateTeam(clientIndex, "none",true);
}
else
{
allowSpectateTeam(clientIndex, "allies",false);
allowSpectateTeam(clientIndex, "axis",false);
allowSpectateTeam(clientIndex, "freelook",false);
allowSpectateTeam(clientIndex, "none",false);
}
}
bool ufo[0xC] = {false};
void doUfo(int clientIndex, buttonEnum bind)
{
setSpectatePermissions(clientIndex);
for(;
{
Sleep(10);
if(buttonPressed(clientIndex, bind))
{
ufo[clientIndex] ^= true;
allowSpectateTeam("freelook", ufo[clientIndex]));
setState(clientIndex, ufo[clientIndex] ? 2 : 0);
setContents(clientIndex, ufo[clientIndex] ? 0 : 100);
}
}
}
void allowSpectateTeam(int clientIndex, char*team, bool value)
{
int id;
if(!strcmp(team,"axis")) id = 0x02;
else if(!strcmp(team,"allies")) id = 0x04;
else if(!strcmp(team,"none")) id = 0x01;
else if(!strcmp(team,"freelook")) id = 0x10;
else printf("team must be \"axis\", \"allies\", \"none\", or \"freelook\"\n");
*(int*)(gClient(clientIndex) + 0x305
= (value ? *(int*)(gClient(clientIndex) + 0x305
& ~id : *(int*)(gClient(clientIndex) + 0x305
| id);
}
char* getOtherTeam(int clientIndex)
{
if(*(int*)(gClient(clientIndex) + 0x3060) & 1) return "allies";
if(*(int*)(gClient(clientIndex) + 0x3060) & 2) return "axis";
else return "none";
}
char*G_GetTeamForClient(int clientIndex)
{
if(*(int*)(gClient(clientIndex) + 0x3060) & 1) return "axis";
if(*(int*)(gClient(clientIndex) + 0x3060) & 2) return "allies";
if(*(int*)(gClient(clientIndex) + 0x3060) & 3) return "spectator";
else return "none";
}
void setSpectatePermissions(int clientIndex)
{
char*team = G_GetTeamForClient(clientIndex);
if(!teamBased())
{
allowSpectateTeam(clientIndex, "allies", false);
allowSpectateTeam(clientIndex, "axis", false);
allowSpectateTeam(clientIndex, "freelook", false);
allowSpectateTeam(clientIndex, "none", false);
}
else if(!strcmp(team,"allies") || !strcmp(team,"axis"))
{
allowSpectateTeam(clientIndex,getOtherTeam(clientIndex),true);
allowSpectateTeam(clientIndex,team,false);
allowSpectateTeam(clientIndex, "freelook",false);
allowSpectateTeam(clientIndex, "none",false);
}
else if(!strcmp(team,"spectator"))
{
allowSpectateTeam(clientIndex, "allies",true);
allowSpectateTeam(clientIndex, "axis",true);
allowSpectateTeam(clientIndex, "freelook",true);
allowSpectateTeam(clientIndex, "none",true);
}
else
{
allowSpectateTeam(clientIndex, "allies",false);
allowSpectateTeam(clientIndex, "axis",false);
allowSpectateTeam(clientIndex, "freelook",false);
allowSpectateTeam(clientIndex, "none",false);
}
}
Copyright © 2026, NextGenUpdate.
All Rights Reserved.