hey,i dont know how to fix this,i added some lines under the ongamemodeinit,it should load houses like this from playerinfo,it should check if player has house and if he has,it should create it,even if the player aint logged in
Код:
public OnGameModeInit()
{
for(new v; v < MAX_PLAYERS; v++)
{
if(PlayerInfo[v][pHouseAccepted] > 0)
{
new hnametag[64];
new hloctag[64];
//pickup
HousePickupIDTemp[v] = CreatePickup(1273,1,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]);
printf("PickupID: %d", HousePickupIDTemp[v]);
//nametag
strmid(hnametag, PlayerInfo[v][pHouseTag], 0, strlen(PlayerInfo[v][pHouseTag]), 255);
House3dTextID[v] = Create3DTextLabel(hnametag,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.88,20.0,0,1);
printf("House3dTextID: %d", _:House3dTextID[v]);
//owner
new string[256];
format(string, sizeof(string),"Owner: %s", PlayerName(v));
HouseTextOwnerID[v] = Create3DTextLabel(string,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.74,20.0,0,1);
strmid(PlayerInfo[v][pHouseOwnerTag], PlayerName(v), 0, strlen(PlayerName(v)), 255);
printf("HouseTextOwnerID: %d", _:HouseTextOwnerID[v]);
//location
strmid(hloctag, PlayerInfo[v][pHouseLocTag], 0, strlen(PlayerInfo[v][pHouseLocTag]), 255);
format(string, sizeof(string),"Location: %s", hloctag);
HouseTextLocationID[v] = Create3DTextLabel(string,COLOR_HOUSETEXT,PlayerInfo[v][pHouseX],PlayerInfo[v][pHouseY],PlayerInfo[v][pHouseZ]+0.60,20.0,0,1);
printf("HouseTextLocationID: %d", _:HouseTextLocationID[v]);
//vehicle
HouseVehicleIDTemp[v] = CreateVehicle(PlayerInfo[v][pHouseCarModel],PlayerInfo[v][pHouseCarX],PlayerInfo[v][pHouseCarY],PlayerInfo[v][pHouseCarZ],PlayerInfo[v][pHouseCarFacing],PlayerInfo[v][pHouseCarColor],PlayerInfo[v][pHouseCarColor2], 900);
if(PlayerInfo[v][hVehLock] > 0)
{
LockCar(HouseVehicleIDTemp[v]);
}
}
}
....
How's this ever gonna work if there are no players connected at all? Unless you load the Playerinfo of ALL players in your database (which may go into the ten-thousands) first...
i didnt return 1 cause its not all of the gamemodeinit,and ummh yeah i know that,i guess i remake the house sys