#define CAMERA_CUT 2
#define CAMERA_MOVE 1
native SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z, cut = CAMERA_CUT);
native AttachPlayerObjectToVehicle(playerid, objectid, vehicleid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:RotZ);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER) // Quando o Player Apertar Enter em um Veiculo
{
// Objeto Criado, ( Defina Ela no Caso, cow_object. )
new cow_object = CreatePlayerObject(playerid, 16442, 0, 0, 0, 0, 0, 0);
AttachPlayerObjectToVehicle(playerid, cow_object/*Objeto Defino*/, GetPlayerVehicleID(playerid), 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
}
}// Resumindo ao Entrar no Carro, o Objeto й Setado.
native InterpolateCameraPos(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
native InterpolateCameraLookAt(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
if(!strcmp(cmdtext,"/camera", true))
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraLookAt(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE); // CorX, CorY, CorZ+50, CorX, CorY- CorZ+50, Tempo no caso, Definido Acima, Para Camera se Mover.
InterpolateCameraPos(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE); // CorX, CorY, CorZ+50, CorX, CorY- CorZ+50, Tempo no caso, Definido Acima, Para Camera se Mover.
return true;
}
if(!strcmp(cmdtext,"/saircamera", true))
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
return true;
}
native AttachCameraToObject(playerid, objectid);
native AttachCameraToPlayerObject(playerid, playerobjectid);
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/setar", false))
{
new Objeto = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToObject(playerid, Objeto);
SendClientMessage(playerid, -1, "Sua cвmera Foi ligada em um objeto.");
return true;
}
if(!strcmp(cmdtext,"/b", true)) // faz o player sair da cвmera onde estб vendo.
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
return true;
}
return false;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/setar", false))
{
new PlayerObjeto = CreatePlayerObject(playerid, 1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToPlayerObject(playerid, PlayerObjeto );
SendClientMessage(playerid, 0xFFFFFFAA, "Sua cвmera Foi ligada em um objeto.");
return true;
}
if(!strcmp(cmdtext,"/b", true)) // faz o player sair da cвmera onde estб vendo.
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
return true;
}
return false;
}
native GetPlayerVersion(playerid, const version[], len);
public OnPlayerConnect(playerid)
{
new Celula[40];
GetPlayerVersion(playerid, Celula, sizeof(Celula));
format(Celula, sizeof(Celula), "Sua Versгo do SAMP й: %s", Celula);
SendClientMessage(playerid, -1, Celula);
return true;
}
// Por Jonathan Feitosa
#include <a_samp>
#define TIMER ( 60000 * 1 ) // tempo para mover a cвmera ( 1 minuto )
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("FS Explicaзхes 0.3e Carregado !");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
main()
{
print("\n----------------------------------");
print("Criado Por Jonathan Feitosa");
print("----------------------------------\n");
}
public OnGameModeInit()
{
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
new Celula[40];
GetPlayerVersion(playerid, Celula, sizeof(Celula));
format(Celula, sizeof(Celula), "Sua Versгo do SAMP й: %s", Celula);
SendClientMessage(playerid, -1, Celula);
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/camera", true)) // (Por DarkScripter)
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraLookAt(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE); // CorX, CorY, CorZ+50, CorX, CorY- CorZ+50, Tempo no caso, Definido Acima, Para Camera se Mover.
InterpolateCameraPos(playerid, 2045.2523, 1689.3992, 10.3990 + 50, 1336.8778, -2271.4685, 13.1868 + 50, TIMER, CAMERA_MOVE); // CorX, CorY, CorZ+50, CorX, CorY- CorZ+50, Tempo no caso, Definido Acima, Para Camera se Mover.
return true;
}
if(!strcmp(cmdtext,"/saircamera", true))
{
TogglePlayerSpectating(playerid, false);
SetCameraBehindPlayer(playerid);
return true;
}
if(!strcmp(cmdtext, "/setar", false))
{
new Objeto = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToObject(playerid, Objeto);
SendClientMessage(playerid, -1, "Sua cвmera Foi ligada em um objeto, para sair, /saircamera.");
return true;
}
if(!strcmp(cmdtext, "/setar2", false))
{
new PlayerObjeto = CreatePlayerObject(playerid, 1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToPlayerObject(playerid, PlayerObjeto );
SendClientMessage(playerid, 0xFFFFFFAA, "Sua cвmera Foi ligada em um objeto, para sair, /saircamera.");
return 1;
}
return false;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new cow_object = CreatePlayerObject(playerid, 16442, 0, 0, 0, 0, 0, 0);
AttachPlayerObjectToVehicle(playerid, cow_object, GetPlayerVehicleID(playerid), 0.0, 0.0, 1.0, 0.0, 0.0, 0.0);
}
return 1;
}
Bom Tuturial, mas agora jб estб tudo virando para o 0.3e RC2, fala-se mais do 0.3e RC2 do que 0.3d RC3
|