new kamerak[3]public OnPlayerConnect(playerid){ kamerak[0] = SetTimerEx(\"mozgok\", 1000, 0, \"i\", playerid); return 1}public OnPlayerRequestClass(playerid, classid){ KillTimer(kamerak[0]); KillTimer(kamerak[1]); KillTimer(kamerak[2]); return 1;}public mozgok(playerid);public mozgok(playerid){//SetTimerEx(\"loginreg\",3000, 0, \"d\", playerid);SetPlayerCameraPos(playerid, 218.2873+10,-228.8469,8.8987, 1);SetPlayerCameraLookAt(playerid, 264.3181,-204.8240,3.6943, 1); kamerak[1] = SetTimerEx(\"mozgok2\",3000, 0, \"i\", playerid);return 1;}public mozgok2(playerid);public mozgok2(playerid){//SetTimerEx(\"loginreg\",3000, 0, \"d\", playerid);SetPlayerCameraPos(playerid, 218.2873+10,-228.8469,8.8987, 1);SetPlayerCameraLookAt(playerid, 264.3181,-204.8240,3.6943, 1); kamerak[2] = SetTimerEx(\"mozgok\",3000, 0, \"i\", playerid);return 1;}
ha true akkor mindig elindul, még ha lespawnolok akkor is...ha meg false akkor csak 1x megy...
public OnPlayerRequestClass(playerid, classid){ SetTimerEx(\"mozgok\", 1000, 0, \"dd\", playerid, 1); return 1}forward mozgok(playerid, lepes);public mozgok(playerid, lepes){//SetTimerEx(\"loginreg\",3000, 0, \"d\", playerid); if(lepes == 1) {SetPlayerCameraPos(playerid, 218.2873+10,-228.8469,8.8987, 1);SetPlayerCameraLookAt(playerid, 264.3181,-204.8240,3.6943, 1);SetTimerEx(\"mozgok\",3000, 0, \"dd\", playerid, 2);}else if(lepes == 2){SetPlayerCameraPos(playerid, 218.2873+10,-228.8469,8.8987, 1);SetPlayerCameraLookAt(playerid, 264.3181,-204.8240,3.6943, 1);}return 1;}
#include <a_samp>#define moving_speed 50#define X 0.0#define Y 0.0#define Z 0.0#define camx 0.0#define camy 0.0#define camz 0.0#define Anglez 180new Float:PAngle[MAX_PLAYERS], Camera[MAX_PLAYERS];public OnPlayerRequestClass(playerid, classid){ SetPlayerPos(playerid, X,Y,Z);SetPlayerFacingAngle(playerid, Anglez);SetPlayerCameraPos(playerid, camx,camy,camz);SetPlayerCameraLookAt(playerid, X,Y,Z);Camera[playerid] = SetTimerEx(\"MoveCamera\", moving_speed, true, \"i\", playerid);return 1;}forward MoveCamera(playerid);public MoveCamera(playerid){ SetPlayerCameraPos(playerid, X - 2 * floatsin(-PAngle[playerid], degrees), Y - 10 * floatcos(-PAngle[playerid], degrees), Z + 3); SetPlayerCameraLookAt(playerid, X, Y, Z + 0.5); PAngle[playerid] += 0.5; if (PAngle[playerid] >= 360.0) PAngle[playerid] = 0.0;}public OnPlayerSpawn(playerid){KillTimer(Camera[playerid]);return 1;}
Ez így nem teljesen jó, mert a Skin választóba mozog a kamera. Nekem valójába olyan kéne, hogy mikor loginolunk (Írjuk be a jelszót) akkor a háttérbe a kamera elmegy A-tól B-be. És ismétlõdik randomba.
switch(pos[playerid])//helyettswitch(random(3))
#include <a_samp>new Camera[MAX_PLAYERS], pos[MAX_PLAYERS];public OnPlayerConnect(playerid){Camera[playerid] = SetTimerEx(\"Change\", 3000, true, \"i\", playerid);pos[playerid] = 0;return 1;}forward Change(playerid);public Change(playerid){ TogglePlayerSpectating(playerid, 1); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);switch(pos[playerid]){ case 0:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 1;case 1:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 2;case 2:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 0;}return 1;}public OnPlayerRequestClass(playerid, classid){KillTimer(Camera[playerid]);return 1;}
Ez így nem teljesen jó, mert a Skin választóba mozog a kamera. Nekem valójába olyan kéne, hogy mikor loginolunk (Írjuk be a jelszót) akkor a háttérbe a kamera elmegy A-tól B-be. És ismétlõdik randomba. akkor..a koordinátákat majd te megadod, hogy hova menjen.ha pedig randomba szeretnéd, akkor switch(pos[playerid])//helyettswitch(random(3)) #include <a_samp>new Camera[MAX_PLAYERS], pos[MAX_PLAYERS];public OnPlayerConnect(playerid){Camera[playerid] = SetTimerEx(\"Change\", 3000, true, \"i\", playerid);pos[playerid] = 0;return 1;}forward Change(playerid);public Change(playerid){ TogglePlayerSpectating(playerid, 1); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z);switch(pos[playerid]){ case 0:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 1;case 1:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 2;case 2:InterpolateCameraLookAt(playerid, x, y, z, ide X, ide Y, ide Z, 2900, CAMERA_MOVE),pos[playerid] = 0;}return 1;}public OnPlayerRequestClass(playerid, classid){KillTimer(Camera[playerid]);return 1;} [/quote]Jó lett köszi.