Bought a house but not spawn there.
#1

When i buy a house in my game and logout And comming back.
Im not spawning at my house Can someone explain me How to fix this.
Or what i need to do.Thank you. This code gives no error buy when i bought a house and relog i dont spawn at my house so how to fixt this?
Код:
                                       new house = PlayerInfo[playerid][pHouse1];

	   		SetSpawnInfo( playerid, 0, PlayerInfo[playerid][pSkin], HouseInfo[house]    [hEnterX],HouseInfo[house][hEnterY],HouseInfo[house][hEnterZ],86.1958,0,0,0,0,0,0 );     
		             SpawnPlayer(playerid);
		             SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome back! At your house!");
		             TextDrawShowForPlayer(playerid, Forums);
			SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWLevel]);
			SetPlayerHealth(playerid,  PlayerInfo[playerid][pHealth]);
			SetPlayerArmour(playerid,  PlayerInfo[playerid][pArmour]);
			SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFighting]);
			SetPlayerMapIcon( playerid, 1, -2270.50, -155.95, 35.32, 54, 0); // Gym ! Created By 			SetPlayerMapIcon( playerid, 2, -2026.61, -102.05, 35.16, 36, 0); // School ! Created 			             SetPlayerMapIcon( playerid, 3, -1995.03, 91.03, 27.68, 52, 0); // Money ! Created By 			SetPlayerMapIcon( playerid, 4, -2766.55, 375.62, 6.33, 12, 0); // Catalina ! Created 			             SetPlayerMapIcon( playerid, 5, -2648.89, 376.07, 6.15, 19, 0); // Red Flag ! Created 			             SetPlayerMapIcon( playerid, 6, -2719.29, -319.08, 7.84, 36, 0); // School ! 			                          if(PlayerInfo[playerid][pVIP] == 0)
			{
				SetPlayerSkillLevel(playerid, 0, 0);
				SetPlayerSkillLevel(playerid, 1, 0);
				SetPlayerSkillLevel(playerid, 2, 0);
				SetPlayerSkillLevel(playerid, 3, 0);
				SetPlayerSkillLevel(playerid, 4, 0);
				SetPlayerSkillLevel(playerid, 5, 0);
				SetPlayerSkillLevel(playerid, 6, 0);
				SetPlayerSkillLevel(playerid, 7, 0);
				SetPlayerSkillLevel(playerid, 8, 0);
				SetPlayerSkillLevel(playerid, 9, 0);
				SetPlayerSkillLevel(playerid, 10, 0);
			}
			TextDrawHideForPlayer(playerid, topblack);
	    	TextDrawHideForPlayer(playerid, bottomblack);
	    	SetPlayerMapIcon( playerid, 7, -1120.40, -1204.62, 129.21, 25, 0); // Dice ! Created By 	    	SetPlayerMapIcon( playerid, 8, -1832.25, 111.82, 15.11, 51, 0); // 
	              return 1;
	}
Reply
#2

What gamemode are you using?

EDIT:Give me your OnPlayerSpawn(...)
Reply
#3

im using SW-RP beta
Код:
public OnPlayerSpawn(playerid)
{
    //TextDrawShowForPlayer(playerid, MoneySign);
    TextDrawHideForPlayer(playerid, Forums);
    TextDrawShowForPlayer(playerid, swrptext);
    new string[256];
    if(JustDied[playerid] == 1)
	{
	    for (new a = 0; a < 10; a++)
		{
			SendClientMessage(playerid, COLOR_WHITE, "        ");
	    }
	    ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,1,0);
	    SendClientMessage(playerid, COLOR_BLUE, "----------------------------------------------------------");
	    SendClientMessage(playerid, COLOR_BLUE, "You're about to die, if you die you will go to afterdeath.");
	    SendClientMessage(playerid, COLOR_BLUE, "Maybe someone will find you and call the EMTS, who knows...");
 		SendClientMessage(playerid, COLOR_BLUE, "If you just want to die and go straight to afterdeath, type /acceptdeath");
	    SendClientMessage(playerid, COLOR_BLUE, "----------------------------------------------------------");
	    TogglePlayerControllable(playerid, 0);
	    ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,0,0,1,0);
	    SetPlayerPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
		SetPlayerInterior(playerid, DeadInt[playerid]);
		SetPlayerVirtualWorld(playerid, DeadWorld[playerid]);
		ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);
		SetPlayerCameraPos(playerid, deadx[playerid], deady[playerid], deadz[playerid]+5);
		SetPlayerCameraLookAt(playerid, deadx[playerid], deady[playerid], deadz[playerid]);
    	SetTimerEx("FallPlayer", 5000, 0, "d", playerid);
	    return 1;
	}
	format(string, sizeof(string), "MOTD - %s", MOTD);
	SendClientMessage(playerid, COLOR_SPRINGGREEN, string);
	if(PlayerInfo[playerid][pDisease] == LungCancer)
	{
	    SendClientMessage(playerid, COLOR_BLUE, "You're having trouble breathing... (( Lung Cancer ))");
	    SetTimerEx("Cough", 60000, 1, "d", playerid);
	}
    return 1;
}
Reply
#4

i think its better if you take a look in it script that i have cause this is not gonna work. Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)