SA-MP Forums Archive
TogglePlayerSpectating - 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)
+--- Thread: TogglePlayerSpectating (/showthread.php?tid=531904)



TogglePlayerSpectating - Sarra - 15.08.2014

Hello , I want when "TogglePlayerSpectating(playerid, 1)" the player will have a spec view on the Hospital, I tried this
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerPos(playerid, 1173.1825, -1323.4525, 15.3953); //focus on this (those are the hospital coords
    TogglePlayerSpectating(playerid, 1); //focus on this
    SetTimerEx("DeathSpecTimer", 7000, 0, "i", playerid);
    PlayerData[playerid][pDeaths]++;
    PlayerData[killerid][pKills]++;
    PlayerData[playerid][pPosx]= 1173.1825;
    PlayerData[playerid][pPosy]= -1323.4525;
    PlayerData[playerid][pPosz]= 15.3953;
    return 1;
}
But it does not spectate the place I want,
PS: I don't want to spectate a player or a vehicle,


Re: TogglePlayerSpectating - MicroD - 15.08.2014

SetPlayerCameraPos
SetPlayerCameraLookAt


Re: TogglePlayerSpectating - Sarra - 15.08.2014

thanks
+rep as soon as I test it
----------
How do I prevent player from spawning,
After death, he should have a view on the hospital then 5 seconds later it should spawn, but while having the hospital view, he shouldn't be spawned


Re: TogglePlayerSpectating - MicroD - 15.08.2014

Код:
SetTimerEx("Dummy", 5000, false, "i", playerid);
after your code for setting camera.

And somewhere in script
Код:
forward Dummy(playerid);
public Dummy(playerid)
{
	SetCameraBehindPlayer(playerid);
}