Spawn help..
#1

I set the player spawn if he choose it to ((Airport spawn)) he would spawn at the airport, But now he just spawn at the airport even if he choose the house spawn/faction spawn


Код:
   			if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
		    {
		        new plname[MAX_PLAYER_NAME];
		        GetPlayerName(playerid, plname, sizeof(plname));
      			SetPlayerVirtualWorld(playerid, 0);
	        	SafeSetPlayerInterior(playerid, 0);
	    		SafeSetPlayerPos(playerid, 1685.8209,-2333.4424,13.5469); // This is the airport cords..
				format(string, sizeof(string), "Welcome to Los Angeles, %s.",plname);
				SendClientMessage(playerid, COLOR_WHITE, string);
				format(string, sizeof(string), "~w~Welcome, ~b~%s. ~n~~y~Returning where have you been!", plname);
		    	GameTextForPlayer(playerid, string, 5000, 1);
		    	return 1;
			}
			if(house != 9999)
			{
			    if(PlayerInfo[playerid][pSpawn] == 1) //House spawn
			    {
					SetPlayerToTeamColor(playerid);
					SafeSetPlayerInterior(playerid,HouseInfo[house][hInt]);
					SetPlayerVirtualWorld(playerid,HouseInfo[house][hWorld]);
					SafeSetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]); // Warp the player
					PlayerInfo[playerid][pLocal] = house;
					HouseEntered[playerid] = house;
					return 1;
				}
				else if(PlayerInfo[playerid][pSpawn] == 0)
			    {
					SetPlayerToTeamColor(playerid);
					SafeSetPlayerPos(playerid,1685.8209,-2333.4424,13.5469); // This too...
					SetPlayerVirtualWorld(playerid, 0);
					SafeSetPlayerInterior(playerid, 0);
					TogglePlayerControllable(playerid, 1);
					return 1;
				}
				else if(PlayerInfo[playerid][pSpawn] == 2)
				{
				    new family = PlayerInfo[playerid][pFMember];
				    SetPlayerToTeamColor(playerid);
				    SafeSetPlayerInterior(playerid, FamilyInfo[family][FamilyInterior]);
				    SafeSetPlayerPos(playerid, FamilyInfo[family][FamilySpawn][0],FamilyInfo[family][FamilySpawn][1],FamilyInfo[family][FamilySpawn][2]);
				    SetPlayerFacingAngle(playerid, FamilyInfo[family][FamilySpawn][3]);
				    return 1;
				}
				else
				{
					if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)//Police Force spawn
					{
					    if(PlayerInfo[playerid][pSpawn] == 3)
				        {
							SetPlayerToTeamColor(playerid);
							SafeSetPlayerInterior(playerid,6);
						    rand = random(sizeof(gCopPlayerSpawns));
							SafeSetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
							SetPlayerFacingAngle(playerid, 270.0);
							return 1;
						}
						else
					    {
							SetPlayerToTeamColor(playerid);
							SafeSetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
							SetPlayerVirtualWorld(playerid, SpawnWorld[playerid]);
							SafeSetPlayerInterior(playerid, SpawnInterior[playerid]);
							TogglePlayerControllable(playerid, 1);
							return 1;
						}
				    }
				    if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)//FBI spawn
					{
					    if(PlayerInfo[playerid][pSpawn] == 3)
				        {
							SetPlayerToTeamColor(playerid);
							SafeSetPlayerInterior(playerid,3);
							SafeSetPlayerPos(playerid, 299.7097,183.1322,1007.1719);
							SetPlayerFacingAngle(playerid, 90);
							return 1;
						}
						else
					    {
							SetPlayerToTeamColor(playerid);
							SafeSetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
							SetPlayerVirtualWorld(playerid, SpawnWorld[playerid]);
							SafeSetPlayerInterior(playerid, SpawnInterior[playerid]);
							TogglePlayerControllable(playerid, 1);
							return 1;
						}
				    }
Reply
#2

You check that if he has a house, and if he does have one, he spawns at a faction interior ?
That's your problem I guess.

