Why does anyone who logs in infinitely fall?
#1

Basically the first time you register your account it's all fine and dandy and you're spawned at the point. But when you relog and come back you just infinitely fall after the login menu. I don't really know why, can someone help me?

I'll post some of this code as maybe it'll help:

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    new 
tmp2[256];
    if(
IsPlayerConnected(playerid))
    {
        if(
dialogid == 1)
        {
            if (!
response) return Kick(playerid);
             if(
response)
              {
                   if(!
strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Register","Welcome to Chicago Streets Roleplay.\n\nPlease register your account by typing your password below.","Register","Quit");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                 
INI_WriteInt(File,"Password",udb_hash(inputtext));
                 
INI_WriteInt(File,"Cash",0);
                 
INI_WriteInt(File,"Skin",0);
                 
INI_WriteInt(File,"Level",0);
                 
INI_WriteInt(File,"Int",0);
                 
INI_WriteInt(File,"VW",0);
                 
INI_WriteInt(File,"Admin",0);
                 
INI_WriteInt(File,"SecKey",0);
                 
INI_WriteInt(File,"Kills",0);
                 
INI_WriteInt(File,"Deaths",0);
                   
INI_WriteFloat(File,"FacingAngle",0);
                
INI_WriteFloat(File,"Health",0);
                
INI_WriteFloat(File,"Armour",0);
                
INI_WriteFloat(File,"LastX",0);
                
INI_WriteFloat(File,"LastY",0);
                
INI_WriteFloat(File,"LastZ",0);
                 
INI_Close(File);
                
SetSpawnInfo(playerid0299982.1890, -1624.258314.952690000000);
                   
SpawnPlayer(playerid);
                
ResetPlayerWeapons(playerid);
                
SetPlayerInterior(playerid,0);
                
SetPlayerVirtualWorld(playerid0);
                
SetPlayerScore(playerid1);
                
GivePlayerMoney(playerid1000);
                
SetCameraBehindPlayer(playerid);
                
PlayerInfo[playerid][pSkin] = 299;
                
PlayerInfo[playerid][pInt] = 0;
                
PlayerInfo[playerid][pVW] = 0;
                
PlayerInfo[playerid][pLevel] = 1;
                
SendClientMessage(playeridCOLOR_YELLOW"Account registered, you have been logged in automatically!");
                   
format(tmp2sizeof(tmp2), "~w~Welcome ~n~~y~   %s"GetName(playerid));
                
GameTextForPlayer(playeridtmp250001);
                
TogglePlayerSpectating(playerid0);
            }
           }
        if(
dialogid == 2)
           {
            if ( !
response ) return Kick playerid );
               if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                 {
                      
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                      
SetSpawnInfo(playerid0PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pLastX], PlayerInfo[playerid][pLastY], PlayerInfo[playerid][pLastZ], PlayerInfo[playerid][pFacingAngle], 000000);
                    
SpawnPlayer(playerid);
                      
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
                      
SetPlayerSkin(playeridPlayerInfo[playerid][pSkin]);
                      
SetPlayerScore(playeridPlayerInfo[playerid][pLevel]);
                    
SetPlayerHealth(playeridPlayerInfo[playerid][pHealth]);
                    
SetPlayerArmour(playeridPlayerInfo[playerid][pArmour]);
                    
SetPlayerInterior(playeridPlayerInfo[playerid][pInt]);
                    
SetPlayerVirtualWorld(playeridPlayerInfo[playerid][pVW]);
                       
format(tmp2sizeof(tmp2), "~w~Welcome ~n~~y~   %s"GetName(playerid));
                    
GameTextForPlayer(playeridtmp250001);
                    if(
PlayerInfo[playerid][pAdmin] >= 1)
                    {
                        
format(tmp2sizeof(tmp2), "SERVER: You are logged in as a Level %d Admin.",PlayerInfo[playerid][pAdmin]);
                        
SendClientMessage(playeridCOLOR_WHITE,tmp2);
                        
ShowPlayerDialog(playerid3,DIALOG_STYLE_INPUT,"Admin Login","Please provide your security code for your admin account to be authorized.\n\nPlease enter your security code below.","Login","Quit"); //admin authorization
                    
}
                 }
                   else
                   {
                       
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Welcome back to CHANGEME.\n\nThat name is registered. Please enter your password below.","Login","Quit");
                   }
                   return 
1;
            }
        } 
Edit: I'm not quite sure the problem lies in this code either but if you need more just let me know.
Reply


Messages In This Thread
Why does anyone who logs in infinitely fall? - by K9IsGodly - 25.04.2015, 01:41
Re: Why does anyone who logs in infinitely fall? - by Crayder - 25.04.2015, 01:53
Re: Why does anyone who logs in infinitely fall? - by K9IsGodly - 25.04.2015, 01:57
Re: Why does anyone who logs in infinitely fall? - by Crayder - 25.04.2015, 02:01
Re: Why does anyone who logs in infinitely fall? - by K9IsGodly - 25.04.2015, 02:11
Re: Why does anyone who logs in infinitely fall? - by K9IsGodly - 25.04.2015, 02:43

Forum Jump:


Users browsing this thread: 1 Guest(s)