16.03.2012, 03:20
OnPlayerMovedCamera - The callback's 0.3e RC2 above Only
How to use(exemple)
pawn Код:
/*
*
* OnPlayerMovedCamera - Somente na versгo 0.3e RC2 ou superior.
*
* Crйditos: DarkScripter
* - Nгo retire os crйditos.
*
*
*/
new bool:Chamed_Int[MAX_PLAYERS char] = false;
forward _FinisOnPlayerMovedCamera(playerid);
forward OnPlayerMovedCamera(playerid);
public _FinisOnPlayerMovedCamera(playerid)
{
Chamed_Int{playerid} = false;
CallLocalFunction("OnPlayerMovedCamera", "d", playerid);
}
stock InterpolateCameraLookAt_(p, Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, time, style)
{
InterpolateCameraLookAt(p, Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, time, style);
return !Chamed_Int{p} ? (SetTimerEx("_FinisOnPlayerMovedCamera", time, false, "d", p), Chamed_Int{p} = true) : true;
}
stock InterpolateCameraPos_(p, Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, time, style)
{
InterpolateCameraPos(p, Float:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2, time, style);
return !Chamed_Int{p} ? (SetTimerEx("_FinisOnPlayerMovedCamera", time, false, "d", p), Chamed_Int{p} = true) : true;
}
#define InterpolateCameraLookAt InterpolateCameraLookAt_
#define InterpolateCameraPos InterpolateCameraPos_
pawn Код:
#include <a_samp>
#define TIMER ( 60000 * 1 ) // time to move cam ( 1 minute )
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/cam", true))
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraLookAt(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE);
InterpolateCameraPos(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE);
return true;
}
if(!strcmp(cmdtext,"/b", true))
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
return true;
}
return true;
}
public OnPlayerMovedCamera(playerid)
{
SendClientMessage(playerid, -1,"Arrived.");
return 1;
}