SetSpawnInfo Interior :)
#1

I am using this code:

pawn Код:
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
        SpawnPlayer(playerid);
    }
But when I enter the server I see grey screen,how can I fix it ?
Reply
#2

pawn Код:
PlayerInfo[playerid][pInt]
What's the default value for this?
Reply
#3

Quote:
Originally Posted by rhds
Посмотреть сообщение
pawn Код:
PlayerInfo[playerid][pInt]
What's the default value for this?
What do you mean? I am sorry I am new here ..
Reply
#4

Show the register code.
Reply
#5

Код:
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
        SpawnPlayer(playerid);
        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
    }
Try this.
Reply
#6

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Код:
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
        SpawnPlayer(playerid);
        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
    }
Try this.
The same :\

This is the whole public:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
        SetCameraBehindPlayer(playerid);
        TogglePlayerControllable(playerid, 1);
        SpawnPlayer(playerid);
 }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        SetSpawnInfo(playerid, 0, 0, 73.1880,-97.9988,1001.2363 ,179.5416, 0, 0, 0, 0, 0, 0); // // Set spawn coords
        SpawnPlayer(playerid);
    }
        ApplyAnimation(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);
        SetPlayerCameraPos(playerid,76.788,-99.487,1001.963);
        SetPlayerCameraLookAt(playerid,74.788,-98.450,1001.211);
       
    return 1;
}
And I would like to do that when the player is registed it shows him another screen and when the player is loggin its spawn him first and then he needs to login..
Reply
#7

Oke so first, you have camera code which runs weather they are registered or not, your second issue as I canny fix the first is that you need to place the spawn code in the dialog. If a any of that's wrong please clarify...
Reply
#8

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Код:
if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
        SpawnPlayer(playerid);
        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
    }
Try this.
Quote:
Originally Posted by IceCube!
Посмотреть сообщение
Oke so first, you have camera code which runs weather they are registered or not, your second issue as I canny fix the first is that you need to place the spawn code in the dialog. If a any of that's wrong please clarify...
I did like this:

pawn Код:
if(dialogid == DIALOG_LOGIN)
{
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                        GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                        SetPlayerColor(playerid, COLOR_WHITE);
                        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel],PlayerInfo[playerid][pPosx],PlayerInfo[playerid][pPosy],PlayerInfo[playerid][pPosz],PlayerInfo[playerid][pPosa],0,0,0,0,0,0);
                        SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
                        SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
                        SetCameraBehindPlayer(playerid);
                        TogglePlayerControllable(playerid, 1);
                        SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Please type your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
But its the same ..
[URL=http://imageshack.us/photo/my-images/197/gtasa20130505154547657.jpg/]

http://imageshack.us/photo/my-images/197...547657.jpg
Reply
#9

ApplyAnimation(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);
SetPlayerCameraPos(playerid,76.788,-99.487,1001.963);
SetPlayerCameraLookAt(playerid,74.788,-98.450,1001.211);


Remove these lines.
Reply
#10

Quote:
Originally Posted by IceCube!
Посмотреть сообщение
ApplyAnimation(playerid,"PED","SEAT_idle", 4.0, 1, 0, 0, 0, 0);
SetPlayerCameraPos(playerid,76.788,-99.487,1001.963);
SetPlayerCameraLookAt(playerid,74.788,-98.450,1001.211);


Remove these lines.
But I need those lines for the registration,do I need to put them in the dialog ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)