how to setcamera?
#1

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?
Reply
#2

Do you have a Timer called Login or what?
Reply
#3

no I don't have anything, I am just asking how to code that? lol
Reply
#4

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;

Reply
#5

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

Then you have to use Camerapos and lookat at OnPlayerConnect
Reply
#7

Use timers. A timer for setting the player's view, and a timer for showing the dialog.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)