SA-MP Forums Archive
Storing Camera Position - 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: Storing Camera Position (/showthread.php?tid=146263)



Storing Camera Position - Assyria - 06.05.2010

Hello!

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
 	new Float:x;
	new Float:y;
	new Float:z;
 	if(test[playerid] == 5)
 	{
    GetPlayerCameraPos(playerid, x, y, z);
	}
	return 1;
}
Код:
public OnPlayerSpawn(playerid)
{
	if(test[playerid]==5)
	{
	SetPlayerCameraPos(playerid, x,y,z);
	return false;
	}
= error 017: undefined symbol "x"

What kind of way should I use for adding those with variable?
I know I can't do it with variable[playerid] = GetPlayerCameraPos(playerid,x,y,z); -> SetPlayerCameraPos(playerid,variable[playerid);
Im sure it will give argument mismatch, right?

So some another way of doing that....?

Regards,
Assyria


Re: Storing Camera Position - Fj0rtizFredde - 06.05.2010

You could move the float, float:y, float:z to the top of the script or use the pvar system :P


Re: Storing Camera Position - Jochemd - 06.05.2010

Assyria can't answer right now. You can believe me: he tried, but didn't work. (I answer for him, we're in the same scripting team ).


Re: Storing Camera Position - Assyria - 06.05.2010

Quote:
Originally Posted by Jochemd
Assyria can't answer right now. You can believe me: he tried, but didn't work. (I answer for him, we're in the same scripting team ).
Actually moving floats to top of the script works


Re: Storing Camera Position - Killa_ - 06.05.2010

Quote:
Originally Posted by Assyria
Quote:
Originally Posted by Jochemd
Assyria can't answer right now. You can believe me: he tried, but didn't work. (I answer for him, we're in the same scripting team ).
Actually moving floats to top of the script works
What if more than 1 player dies at same time?


Re: Storing Camera Position - Jochemd - 06.05.2010

They will get their own positions, because the camera position is stored in Float for 'playerid'. (GetPlayerCameraPos(playerid,x,y,z); )

Note: A player dies never at the same time, because it's almost impossible that players die at the same milisecond (= what samp uses). Or there must be used a function that kills more players in once


Re: Storing Camera Position - Killa_ - 06.05.2010

Quote:
Originally Posted by Jochemd
They will get their own positions, because the camera position is stored in Float for 'playerid'. (GetPlayerCameraPos(playerid,x,y,z); )

Note: A player dies never at the same time, because it's almost impossible that players die at the same milisecond (= what samp uses). Or there must be used a function that kills more players in once
Takes few seconds to spawn a player, so if player A dies, then 1 second later player B dies, player A will have player B's camera position