Quote:
Originally Posted by JasonRiggs
So basically you need a delay to make a gap between the changing of the target's variable and the spectator variables it's just a little timer like that
PHP код:
foreach(new i : Player)
{
if(PlayerInfo[i][pSpectating] == playerid)
{
SetTimerEx("SpectateTimer", 500, false, "ii", i, playerid);
}
}
and its function to be like that..
PHP код:
forward SpectateTimer(playerid, targetid);
public SpectateTimer(playerid, targetid)
{
if(PlayerInfo[playerid][pSpectating] == targetid)
{
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
if(IsPlayerInAnyVehicle(targetid))
{
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
}
else
{
PlayerSpectatePlayer(playerid, targetid);
}
}
}
I tested this one and it worked for me.
|
I appreciate this a lot but it seems like a very inefficient way to do it like this.. Nobody has it like that from the stuff I could find on ******, why doesn't my code work when it's pretty much the same?