Class Selection Camera -
ZBits - 22.12.2013
Hello, Ive got a little problem regarding my class selection
my code
pawn Code:
SetPlayerPos(playerid,1481.1670,-1767.8672,18.7958);
SetPlayerFacingAngle(playerid,0.0816);
InterpolateCameraPos(playerid, 1467.488403, -1620.849975, 43.885395, 1481.209350, -1758.466552, 19.101547, 8000);
InterpolateCameraLookAt(playerid, 1468.074707, -1625.690917, 42.779933, 1481.169799, -1763.463745, 18.939575, 8000);
The problem is, whenever i change my skin(click the next arrow) in the class selection, my camera movement starts from the start again, i want to to be at the same spot and only the skin to change when we click the arrow.
Thanks in advance.
Re: Class Selection Camera -
CutX - 22.12.2013
why not put that camera movement stuff in side an if statement?
for example, the player connects to your server, you set some var "firstrun = 1" after your camera stuff (or use some already existing var temporary for just that purpose which is more resource friendly)
and once disconnected or spawned, you set it to 0
should look like
PHP Code:
if(firstrun[playerid] == 1)
{
InterpolateCameraPos(playerid, 1467.488403, -1620.849975, 43.885395, 1481.209350, -1758.466552, 19.101547, 8000);
InterpolateCameraLookAt(playerid, 1468.074707, -1625.690917, 42.779933, 1481.169799, -1763.463745, 18.939575, 8000);
}
ya, well, something like that maybe
you mainly just need 2 make sure that these camera movements take place just once
Re: Class Selection Camera -
ZBits - 22.12.2013
^ ye, i dont know how to make the camera move once only.
Re: Class Selection Camera -
CutX - 22.12.2013
PHP Code:
new firstrun[MAX_PLAYERS];//some global var
public OnPlayerConnect(playerid)
{
//............
firstrun[playerid] = 1;
//............
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
//............
if(firstrun[playerid])
{
//do your camera stuff here
firstrun[playerid] = 0;
}
//............
return 1;
}
and when some1 want to change his class, you just set firstrun to 1 for that playerid
but thats just a workaround though... you could also do something else but i can't remember, sorry
i paused samp 'n scripting for like 6 months i remember most of the stuff but not everything :/
Re: Class Selection Camera -
ZBits - 22.12.2013
It Worked!, thanks
+rep