Spectate, interrior worlds etc.
#2

pawn Код:
CMD:spectate3(playerid, params[])
{
    for(new i = 0; i < GetMaxPlayers(); i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(PlayerInfo[i][pLeader] != F_BALLAS) continue;
        SetPlayerInterior(playerid, GetPlayerInterior(i));
        SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(i));
        TogglePlayerSpectating(playerid, 1);
        if(IsPlayerInAnyVehicle(playerid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(i));
        else PlayerSpectatePlayer(playerid, i);
        break;
    }
    return 1;
}
You need to use TogglePlayerSpectate 'after' you use things like SetPlayerInterior and SetPlayerVirtualWorld.

With this code, you'll probably need code under OnPlayerStateChange to change the spectating type when the leader exits or enters a vehicle.
Reply


Messages In This Thread
Spectate, interrior worlds etc. - by GuitarMan - 22.12.2014, 22:58
Re: Spectate, interrior worlds etc. - by Threshold - 23.12.2014, 02:24
Re: Spectate, interrior worlds etc. - by GuitarMan - 23.12.2014, 07:38
AW: Spectate, interrior worlds etc. - by Flori - 23.12.2014, 08:45
Re: Spectate, interrior worlds etc. - by GuitarMan - 23.12.2014, 13:07

Forum Jump:


Users browsing this thread: 2 Guest(s)