SpectatingPlayer Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SpectatingPlayer Problem (
/showthread.php?tid=278356)
SpectatingPlayer Problem -
Improvement™ - 21.08.2011
Okay, I am currently experiencing something wierd with PlayerSpectatePlayer, but there should be an easy solution to slove this.
I would be hard to explain so i'll try to do it with examples.
Improvement has died.
TogglePlayerSpectating has been toggled for
Improvement
Improvement is spectating
DarkGamer
DarkGamer has left the server. (quit)
Improvement respawns instantly.
As you probably noticed that I respawned right after
DarkGamer left the server, how could this be prevented and let
Improvement stay in "Spectating Mode"?
Thanks in Advanced.
Re: SpectatingPlayer Problem -
sleepysnowflake - 21.08.2011
How to you mean ? To change to an other ID or something ?
Re: SpectatingPlayer Problem -
Improvement™ - 21.08.2011
Quote:
Originally Posted by Berlovan
How to you mean ? To change to an other ID or something ?
|
I can script this myself, but I want myself to stay in the "Spectating Mode" once the player I am spectating is leaving the server.
Re: SpectatingPlayer Problem -
sleepysnowflake - 21.08.2011
You want to spectate the player outside the server ? Consult some hacking forums or something ....
Re: SpectatingPlayer Problem -
Improvement™ - 21.08.2011
Quote:
Originally Posted by Berlovan
You want to spectate the player outside the server ? Consult some hacking forums or something ....
|
What are you even talking about? Because your not being much of a help at all.
Could you please stop posting on this topic, if you do not know what its about.
Thanks in advanced.
Re: SpectatingPlayer Problem -
Kyle_Olsen - 21.08.2011
Use OnPlayerDisconnect.
Have a variable saving what player you are spectating, then have a loop in OnPlayerDisconnect checking if the player is being spectated. If is, TogglePlayerSpectating and find someone else to spectate
Re: SpectatingPlayer Problem -
Improvement™ - 21.08.2011
Quote:
Originally Posted by Kyle_Olsen
Use OnPlayerDisconnect.
Have a variable saving what player you are spectating, then have a loop in OnPlayerDisconnect checking if the player is being spectated. If is, TogglePlayerSpectating and find someone else to spectate 
|
I was already thinking of something like this, but still hoping that if someone would come up with another something instead.
But I will try to try this methode, Thanks anyways kyle

.
Topic still open for other suggestions.
Re: SpectatingPlayer Problem -
=WoR=Varth - 22.08.2011
(With foreach):
pawn Code:
new Spectate[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Spectate[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
if(Spectate[playerid] != 0)
{
PlayerSpectatePlayer(Spectate[playerid],Iter_Random(Player));
}
return 1;
}
//Inside your command
Spectate[playerid] == targetid;