[AJUDA] Carregamento da casa
#1

Olб, eu to a uns dias quebrando a cabeзa com sistema de casa, ja testei uns 6 por ai, 3 foi portugues que nгo tive sucesso, agora parece que achei um que pode atй da certo,
й o carregamento do нcone da casa e da descriзгo da casa, sу que isso acontece sу quando o dono da casa loga, eu queria saber como eu fasso, pra qualquer player logar, aparecer o icone e a descriзгo do dono da casa, mesmo que o dono esteja offline. Esse й o carregamento de quando o player loga:

OnPlayerConnect
pawn Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        new pname[MAX_PLAYER_NAME];
        new name[256], desc[256];
        new file[100], str[128];
        GetPlayerName(playerid, pname, sizeof(pname));
        format(file, sizeof(file), "Houses/%s.ini", pname);
        if(dini_Exists(file))
        {
            name = dini_Get(file, "Name");
            desc = dini_Get(file, "Description");
            HouseInfo[h][Owner] = pname;
            HouseInfo[h][Price] = dini_Int(file, "Price");
            HouseInfo[h][PX] = dini_Float(file, "Pickup X");
            HouseInfo[h][PY] = dini_Float(file, "Pickup Y");
            HouseInfo[h][PZ] = dini_Float(file, "Pickup Z");
            HouseInfo[h][TX] = dini_Float(file, "Teleport X");
            HouseInfo[h][TY] = dini_Float(file, "Teleport Y");
            HouseInfo[h][TZ] = dini_Float(file, "Teleport Z");
            HouseInfo[h][TA] = dini_Float(file, "Teleport Angle");
            HouseInfo[h][Int] = dini_Int(file, "Interior");
            HouseInfo[h][Vir] = dini_Int(file, "Virtual");
            HouseInfo[h][Cash] = dini_Int(file, "Cash");
            HouseInfo[h][Rentable] = dini_Int(file, "Rentable");
            HouseInfo[h][RentPrice] = dini_Int(file, "Rent Price");
            HouseInfo[h][CarModel] = dini_Int(file, "Car Model");
            HouseInfo[h][CarX] = dini_Float(file, "Car X");
            HouseInfo[h][CarY] = dini_Float(file, "Car Y");
            HouseInfo[h][CarZ] = dini_Float(file, "Car Z");
            HouseInfo[h][CarRot] = dini_Float(file, "Car Rotation");
            if(HouseInfo[h][Rentable] == 0)
            {
                format(str, sizeof(str), "Name: %s\n\nDescription: %s\n\nOwner: %s", name, desc, pname);
            }
            else
            {
                format(str, sizeof(str), "Name: %s\n\nDescription: %s\n\nOwner: %s\n\nRent Price: $%i", name, desc, pname, HouseInfo[h][RentPrice]);
            }
            HouseLabel[playerid] = Create3DTextLabel(str, 0xF97804FF, HouseInfo[h][PX], HouseInfo[h][PY], HouseInfo[h][PZ], 20.0, 0);
            HouseOwner[playerid] = true;
            HousePickup[playerid] = CreatePickup(1273, 23, HouseInfo[h][PX], HouseInfo[h][PY], HouseInfo[h][PZ]);
            HouseCar[playerid] = CreateVehicle(HouseInfo[h][CarModel], HouseInfo[h][CarX], HouseInfo[h][CarY], HouseInfo[h][CarZ], HouseInfo[h][CarRot], -1, -1, 5000000);
            HouseUser[playerid] = playerid;
            for(new i; i<MAX_PLAYERS; i++)
            {
                SetPlayerMapIcon(i, HouseUser[playerid], HouseInfo[h][CarX], HouseInfo[h][CarY], HouseInfo[h][CarZ], 31, MAPICON_GLOBAL);
            }
            return 1;
        }
    }
Reply
#2

ninguйm?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)