I NEED HELP FAST. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I NEED HELP FAST. (
/showthread.php?tid=228333)
I NEED HELP FAST. -
NewbBeginner - 19.02.2011
Код:
if(newkeys & KEY_SPRINT)
{
for(new maID = 0; maID <= MAX_HOUSES; maID++)
{
if(PlayerToPoint(2.0, playerid, HouseInfo[maID][mPickupX], HouseInfo[maID][mPickupY], HouseInfo[maID][mPickupZ]))
{
SetPlayerPos(playerid, HouseInfo[maID][mIntX], HouseInfo[maID][mIntY], HouseInfo[maID][mIntZ]);
SetPlayerInterior(playerid, HouseInfo[maID][mInterior]);
}
if(PlayerToPoint(2.0, playerid, HouseInfo[maID][mIntX], HouseInfo[maID][mIntY], HouseInfo[maID][mIntZ]))
{
SetPlayerPos(playerid, HouseInfo[maID][mPickupX], HouseInfo[maID][mPickupY], HouseInfo[maID][mPickupZ]);
SetPlayerInterior(playerid, 0);
}
}
}
Problem is that I enter in one house, but I exit in the other, because houses have same interior, How can i fix this.
Please help :S
Re: I NEED HELP FAST. -
xRyder - 19.02.2011
You can always set players virtual world when he enters the house and then check for it when he exits.
Or
Use houses by ID's and when players enters house with ID: 1 set his PVarInt to house ID, and when he exits you can simply find house by it's ID and teleport the player to house[ID][exitX][exitY][exitZ].
Re: I NEED HELP FAST. -
NewbBeginner - 19.02.2011
Can you do me an example PLEAASE ?
With pVars.
Re: I NEED HELP FAST. -
xRyder - 19.02.2011
When player enters the house you need to chech what is house ID ( I'm gonna pretend it's 1)
So, when player enters house
pawn Код:
SetPVarInt(playerid, "InHouseID", /*Here you put your code to set house ID to player, mine is ->*/1);
And when he exits the house
pawn Код:
new hID = GetPVarInt(playerid, "InHouseID"));
//Open the file where you have your houses saved and just...
SetPlayerPos(playerid, House[hID][exitX], House[hID][exitY], House[hID][exitZ]);
Something like this...