how to setcamera? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to setcamera? (
/showthread.php?tid=619298)
how to setcamera? -
MrCesar - 16.10.2016
Hello guys, I wanted to know how to script the interface that if I just connect to the server (it shows playerdialogs), it will show the background I want? I tried doing SetCameraPos and SetCameraLookAt on OnGamemodeInit but it doesn't recognize playerid, and if I set it on OnPlayerConnect/RequestClass it just doesn't show until I enter my password..how to fix that one?
Thanks in advance.
EDIT: How can I make a player freeze once he spawns for 3 seconds (to load objects) and how do I spawn the player right after I click the "login button" on my dialogs, and without the requestclass function?
Re: how to setcamera? -
TaiRinsuru - 16.10.2016
Do you have a Timer called Login or what?
Re: how to setcamera? -
MrCesar - 16.10.2016
no I don't have anything, I am just asking how to code that? lol
Re: how to setcamera? -
IceBilizard - 16.10.2016
First of all you need to make classes on OnGameModeInit()
Use >
https://sampwiki.blast.hk/wiki/AddPlayerClass
Then you must use SetCameraPos and SetCameraLookAt in
https://sampwiki.blast.hk/wiki/OnPlayerRequestClass
here is an example
PHP код:
public OnGameModeInit()
{
// Players can spawn with either the CJ skin (0) or The Truth skin (1).
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ
AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 160.0873,1934.8828,33.8984);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerCameraPos(playerid, 153.2801, 1941.6141, 36.2631);
SetPlayerFacingAngle( playerid, 44.4151);
SetPlayerCameraLookAt(playerid, 153.9897, 1940.9023, 35.9830);
}
}
return 1;
}
Re: how to setcamera? -
MrCesar - 16.10.2016
Quote:
Originally Posted by IceBilizard
First of all you need to make classes on OnGameModeInit()
Use > https://sampwiki.blast.hk/wiki/AddPlayerClass
Then you must use SetCameraPos and SetCameraLookAt in
https://sampwiki.blast.hk/wiki/OnPlayerRequestClass
here is an example
PHP код:
public OnGameModeInit()
{
// Players can spawn with either the CJ skin (0) or The Truth skin (1).
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ
AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 0:
{
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 160.0873,1934.8828,33.8984);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerCameraPos(playerid, 153.2801, 1941.6141, 36.2631);
SetPlayerFacingAngle( playerid, 44.4151);
SetPlayerCameraLookAt(playerid, 153.9897, 1940.9023, 35.9830);
}
}
return 1;
}
|
I am not sure you understood what I mean, I meant that when a player logs in (connects to server) before it will show the password dialog, the camera look will be changed, like on the very beggining, and only later the dialogbox will appear..
Re: how to setcamera? -
IceBilizard - 16.10.2016
Then you have to use Camerapos and lookat at OnPlayerConnect
Re: how to setcamera? -
Threshold - 16.10.2016
Use timers. A timer for setting the player's view, and a timer for showing the dialog.