07.04.2017, 03:03
Apуs usar a funзгo TogglePlayerSpectating(playerid, 0) (que vocк deve usar em /poff), vai ter um delay atй o player respawnar. Entгo vocк deve fazer desse jeito:
No comando /espiar:
Em /poff
E vocк deve setar a posiзгo do player em OnPlayerSpawn:
No comando /espiar:
PHP код:
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
PlayerInfo[playerid][iPosx] = Pos[0];
PlayerInfo[playerid][iPosz] = Pos[1];
PlayerInfo[playerid][iPosy] = Pos[2];
PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
PlayerInfo[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid);
TogglePlayerSpectating(playerid, 1);
PHP код:
SetPVarInt(playerid, "poff", 1);
TogglePlayerSpectating(playerid, 0);
PHP код:
if (GetPVarInt(playerid, "poff")) {
// Setar posiзгo
SetPlayerPos(playerid, PlayerInfo[playerid][iPosx], PlayerInfo[playerid][iPosy], PlayerInfo[playerid][iPosz]);
// Interior/World
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVirtualWorld]);
DeletePVar(playerid, "poff");
}