House is not correct - 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: House is not correct (
/showthread.php?tid=177910)
House is not correct -
selEcT - 19.09.2010
Hello!
I've got a problem with the houses. I save the houses with MySQL.
Some of them have the same interior, the houses 0-5 have the same interior p.e. But now, when I go into house 5, it works. But when I type /exit, I'm coming out at house 0, the first house with this interior! Why is this happen? That's the code to enter/exit:
Код:
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if(PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz])) //exit
{
SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
PlayerInfo[playerid][pLocal] = 255;
SetPlayerVirtualWorld(playerid,0);
if(HouseInfo[i][hHel] == 1)
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if(tempheal < 100.0) { SetPlayerHealth(playerid,100.0); }
return 1;
}
}
else if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez])) //enter
{
if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
{
SetPlayerInterior(playerid,HouseInfo[i][hInt]);
SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
GameTextForPlayer(playerid, "~w~Welcome home", 5000, 1);
PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
PlayerInfo[playerid][pLocal] = i;
SetPlayerVirtualWorld(playerid,i);
return 1;
}
else
{
return GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
}
}
}
What is the problem?
For the german guys:
http://forum.sa-mp.de/wbb/san-andrea...ht/#post432326
How it works correctly? I have also tested with the virtualworld from the house, it doesn't work..
Best regards
Re: House is not correct -
selEcT - 20.09.2010
why does nobody know, what's the problem..?