forward CameraTimer(playerid); // On top of the script.
new CameraTimer[MAX_PLAYERS]; // Top of the script.
CameraTimer[playerid] = SetTimerEx("CameraTimer", 1000, true, "i", playerid); // Where you want the timer to start
public CameraTimer(playerid)
{
new count;
count++;
switch(count);
{
case 1:
{
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
}
case 2:
{
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
}
case 3: KillTimer(CameraTimer[playerid]); // At the last case, last time when you want it.
return 1;
}
//global variables
new TimerChangeView[MAX_PLAYERS];
new Float:RandomViewPos[][] =
{
{x,y,z},
{x,y,z},
{x,y,z}
};
new Flot:RandomViewLookAt[][] =
{
{x,y,z},
{x,y,z},
{x,y,z}
};
//when player enter the login area.
TimerChangeView[playerid] = SetTimerEx("ChangeView", Repeating Time, true, "i", playerid);
public ChangeView(playerid);
{
new view = random(sizeof(RandomViewsPos));
SetPlayerCameraPos(playerid, RandomViewPos[view][0], RandomViewPos[view][1], RandomViewPos[view][2]);
SetPlayerCameraPos(playerid, RandomViewLookAt[view][0], RandomViewLookAt[view][1], RandomViewLookAt[view][2]);
return 1;
}
//when player leave the login area.
KillTimer(TimerChangeView[playerid]);
SetCameraBehindPlayer(playerid);
pawn Код:
|
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10151) : error 028: invalid subscript (not an array or too many subscripts): "CameraTimer"
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10151) : error 017: undefined symbol "playerid"
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10151) : error 029: invalid expression, assumed zero
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10151) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
forward CameraTimer(playerid); // On top of the script.
new CameraTimerVar[MAX_PLAYERS]; // Top of the script.
CameraTimerVar[playerid] = SetTimerEx("CameraTimer", 1000, true, "i", playerid); // Where you want the timer to start
public CameraTimer(playerid)
{
new count;
count++;
switch(count);
{
case 1:
{
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
}
case 2:
{
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
}
case 3: KillTimer(CameraTimerVar[playerid]); // At the last case, last time when you want it.
return 1;
}
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(10157) : error 017: undefined symbol "playerid"
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56846) : error 001: expected token: "{", but found ";"
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56848) : error 014: invalid statement; not in switch
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56848) : warning 215: expression has no effect
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56848) : error 001: expected token: ";", but found ":"
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56848) : error 029: invalid expression, assumed zero
C:\GTA - San Andreas\Server\gamemodes\Rp11Back.pwn(56848) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.