SA-MP Forums Archive
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(01958.331343.1215.36269.1526362815000); // CJ
    
AddPlayerClass(11958.331343.1215.36269.1526362815000); // The Truth
    
return 1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
   switch(
classid)
   {
            case 
0:
            {
                
SetPlayerInterior(playerid0);
                
SetPlayerPos(playerid160.0873,1934.8828,33.8984);
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerCameraPos(playerid153.28011941.614136.2631);
                
SetPlayerFacingAngleplayerid44.4151);
                
SetPlayerCameraLookAt(playerid153.98971940.902335.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(01958.331343.1215.36269.1526362815000); // CJ
    
AddPlayerClass(11958.331343.1215.36269.1526362815000); // The Truth
    
return 1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
   switch(
classid)
   {
            case 
0:
            {
                
SetPlayerInterior(playerid0);
                
SetPlayerPos(playerid160.0873,1934.8828,33.8984);
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerCameraPos(playerid153.28011941.614136.2631);
                
SetPlayerFacingAngleplayerid44.4151);
                
SetPlayerCameraLookAt(playerid153.98971940.902335.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.