01.11.2013, 20:44
What i don't understand is how this was working about three hours ago. (/enter)
Also i've got another problem where Dynamic Pickups that i create in OnGameModeInit aren't showing and the same with 3D Text.
Also i've got another problem where Dynamic Pickups that i create in OnGameModeInit aren't showing and the same with 3D Text.
pawn Код:
CMD:enter(playerid)
{
if(IsPlayerConnected(playerid))
{
if(CharacterInfo[playerid][Logged] == 1)
{
new NearestHouse = GetNearestHouse(playerid, 2);
new NearestFactionHQ = IsNearFactionHQ(playerid, 1);
if(IsPlayerInRangeOfPoint(playerid, 3, -179.0713, 1133.1025, 19.4460))
{
SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
return 1;
}
if(NearestFactionHQ > 0)
{
SetPlayerPos(playerid, FactionInfo[NearestFactionHQ][Interior_X],FactionInfo[NearestFactionHQ][Interior_Y],FactionInfo[NearestFactionHQ][Interior_Z]);
in_factionhq[playerid] = NearestFactionHQ;
return 1;
}
if(NearestHouse > 0)
{
if(DynamicHouseData[NearestHouse][HouseLocked] == 1) return SendClientMessage(playerid, -1, "[{33CCFF}INFO{FFFFFF}]: This door is locked.");
SetPlayerPos(playerid, DynamicHouseData[NearestHouse][Interior_X],DynamicHouseData[NearestHouse][Interior_Y],DynamicHouseData[NearestHouse][Interior_Z]);
SetPlayerInterior(playerid, DynamicHouseData[NearestHouse][HouseInterior]);
in_house[playerid] = NearestHouse;
return 1;
}
return 1;
}
}
return 1;
}
pawn Код:
stock GetNearestHouse(playerid, dist)
{
new i = 0;
while(i != MAX_DYNAMIC_HOUSES)
{
if(IsPlayerInRangeOfPoint(playerid, dist, DynamicHouseData[i][House_X],DynamicHouseData[i][House_Y],DynamicHouseData[i][House_Z]))
{
if(DynamicHouseData[i][HouseExists] == 1)
{
return i;
}
}
i++;
}
return -1;
}
stock GetNextHouseID()
{
new i= 1;
while(i != MAX_DYNAMIC_HOUSES)
{
if(DynamicHouseData[i][HouseExists] == 0)
{
return i;
}
i++;
}
return -1;
}
stock LoadDynamicHouses()
{
new str[128], i = 1, lable[100];
mysql_query("SELECT * FROM `house_data`");
mysql_store_result();
if(mysql_num_rows() != 0)
{
while(mysql_fetch_row(str))
{
sscanf(str, "e<p<|>iiiiiis[30]ffffff>", DynamicHouseData[i]);
if(DynamicHouseData[i][HouseExists] == 1)
{
DynamicHouseData[i][HouseID] = i;
if(DynamicHouseData[i][HouseOwned] == 0)
{
format(lable,sizeof(lable),"{FFFFFF}[{FFC801}Property{FFFFFF}]\n» Property For Sale: %d",DynamicHouseData[i][HousePrice], DynamicHouseData[i][HouseInterior]);
DynamicHouseData[i][HouseLable] = CreateDynamic3DTextLabel(lable, 0xFFFFFF, DynamicHouseData[i][House_X],DynamicHouseData[i][House_Y],DynamicHouseData[i][House_Z], 5.0);
DynamicHouseData[i][HousePickup] = CreateDynamicPickup(1273, 1, DynamicHouseData[i][House_X],DynamicHouseData[i][House_Y],DynamicHouseData[i][House_Z],0,0,-1,300.0);
format(str,sizeof(str),"Dynamic House Loaded %i Free", i);
//printf(str);
}
else if(DynamicHouseData[i][HouseOwned] == 1)
{
format(lable,sizeof(lable),"{FFFFFF}[{FFC801}Property{FFFFFF}]\nOwner: %s", DynamicHouseData[i][HouseOwner]);
DynamicHouseData[i][HouseLable] = CreateDynamic3DTextLabel(lable, 0xFFFFFF, DynamicHouseData[i][House_X],DynamicHouseData[i][House_Y],DynamicHouseData[i][House_Z], 5.0);
DynamicHouseData[i][HousePickup] = CreateDynamicPickup(1272, 1, DynamicHouseData[i][House_X],DynamicHouseData[i][House_Y],DynamicHouseData[i][House_Z],0,0,-1,300.0);
}
i++;
}
}
}
mysql_free_result();
return 1;
}