Stop Player Camera?
#1

Guys, I am scripting & adding a command: /lspdcam
It works perfect but when I use /lspdcamoff It dosen't stops viewing but it gets to the computer where I want.
Can you tell me code for stopping it?

Check it:
Код:
CMD:lspdcamoff(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] == 1)
	{
		if (IsPlayerInRangeOfPoint(playerid,5.0,271.1183,107.9959,1004.6172) || IsPlayerInRangeOfPoint(playerid,5.0,1542.9828,-1654.8627,26.1621) || IsPlayerInRangeOfPoint(playerid,5.0,1542.9828,-1654.8627,26.1621 ))
		{
			TogglePlayerSpectating(playerid, 0);
			SetPlayerInterior(playerid,10);
			SetPlayerPos(playerid,1542.9828,-1654.8627,26.1621);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You aren't using the LSPD Camera.");
		}
	}
	return 1;
}
Reply
#2

You should Get the player position before typing /lspdcameron then save it, then when they type /lspdcameraoff it will load the position
Reply
#3

Dude I already get camera position, The all thing is that the camera dosent stops specing
And It loads position on /lspdcamoff but dosent stop to spec
Reply
#4

show the code of command where player starts using camera
Reply
#5

I just fixed lspdcamoff right now, I think it will work now
:
Код:
CMD:lspdcam(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] == 1)
	{
		if (IsPlayerInRangeOfPoint(playerid,3,271.1183,107.9959,1004.6172))
		{
		
            SetPlayerInterior(playerid,0);
			SetPlayerVirtualWorld(playerid,0);
			SetPlayerCameraPos(playerid,1542.9828,-1654.8627,26.1621);
			SetPlayerCameraLookAt(playerid,1542.9828,-1654.8627,26.1621,1);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You aren't in range of your LSPD Computers.");
		}
	}
	return 1;
}

CMD:lspdcamoff(playerid, params[])
{
	if(PlayerInfo[playerid][pMember] == 1)
	{
		if (IsPlayerInRangeOfPoint(playerid,5.0,271.1183,107.9959,1004.6172) || IsPlayerInRangeOfPoint(playerid,5.0,1542.9828,-1654.8627,26.1621) || IsPlayerInRangeOfPoint(playerid,5.0,1542.9828,-1654.8627,26.1621 ))
		{
			Spectating[playerid] = 0;
			Spectate[playerid] = 999;
			SetPVarInt(playerid, "SpecState", -1);
			SetPVarInt(playerid, "SpecOff", 1 );
			TogglePlayerSpectating( playerid, false );
			SetCameraBehindPlayer(playerid);
			SetPlayerInterior(playerid,10);
			SetPlayerPos(playerid,271.1183,107.9959,1004.6172);
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You aren't using the LSPD Camera.");
		}
	}
	return 1;
}
Reply
#6

Well when you set his position,you have to set his camera back ..so add
pawn Код:
SetCameraBehindPlayer(playerid);
And no need to toggle player spectating because when you used lspdcam you didnt use the function to spectate someone,so remove it,you just used camera ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)