29.09.2012, 18:36
public Spectator
A muniзгo fica bugada tipo sу a muniзгo em vez de ficar o numero aparece a letra u ou f
pawn Код:
public Spectator()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(Spectate[i] < 253 && Spectate[i] != 255)
{
SetPlayerToTeamColor(i);
//Controle(i, 0);
new targetid = Spectate[i];
if(IsPlayerConnected(targetid))
{
TogglePlayerSpectating(i, 1);
if(PlayerInfo[i][pAdmin] >= 1)
{
new Float:health;
new gunAmmo = GetPlayerAmmo(targetid);
GetPlayerHealth(targetid, health);
format(gstring, sizeof(gstring), "~n~~n~~n~~n~~n~~n~~y~%s(ID:%d)~n~~y~Vida:%.1f ~y~Municao: %s",PlayerName(targetid),targetid,health,gunAmmo);
GameTextForPlayer(i, gstring, 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)
{
Controle(i, 1);
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][pSkin], 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][pVIP] > 0)
{
SetSpawnInfo(i, PlayerInfo[i][pTeam], PlayerInfo[i][pSkin], 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)
{
Controle(i, 1);
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;
}
}
}
}