Storing Camera Position
#1

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

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

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 ).
Reply
#4

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)