SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 10/04/2014, 07:49 AM   #1
lizter008
Little Clucker
 
Join Date: Dec 2013
Posts: 35
Reputation: 0
Default Spawn at Home interior Problem

PHP Code:
        else if(GetPVarInt(playerid"Hospital") == && PlayerInfo[playerid][pInsurance] == 7)
        {
            
SetPlayerArmour(playeridPlayerInfo[playerid][pSarmor]);
            
SetPlayerHealth(playerid50.0);
            
DeletePVar(playerid"MedicBill");
            
GivePlayerCash(playerid, -250);
            
SendClientMessageEx(playeridTEAM_CYAN_COLOR"DOC: Your Medical Bill comes to $250, Have a nice day.");
            
SendClientMessageEx(playeridCOLOR_YELLOW"Gold Donator: You have spawned at your home.");

            for(new 
0sizeof(HouseInfo); i++)
            {
                if(
PlayerInfo[playerid][pPhousekey] == || PlayerInfo[playerid][pPhousekey2] == i)
                {
                    
Streamer_UpdateEx(playeridHouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                    
SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                    if(
HouseInfo[i][hCustomInterior] == 1)
                    {
                        
TogglePlayerControllable(playerid0);
                        
GameTextForPlayer(playerid"Objects loading..."40005);
                        
SetPVarInt(playerid"LoadingObjects"1);
                        
SetTimerEx("SafeLoadObjects"40000"d"playerid);
                    }
                    
SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                    
GameTextForPlayer(playerid"~w~Welcome Home"50001);
                    
PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                    
PlayerInfo[playerid][pLocal] = i+6000;
                    
PlayerInfo[playerid][pVW] = i+60000;
                    
SetPlayerVirtualWorld(playeridi+60000);
                }
            }

            
DeletePVar(playerid"Hospital");
            
SetCameraBehindPlayer(playerid);
            
TogglePlayerControllable(playerid1);
        } 

lizter008 is offline   Reply With Quote
Old 10/04/2014, 08:02 AM   #2
Twizted
High-roller
 
Join Date: Feb 2011
Location: Portugal
Posts: 1,474
Reputation: 289
Default Re: Spawn at Home interior Problem

Try to freeze the player for some more time, or eventually spawn him a Y level above so he does not spawn underground(?).
Twizted is offline   Reply With Quote
Old 10/04/2014, 08:18 AM   #3
superrobot48
Big Clucker
 
Join Date: Apr 2013
Location: Las Venturas
Posts: 182
Reputation: 21
Default Re: Spawn at Home interior Problem

Quote:
Originally Posted by Twizted View Post
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 (http://wiki.sa-mp.com/wiki/Function:SetPlayerInterior)
superrobot48 is offline   Reply With Quote
Old 10/04/2014, 08:22 AM   #4
iBanner
Huge Clucker
 
iBanner's Avatar
 
Join Date: Mar 2014
Location: Galaxy
Posts: 202
Reputation: 28
Default Re: Spawn at Home interior Problem

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.
__________________
Under Development

iBanner is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't spawn at home MTCool Scripting Help 4 22/02/2012 11:15 PM
Problem with Home Owner RenisiL Scripting Help 0 11/10/2011 10:08 AM


All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.