Teleports wrong player on timer? +rep
#1

Okay so i want to make switching cameras like it shows one place then cuts to another.

Here is the basic script.

Top of the script
Код:
forward cam1(playerid);
Part of OnPlayerKeyStateChange. This is where the timer is activated.
Код:
if( ( newkeys & KEY_YES ) && !( oldkeys & KEY_YES ) )
	{
		
                       SetTimer("cam1", 2000, false);
			TogglePlayerControllable(playerid, 1);
                       PlayerPlaySound(playerid, 5201, 0,0,0);
			
			return 1;
	
	}
And finally the timer.
Код:
public cam1(playerid)
{

    SetPlayerPos(playerid, 5542.68701, 792.31042, 10.47427);
    SetPlayerCameraLookAt(playerid, 5545.2988,793.5884,9.8471);
    SetPlayerCameraPos(playerid, 5565.4932,793.5170,8.4675);
    TogglePlayerControllable(playerid, 0);
	return 1;
	}
Now it seems everything is working, it compiles completely fine. But it teleports the wrong player on the timer. I want it to set the camera to the location 2 seconds after the player presses Y.

Can anybody tell me where i am going wrong? +rep
Reply
#2

pawn Код:
SetTimerEx("cam1", 2000, false, "i",playerid);
Reply
#3

Haha! Thankyou !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)