EDIT :
pawn Код:
if(TutTime[playerid] == 0 && PlayerInfo[playerid][pTut] == 1 && RegistrationStep[playerid] == 0 && AfterTutorial[playerid] == 0 && FirstSpawn[playerid] == 1)
    {
        new plname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname, sizeof(plname));
        SetPlayerVirtualWorld(playerid, 0);
        SafeSetPlayerInterior(playerid, 0);
        SafeSetPlayerPos(playerid, 1685.8209,-2333.4424,13.5469);// This is the airport cords..
        format(string, sizeof(string), "Welcome to Los Angeles, %s.",plname);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "~w~Welcome, ~b~%s. ~n~~y~Returning where have you been!", plname);
        GameTextForPlayer(playerid, string, 5000, 1);
        return 1;
    }


    if(house != 9999)
    {
        if(PlayerInfo[playerid][pSpawn] == 1) {       //House spawn
            SetPlayerToTeamColor(playerid);
            SafeSetPlayerInterior(playerid,HouseInfo[house][hInt]);
            SetPlayerVirtualWorld(playerid,HouseInfo[house][hWorld]);
                                                      // Warp the player
            SafeSetPlayerPos(playerid, HouseInfo[house][hExitx], HouseInfo[house][hExity],HouseInfo[house][hExitz]);
            PlayerInfo[playerid][pLocal] = house;
            HouseEntered[playerid] = house;
            return 1;
        }
    }


    /*if(PlayerInfo[playerid][pSpawn] == 0)// I don't know what this is.
    {
        SetPlayerToTeamColor(playerid);
                                                      // This too...
        SafeSetPlayerPos(playerid,1685.8209,-2333.4424,13.5469);
        SetPlayerVirtualWorld(playerid, 0);
        SafeSetPlayerInterior(playerid, 0);
        TogglePlayerControllable(playerid, 1);
        return 1;
    }*/



    if(PlayerInfo[playerid][pSpawn] == 2 && IsInAFaction)// IsInAfaction is something I made up, you need to change it.
    {
        new family = PlayerInfo[playerid][pFMember];
        SetPlayerToTeamColor(playerid);
        SafeSetPlayerInterior(playerid, FamilyInfo[family][FamilyInterior]);
        SafeSetPlayerPos(playerid, FamilyInfo[family][FamilySpawn][0],FamilyInfo[family][FamilySpawn][1],FamilyInfo[family][FamilySpawn][2]);
        SetPlayerFacingAngle(playerid, FamilyInfo[family][FamilySpawn][3]);
        return 1;
    }
    else
    {
                                                      //Police Force spawn
        if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) {
            if(PlayerInfo[playerid][pSpawn] == 3) {
                SetPlayerToTeamColor(playerid);
                SafeSetPlayerInterior(playerid,6);
                rand = random(sizeof(gCopPlayerSpawns));
                                                      // Warp the player
                SafeSetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]);
                SetPlayerFacingAngle(playerid, 270.0);
                return 1;
            }
            else {
                SetPlayerToTeamColor(playerid);
                SafeSetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
                SetPlayerVirtualWorld(playerid, SpawnWorld[playerid]);
                SafeSetPlayerInterior(playerid, SpawnInterior[playerid]);
                TogglePlayerControllable(playerid, 1);
                return 1;
            }
        }
                                                      //FBI spawn
        if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) {
            if(PlayerInfo[playerid][pSpawn] == 3) {
                SetPlayerToTeamColor(playerid);
                SafeSetPlayerInterior(playerid,3);
                SafeSetPlayerPos(playerid, 299.7097,183.1322,1007.1719);
                SetPlayerFacingAngle(playerid, 90);
                return 1;
            }
            else {
                SetPlayerToTeamColor(playerid);
                SafeSetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
                SetPlayerVirtualWorld(playerid, SpawnWorld[playerid]);
                SafeSetPlayerInterior(playerid, SpawnInterior[playerid]);
                TogglePlayerControllable(playerid, 1);
                return 1;
            }
        }
By looking in the code, I think this can work, it may give errors ect, because I didn't test it.
Reply
#3

Sorry for double-post.
Reply
#4

No, When i do /selectspawn and choose to spawn at a house which i own he spawns at the house normally, the problem is that the player was spawning at the place he left so i set a place for him to spawn when he quit but then if he /selectspawn anyplace he still spawns at the airport.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)