// -------------------------------
// Mozgó kamera a karakterválasztóban
// Készítette GameStar
// www.gtaforum.hu
// 2012
// -------------------------------
#include <a_samp>
#if !defined InterpolateCameraPos
#error \"A fordítód nem tartalmazza a 0.3e fájlokat!\"
#endif
#define CAMERA_TIME 8000
forward CameraInterpolate(playerid);
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, \"cameraInterpolate\", 0);
SetPVarInt(playerid, \"skinTimer\", -1);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 2232.7930,-2458.5513,61.6104);
SetPlayerFacingAngle(playerid, 97.1613);
if(GetPVarInt(playerid,\"skinTimer\") == -1)
{
CameraInterpolate(playerid);
SetPVarInt(playerid, \"skinTimer\", SetTimerEx(\"CameraInterpolate\", CAMERA_TIME + 225, 1, \"i\", playerid));
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
KillTimer(GetPVarInt(playerid,\"skinTimer\"));
SetPVarInt(playerid, \"skinTimer\", -1);
SetCameraBehindPlayer(playerid);
return 1;
}
public CameraInterpolate(playerid)
{
switch(GetPVarInt(playerid,\"cameraInterpolate\"))
{
case 0:
{
InterpolateCameraPos(playerid, 2228.596435, -2462.059082, 62.675743, 2226.085937, -2457.546875, 62.636756, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 1:
{
InterpolateCameraPos(playerid, 2226.085937, -2457.546875, 62.636756, 2231.406250, -2456.153564, 61.862873, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 2:
{
InterpolateCameraPos(playerid, 2231.406250, -2456.153564, 61.862873, 2228.596435, -2462.059082, 62.675743, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
}
SetPVarInt(playerid, \"cameraInterpolate\", GetPVarInt(playerid,\"cameraInterpolate\") + 1);
if(GetPVarInt(playerid,\"cameraInterpolate\") > 2) SetPVarInt(playerid, \"cameraInterpolate\", 0);
return 1;
}
// -------------------------------
// Mozgó kamera a karakterválasztóban
// Készítette GameStar
// www.gtaforum.hu
// 2012
// -------------------------------
#include <a_samp>
#if !defined InterpolateCameraPos
#error \"A fordítód nem tartalmazza a 0.3e fájlokat!\"
#endif
#define CAMERA_TIME 8000
forward CameraInterpolate(playerid);
public OnPlayerConnect(playerid)
{
SetPVarInt(playerid, \"cameraInterpolate\", 0);
SetPVarInt(playerid, \"skinTimer\", -1);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 2232.7930,-2458.5513,61.6104);
SetPlayerFacingAngle(playerid, 97.1613);
if(GetPVarInt(playerid,\"skinTimer\") == -1)
{
CameraInterpolate(playerid);
SetPVarInt(playerid, \"skinTimer\", SetTimerEx(\"CameraInterpolate\", CAMERA_TIME + 225, 1, \"i\", playerid));
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
KillTimer(GetPVarInt(playerid,\"skinTimer\"));
SetPVarInt(playerid, \"skinTimer\", -1);
SetCameraBehindPlayer(playerid);
return 1;
}
public CameraInterpolate(playerid)
{
switch(GetPVarInt(playerid,\"cameraInterpolate\"))
{
case 0:
{
InterpolateCameraPos(playerid, 2228.596435, -2462.059082, 62.675743, 2226.085937, -2457.546875, 62.636756, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 1:
{
InterpolateCameraPos(playerid, 2226.085937, -2457.546875, 62.636756, 2231.406250, -2456.153564, 61.862873, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 2:
{
InterpolateCameraPos(playerid, 2231.406250, -2456.153564, 61.862873, 2228.596435, -2462.059082, 62.675743, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
}
SetPVarInt(playerid, \"cameraInterpolate\", GetPVarInt(playerid,\"cameraInterpolate\") + 1);
if(GetPVarInt(playerid,\"cameraInterpolate\") > 2) SetPVarInt(playerid, \"cameraInterpolate\", 0);
return 1;
}
Hogy lehet beállítani hogy hol legyen?Valaki segítene.
InterpolateCameraPos(playerid, 2228.596435, -2462.059082, 62.675743, 2226.085937, -2457.546875, 62.636756, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 1:
{
InterpolateCameraPos(playerid, 2226.085937, -2457.546875, 62.636756, 2231.406250, -2456.153564, 61.862873, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 2:
{
InterpolateCameraPos(playerid, 2231.406250, -2456.153564, 61.862873, 2228.596435, -2462.059082, 62.675743, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
És oda mit kell írni?InterpolateCameraPos(playerid, 2228.596435, -2462.059082, 62.675743, 2226.085937, -2457.546875, 62.636756, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 1:
{
InterpolateCameraPos(playerid, 2226.085937, -2457.546875, 62.636756, 2231.406250, -2456.153564, 61.862873, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 2:
{
InterpolateCameraPos(playerid, 2231.406250, -2456.153564, 61.862873, 2228.596435, -2462.059082, 62.675743, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
SetPlayerPos(playerid, 2232.7930,-2458.5513,61.6104);
SetPlayerFacingAngle(playerid, 97.1613);
A pozíciók helyére azt a pozt, ahová nézzen a kamera.. de ahhoz ezt is át kell írni:Átírtam de úgy is máshova dob be.
SetPlayerPos(playerid, 2232.7930,-2458.5513,61.6104);
SetPlayerFacingAngle(playerid, 97.1613);
És oda mit kell írni?
InterpolateCameraPos(playerid, 2228.596435, -2462.059082, 62.675743, 2226.085937, -2457.546875, 62.636756, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 1:
{
InterpolateCameraPos(playerid, 2226.085937, -2457.546875, 62.636756, 2231.406250, -2456.153564, 61.862873, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
case 2:
{
InterpolateCameraPos(playerid, 2231.406250, -2456.153564, 61.862873, 2228.596435, -2462.059082, 62.675743, CAMERA_TIME);
InterpolateCameraLookAt(playerid, 2232.7930,-2458.5513,61.6104, 2232.7930,-2458.5513,61.6104, CAMERA_TIME);
}
[/quote]
Ha utana neztel volna forumon,akkor hamar rajonnel.
http://wiki.sa-mp.com/wiki/InterpolateCameraPos
De leirom:
InterpolateCameraPos(playerid, ElsoX,ElsoY,ElsoZ,AhovaX,AhovaY,AhovaZ,ido, mod);
ElsoX- Az X pozicio ahonnan indul a kamera
ElsoY- Az Y pozicio ahonnan indul a kamera
ElsoZ- Az Z pozicio ahonnan indul a kamera
AhovaX- Az X pozicio ahova tart a kamera
AhovaY- Az Y pozicio ahova tart a kamera
AhovaZ- Az Z pozicio ahva tart a kamera
ido - az az ido,ami alatt meg jarja a kamera az utat(milisecundumba, 1masodperc=1000ms)
mod - azt nem pontosan tudom,viszont CAMERA_MOVE legyen
Ezeket ugy csinalod meg,hogy tegyuk fel jetpackel lementessz egy poziciot , utana mashova meg egyet.
savedpositions file bol kimasolod az alabbi cuccot.
Peldaul:
AddPlayerClass(28,2345.5229,596.8784,7.7813,179.4432,0,0,0,0,0,0);
Az arnyekos szamok az X,Y illetve a Z poziciok.
Ezeket beteszed az ElsoX,ElsoY es az ElsoZ helyere,majd ugyanezeket a szamokat kiszeded a masodik addplayerclassedbol is, es azt behelyezed az AhovaX,AhovaY,AhovaZ hez.
InterpolateCameraLookAt(playerid, ElsoX,ElsoY,ElsoZ,AhovaX,AhovaY,AhovaZ,ido, mod);
Ez is ugyan ugy van mint az InterpolateCameraPos,csak evel azt a poziciot valtod,hogy honnan hova nezzen a kamerad.Remelem segithettem.
------------------------------------------------------------------------------------------------
Am itt nekem ez buggos,vagy nem tudom mi lehet a gond.
Mikor tesom belep a szerveremre megy a kamera rendeen,de mikor lespawnol, akkor a kamera vissza all a karaktervallasztoba es ismet interpolate ozik.Mi lehet az oka?