Spectating Players
#1

I have a spectate script which I made, Where it saves the admins co ordinates before it spectates them.

After the /specoff I want it to put them into the co ordinates placed.

But spec off seems to call onplayerspawn.

Anyone Help?
Reply
#2

You could add a boolean which you check whenever you use /specoff.

In your OnPlayerSpawn, check if the bool is set.
If it's set, only reset it.
If it's not set, run the other code.

This won't block OnPlayerSpawn to happen after /specoff, but it blocks the OnPlayerSpawn-code to run.

Код:
new bool:SpecOffCheck;

...

// in your OnPlayerCommandText (under the command /specoff)
SpecOffCheck = true;

...

// in your OnPlayerSpawn:
public OnPlayerSpawn(playerid)
{
if (SpecOffCheck == true)
{
SpecOffCheck = false;
}
else
{
//Your other OnPlayerSpawn code here
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)