Spawn at house - 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 house (
/showthread.php?tid=479236)
Spawn at house -
iBots - 03.12.2013
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;
}
}
Re: Spawn at house -
iBots - 03.12.2013
Help !! What should i set the local to let it work And let him exit?
Re: Spawn at house -
jueix - 03.12.2013
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.
Re: Spawn at house -
iBots - 03.12.2013
Gonna try if it works i will +rep,you