Spectate system bug.
#1

Hi, Im having issues with my spectate system, when I spec someone and he goes into an interior most of the time it bugs out and I cant see anything. Like it happends when you spectate an invalid playerid for example. I tryed debugging aswell and here is the results.


Lean_Laptop is spectating Charles_Washington

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)//This is called when a player's interior is changed.
{
if(IsSpecing[playerid] == 1) return 0;
printf("OnPlayerInteriorChange called for player %s",GetName(playerid));
    if(IsBeingSpeced[playerid] == 1)//If the player being spectated, changes an interior, then update the interior and virtualword for the spectator.
    {
        foreach(Player,i)
        {
            if(spectatorid[i] == playerid)
            {
                SetPlayerInterior(i,GetPlayerInterior(playerid));
                printf("Interior set to %d for player %s, should be %d",GetPlayerInterior(i),GetName(i),GetPlayerInterior(playerid));
             //   SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
            }
        }
    }
    return 1;
}




[19:33:25] OnPlayerInteriorChange called for player Charles_Washington
[19:33:25] Interior set to 7 for player Charles_Washington, should be 7
[19:33:25] Interior set to 0 for player Lean_Laptop, should be 7
[19:34:11] OnPlayerInteriorChange called for player Charles_Washington
[19:34:11] Interior set to 0 for player Charles_Washington, should be 0
[19:34:11] Interior set to 7 for player Lean_Laptop, should be 0
[19:34:14] OnPlayerInteriorChange called for player Charles_Washington
[19:34:14] Interior set to 7 for player Charles_Washington, should be 7
[19:34:14] Interior set to 0 for player Lean_Laptop, should be 7
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)