public Spectator()
{
new string[256];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(KickPlayer[i]==1) { Kick(i); }
else if(KickPlayer[i]==2) { Ban(i); }
//if(GetPlayerPing(i) >= 500 && PlayerInfo[i][pAdmin] < 1) { Kick(i); }
if(Spectate[i] < 253 && Spectate[i] != 255)
{
FreezePlayer(i);
new targetid = Spectate[i];
if(IsPlayerConnected(targetid))
{
TogglePlayerSpectating(i, 1);
if(PlayerInfo[i][pAdmin] >= 1)
{
new Float:health;
new name[MAX_PLAYER_NAME];
GetPlayerName(targetid, name, sizeof(name));
GetPlayerHealth(targetid, health);
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~Leben:%.1f",name,targetid,health);
GameTextForPlayer(i, string, 2500, 3);
}
if(IsPlayerInAnyVehicle(targetid))
{
new carid = GetPlayerVehicleID(targetid);
PlayerSpectateVehicle(i, carid);
}
else
{
PlayerSpectatePlayer(i, targetid);
}
if(GetPlayerInterior(targetid) == 0)
{
SetPlayerInterior(i,0);
}
else if(GetPlayerInterior(targetid) > 0)
{
SetPlayerInterior(i,GetPlayerInterior(targetid));
}
}//Targetid connected
}
if(Spectate[i] == 253)
{
UnFreezePlayer(i);
TogglePlayerSpectating(i, 0);
SetPlayerInterior(i,Unspec[i][sPint]);
PlayerInfo[i][pInt] = Unspec[i][sPint];
PlayerInfo[i][pLocal] = Unspec[i][sLocal];
Unspec[i][sLocal] = 255;
SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]-1.0, 1.0, -1, -1, -1, -1, -1, -1);
gTeam[i] = PlayerInfo[i][pTeam];
SetPlayerToTeamColor(i);
MedicBill[i] = 0;
if(PlayerInfo[i][pDonateRank] > 0)
{
SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pModel], Unspec[i][Coords][0], Unspec[i][Coords][1], Unspec[i][Coords][2], 10.0, -1, -1, -1, -1, -1, -1);
SpawnPlayer(i);
SetCameraBehindPlayer(i);
}
else
{
SpawnPlayer(i);
}
Spectate[i] = 255;
}
if(Spectate[i] == 254)
{
UnFreezePlayer(i);
SetPlayerInterior(i,Unspec[i][sPint]);
PlayerInfo[i][pInt] = Unspec[i][sPint];
PlayerInfo[i][pLocal] = Unspec[i][sLocal];
SetPlayerPos(i, Unspec[i][sPx], Unspec[i][sPy], Unspec[i][sPz]);
Spectate[i] = 255;
}
if(Spectate[i] == 256)
{
SetPlayerToTeamColor(i);
Spectate[i] = 255;
}
if(Spectate[i] == 257)
{
Spectate[i] = 254;
}
}
}
}
//------------------------------------------------------------------------------------------------------
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger
Hier InternetInk aka Benjamin