Changing Places !
#1

Hey Guys !

I want to do that when the player connect to the server he will see changing images like when he needs to enter he's password the background will change.

Tnx Guys !!
Reply
#2

All you need is: SetTimerEx, SetPlayerCameraPos and SetPlayerCameraLookAt

Good luck
Reply
#3

https://sampwiki.blast.hk/wiki/SetPlayerCameraPos
https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt

Use this two.
Reply
#4

xD I know what I need but how can I do this after I got the X's,Y's,Z's ?
Reply
#5

pawn Код:
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;
}
Reply
#6

pawn Код:
//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);
Reply
#7

Quote:
Originally Posted by Berlovan
Посмотреть сообщение
pawn Код:
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;
}


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.
Reply
#8

pawn Код:
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;
}
This should fix it ^^ Sorry for that.
Reply
#9

pawn Код:
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.
:P
Reply
#10

Help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)