05.10.2009, 07:46
Hi,
i tried the PlayerSpectatePlayer/PlayerSpectateVehicle Function. Basicly what i did is a command to start spectating any player.
Another Command to stop spectating
Now there are some further checks in OnPlayerStateChange, to spectate Vehicle/Player of Player enters/exits a car. And there is another check to set the interior in OnPlayerInteriorChange. The spectating if a Player enters/exits a vehicle works well, so i think theres no need to change the code, but ill show the code of OnPlayerInteriorChange (see below)
So thats all, except the StateChangepart, which works. Basicly everything works fine, there are no problems. Im able to spectate the player or his vehicle unless he is in any Interior. If a start spectating (using the command) a player, who is inside an interior, i see just a blue screen (the sky or something like that) although i set the Interior (see code above). It happens once (i think it was the SFPD Jail), that it worked and i tried with a few interiors already. The same happens (blue sky) if the Player enters an interior while im spectating him, altough (again), im setting the interior. I used Debug messages in OnPlayerInteriorChange to see if its called and it is.
I dont know what it is, i also looked through the Code several times, but witout success. So maybe one of you know whats wrong or is this just a 0.3 Bug? I didnt tested in 0.2, so im not sure.
Hope you can help me
i tried the PlayerSpectatePlayer/PlayerSpectateVehicle Function. Basicly what i did is a command to start spectating any player.
Код:
// Get Parameters (other player) TogglePlayerSpectating(playerid, 1); if(IsPlayerInAnyVehicle(otherplayer)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(otherplayer)); else PlayerSpectatePlayer(playerid, otherplayer); SetPlayerInterior(playerid, GetPlayerInterior(otherplayer)); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(otherplayer)); pSpectating[playerid] = otherplayer;
Код:
TogglePlayerSpectating(playerid, 0); pSpectating[playerid] = MAX_PLAYERS;
Код:
for(new i = 0; i < MAX_PLAYERS; i++) { if(!IsPlayerConnected(i)) continue; if(pSpectating[i] == playerid) { SetPlayerInterior(i, newinteriorid); SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid)); } }
I dont know what it is, i also looked through the Code several times, but witout success. So maybe one of you know whats wrong or is this just a 0.3 Bug? I didnt tested in 0.2, so im not sure.
Hope you can help me