Spawn at house
#1

I am making a feature
If someone do /selectspawn 2 and relogs he spawns at his house
pawn Код:
else if(PlayerInfo[playerid][pSpawn] == 2)
                {
                    if(PlayerInfo[playerid][pHouseLevel] == 2)
                    {
                        SetPlayerFacingAngle(playerid, 270.0000);
                        SetPlayerInterior(playerid, 2);
                        PutPlayerInHouse(playerid, PlayerInfo[playerid][pHouseLevel]);
                        PlayerInfo[playerid][pInt] = 2;
                        PlayerInfo[playerid][pLocal] = i dont know what to put here ;
                    }
                }
When someone do it and relogs in spawns him at the right interior but he cant exit

/exit command:
pawn Код:
if(PlayerInfo[playerid][pLocal] != 999) //in house
                {
                    if(IsAtHouseExit(playerid))
                    {
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* %s has left the house.", sendername);
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        SetPlayerVirtualWorld(playerid, 0);
                        SetPlayerInterior(playerid,0);
                        SetPlayerPos(playerid,PlayerInfo[playerid][pHouseExitX],PlayerInfo[playerid][pHouseExitY],PlayerInfo[playerid][pHouseExitZ]);
                        SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pHouseExitR]-180);
                        SetCameraBehindPlayer(playerid);
                        PlayerInfo[playerid][pInt] = 0;
                        PlayerInfo[playerid][pVirtualWorld] = 0;
                        PlayerInfo[playerid][pLocal] = 999;
                    }
                }
Reply
#2

Help !! What should i set the local to let it work And let him exit?
Reply
#3

Try, put this in /selectspawn 2

pawn Код:
PlayerInfo[playerid][pLocal] = 1 ;
or if you have something that saves the players house id try do somerthing like this.

pawn Код:
PlayerInfo[playerid][pLocal] = PlayerInfo[playerid][pOwnedHouseID]; // or what ever saves the house ID that the player owns.
Reply
#4

Gonna try if it works i will +rep,you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)