13.07.2014, 13:27
The problem is that even if I don't own a house, it'll say "Spawn set to house"..
pawn Код:
new Hcount;
for(new i = 0; i < MAX_HOUSES; i++)
{
if(strcmp(HouseInfo[i][hOwner], PlayerInfo[playerid][Name]) == 0)
{
Hcount++;
SendClientMessage(playerid, SERVER, "Spawn set to house.");
SetSpawnInfo(playerid, PlayerInfo[playerid][Job], PlayerInfo[playerid][Skin], HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], 0, 0, 0, 0, 0, 0, 0);
TogglePlayerSpectating(playerid, false);
break;
}
else continue;
}
if(Hcount < 1)
{
SendClientMessage(playerid, RED, "You don't own a house. Searching for business..");
new Bcount;
for(new b = 0; b < MAX_BIZZ; b++)
{
if(strcmp(BusinessInfo[b][bOwner], PlayerInfo[playerid][Name]) == 0)
{
Bcount++;
SendClientMessage(playerid, SERVER, "Spawn set to business.");
SetSpawnInfo(playerid, PlayerInfo[playerid][Job], PlayerInfo[playerid][Skin], BusinessInfo[b][bEnterX], BusinessInfo[b][bEnterY], BusinessInfo[b][bEnterZ], 0, 0, 0, 0, 0, 0, 0);
TogglePlayerSpectating(playerid, false);
break;
}
else continue;
}
if(Bcount < 1)
{
SendClientMessage(playerid, RED, "You don't own a business. Spawn location set at random place.");
SetSpawnInfo(playerid, PlayerInfo[playerid][Job], 42, 1568.8165, -1691.8510, 5.8906, 0, 0, 0, 0, 0, 0, 0);
TogglePlayerSpectating(playerid, false);
}
}