SpectatingPlayer Problem
#1

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.
Reply
#2

How to you mean ? To change to an other ID or something ?
Reply
#3

Quote:
Originally Posted by Berlovan
View Post
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.
Reply
#4

You want to spectate the player outside the server ? Consult some hacking forums or something ....
Reply
#5

Quote:
Originally Posted by Berlovan
View Post
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.
Reply
#6

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
Reply
#7

Quote:
Originally Posted by Kyle_Olsen
View Post
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.
Reply
#8

(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;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)