Ich habe folgendes Problem.
Wenn ich mein Haus verlasse, spawne ich am Nulpunkt.
Hier die stocks für das betreten wie auch verlassen:
stock HausAusgang(playerid)
{
if(SpielerInfo[playerid][pAduty] == 1)
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HausInfo[GetPlayerVirtualWorld(playerid)][hxPos],HausInfo[GetPlayerVirtualWorld(playerid)][hyPos],HausInfo[GetPlayerVirtualWorld(playerid)][hzPos]);
SetPlayerVirtualWorld(playerid,0);
}
else
{
for(new i=1;i<MAX_HOUSES;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,HausInfo[i][hixPos],HausInfo[i][hiyPos],HausInfo[i][hizPos]))
{
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid,HausInfo[GetPlayerVirtualWorld(playerid)][hxPos],HausInfo[GetPlayerVirtualWorld(playerid)][hyPos],HausInfo[GetPlayerVirtualWorld(playerid)][hzPos]);
SetPlayerVirtualWorld(playerid,0);
}
}
}
}
stock HausEingang(playerid)
{
new Float:hx, Float:hy, Float:hz;
GetPlayerPos(playerid, hx,hy,hz);
if(SpielerInfo[playerid][pAduty] == 1)
{
for(new i=1;i<MAX_HOUSES;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,HausInfo[i][hxPos],HausInfo[i][hyPos],HausInfo[i][hzPos]))
{
SetPlayerInterior(playerid,HausInfo[i][hInterior]);
SetPlayerVirtualWorld(playerid,HausInfo[i][hID]);
SetPlayerPos(playerid,HausInfo[i][hixPos],HausInfo[i][hiyPos],HausInfo[i][hizPos]);
}
}
}
else
{
for(new i=1;i<MAX_HOUSES;i++)
{
if(IsPlayerInRangeOfPoint(playerid,3,HausInfo[i][hxPos],HausInfo[i][hyPos],HausInfo[i][hzPos]))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
if(strcmp(name,HausInfo[i][hBesitzer],true)==0)
{
SetPlayerInterior(playerid,HausInfo[i][hInterior]);
SetPlayerVirtualWorld(playerid,HausInfo[i][hID]);
SetPlayerPos(playerid,HausInfo[i][hixPos],HausInfo[i][hiyPos],HausInfo[i][hizPos]);
SendClientMessage(playerid,WEIß,"Willkommen Zuhause!");
return 1;
}
if(HausInfo[i][hLock] == 0) return SendClientMessage(playerid,WEIß,"Die Tür ist verschlossen!");
else
{
SetPlayerInterior(playerid,HausInfo[i][hInterior]);
SetPlayerVirtualWorld(playerid,HausInfo[i][hID]);
SetPlayerPos(playerid,HausInfo[i][hixPos],HausInfo[i][hiyPos],HausInfo[i][hizPos]);
return 1;
}
}
}
}
return 1;
}