19.10.2011, 23:45
Look at the times when I have understood correctly, it should help you
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new h = 0; h < sizeof(HouseSystem); h++)
{
if (PlayerToPoint(1.5, playerid,HouseSystem[h][EEnterx], HouseSystem[h][EEntery], HouseSystem[h][EEnterz]))
{
IsInHouse[playerid] = 6;
GivePlayerMoney(playerid,-HouseSystem[h][Miete]);
HouseSystem[h][Kasse] += HouseSystem[h][Miete];
SetPlayerInterior(playerid,HouseSystem[h][Eint]);
SetPlayerVirtualWorld(playerid, h);
SetPlayerPos(playerid,HouseSystem[h][EExitx],HouseSystem[h][EExity],HouseSystem[h][EExitz]);
return 1;
}
else if (PlayerToPoint(3, playerid,HouseSystem[h][EExitx], HouseSystem[h][EExity], HouseSystem[h][EExitz]))
{
if(GetPlayerVirtualWorld(playerid) == h)
{
if(IsInHouse[playerid] == 6)
{
GivePlayerMoney(playerid,-HouseSystem[h][Miete]);
HouseSystem[h][Kasse] += HouseSystem[h][Miete];
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerPos(playerid,HouseSystem[h][EEnterx],HouseSystem[h][EEntery],HouseSystem[h][EEnterz]);
return 1;
}
}
}
}
}
return 1;
}