SA-MP Forums Archive
Spawn at Home interior Problem - 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: Spawn at Home interior Problem (/showthread.php?tid=505781)



Spawn at Home interior Problem - lizter008 - 10.04.2014

PHP код:
        else if(GetPVarInt(playerid, "Hospital") == 8 && PlayerInfo[playerid][pInsurance] == 7)
        {
            
SetPlayerArmour(playerid, PlayerInfo[playerid][pSarmor]);
            
SetPlayerHealth(playerid, 50.0);
            
DeletePVar(playerid, "MedicBill");
            
GivePlayerCash(playerid, -250);
            
SendClientMessageEx(playerid, TEAM_CYAN_COLOR, "DOC: Your Medical Bill comes to $250, Have a nice day.");
            
SendClientMessageEx(playerid, COLOR_YELLOW, "Gold Donator: You have spawned at your home.");
            for(new 
i = 0; i < sizeof(HouseInfo); i++)
            {
                if(
PlayerInfo[playerid][pPhousekey] == i || PlayerInfo[playerid][pPhousekey2] == i)
                {
                    
Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                    
SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                    if(
HouseInfo[i][hCustomInterior] == 1)
                    {
                        
TogglePlayerControllable(playerid, 0);
                        
GameTextForPlayer(playerid, "Objects loading...", 4000, 5);
                        
SetPVarInt(playerid, "LoadingObjects", 1);
                        
SetTimerEx("SafeLoadObjects", 4000, 0, "d", playerid);
                    }
                    
SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                    
GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
                    
PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                    
PlayerInfo[playerid][pLocal] = i+6000;
                    
PlayerInfo[playerid][pVW] = i+60000;
                    
SetPlayerVirtualWorld(playerid, i+60000);
                }
            }
            
DeletePVar(playerid, "Hospital");
            
SetCameraBehindPlayer(playerid);
            
TogglePlayerControllable(playerid, 1);
        } 



Re: Spawn at Home interior Problem - Twizted - 10.04.2014

Try to freeze the player for some more time, or eventually spawn him a Y level above so he does not spawn underground(?).


Re: Spawn at Home interior Problem - superrobot48 - 10.04.2014

Quote:
Originally Posted by Twizted
Посмотреть сообщение
Try to freeze the player for some more time, or eventually spawn him a Y level above so he does not spawn underground(?).
he did the freezing part?

and use SetPlayerInterior (https://sampwiki.blast.hk/wiki/Function:SetPlayerInterior)


Re: Spawn at Home interior Problem - iBanner - 10.04.2014

He is using it already

Quote:

SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);

Quote:

PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];

Make sure the interior id you used is correct also the world, else you'll start falling nowhere. even you freeze the player.