[DUVIDA] Casa no GF
#1

Bom eu estou aprendendo PWN no GF, ai li o tutorial de adicionar casas e empresas, sу que fiquei com uma duvida:
Eu coloquei no meu GM 3 casas que vгo para o mesmo interior mas elas sу saem em uma, assim nгo tem como setar o VirtualWord pelo cfg?

Code:
1762.618896,-1789.407226,53.668800,225.600006,1023.500000,1084.000000,0,0,0,0,0,0,governo,Casa1,5623548,1,1,7,1,1,0,500,0,0,547,-1,-1,38,50,0
1793.984619,-1802.371215,53.668800,225.600006,1023.500000,1084.000000,0,0,0,0,0,0,governo,Casa2,5623548,0,0,7,1,1,0,500,0,0,547,-1,-1,38,50,0
1384.646484,-1297.406982,33.494598,225.600006,1023.500000,1084.000000,0,0,0,0,0,0,governo,Casa3,10000000,0,0,7,1,1,0,500,0,0,547,-1,-1,38,50,0
Gostaria de alguma luz *-*

Aguardo resposta...
Reply
#2

Troque sua enum HouseInfo, sua public OnPropUpdate e sua public LoadProperty por essas abaixo:

Obs: Logo depois de trocar tudo, apenas coloque no final da linha de cada uma das casas um: ,0 ou ,1, ou seja lб qual for o ID do Virtual World de cada uma delas que voce queira colocar


pawn Code:
enum hInfo
{
    Float:hEntrancex,
    Float:hEntrancey,
    Float:hEntrancez,
    Float:hExitx,
    Float:hExity,
    Float:hExitz,
    hHealthx,
    hHealthy,
    hHealthz,
    hArmourx,
    hArmoury,
    hArmourz,
    hOwner[MAX_PLAYER_NAME],
    hDiscription[MAX_PLAYER_NAME],
    hValue,
    hHel,
    hArm,
    hInt,
    hLock,
    hOwned,
    hRooms,
    hRent,
    hRentabil,
    hTakings,
    hVec,
    hVcol1,
    hVcol2,
    hDate,
    hVirtualWorld,
    hLevel,
};

new HouseInfo[34][hInfo];




public LoadProperty()
{
    new arrCoords[30][64];
    new strFromFile2[256];
    new File: file = fopen("property.cfg", io_read);
    if (file)
    {
        new idx;
        while (idx < sizeof(HouseInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, ',');
            HouseInfo[idx][hEntrancex] = floatstr(arrCoords[0]);
            HouseInfo[idx][hEntrancey] = floatstr(arrCoords[1]);
            HouseInfo[idx][hEntrancez] = floatstr(arrCoords[2]);
            HouseInfo[idx][hExitx] = floatstr(arrCoords[3]);
            HouseInfo[idx][hExity] = floatstr(arrCoords[4]);
            HouseInfo[idx][hExitz] = floatstr(arrCoords[5]);
            HouseInfo[idx][hHealthx] = strval(arrCoords[6]);
            HouseInfo[idx][hHealthy] = strval(arrCoords[7]);
            HouseInfo[idx][hHealthz] = strval(arrCoords[8]);
            HouseInfo[idx][hArmourx] = strval(arrCoords[9]);
            HouseInfo[idx][hArmoury] = strval(arrCoords[10]);
            HouseInfo[idx][hArmourz] = strval(arrCoords[11]);
            //printf("HouseInfo hEntrancez %f",HouseInfo[idx][hEntrancez]);
            strmid(HouseInfo[idx][hOwner], arrCoords[12], 0, strlen(arrCoords[12]), 255);
            strmid(HouseInfo[idx][hDiscription], arrCoords[13], 0, strlen(arrCoords[13]), 255);
            HouseInfo[idx][hValue] = strval(arrCoords[14]);
            HouseInfo[idx][hHel] = strval(arrCoords[15]);
            HouseInfo[idx][hArm] = strval(arrCoords[16]);
            HouseInfo[idx][hInt] = strval(arrCoords[17]);
            HouseInfo[idx][hLock] = strval(arrCoords[18]);
            HouseInfo[idx][hOwned] = strval(arrCoords[19]);
            HouseInfo[idx][hRooms] = strval(arrCoords[20]);
            HouseInfo[idx][hRent] = strval(arrCoords[21]);
            HouseInfo[idx][hRentabil] = strval(arrCoords[22]);
            HouseInfo[idx][hTakings] = strval(arrCoords[23]);
            HouseInfo[idx][hVec] = strval(arrCoords[24]);
            if(HouseInfo[idx][hVec] == 457)
            {
                HouseInfo[idx][hVec] = 411;
            }
            HouseInfo[idx][hVcol1] = strval(arrCoords[25]);
            HouseInfo[idx][hVcol2] = strval(arrCoords[26]);
            HouseInfo[idx][hDate] = strval(arrCoords[27]);
            HouseInfo[idx][hLevel] = strval(arrCoords[28]);
            HouseInfo[idx][hVirtualWorld] = strval(arrCoords[29]);
            printf("InfoCasa:%d Dono:%s Ganho %d Veiculo %d",idx,HouseInfo[idx][hOwner],HouseInfo[idx][hTakings],HouseInfo[idx][hVec]);
            idx++;
        }
    }
    fclose(file);
    return 1;
}




public OnPropUpdate()
{
    if (gdebug >= 1){printf("DEBUG OnPropUpdate()");}
    new idx;
    new File: file2;
    while (idx < sizeof(HouseInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
        HouseInfo[idx][hEntrancex],
        HouseInfo[idx][hEntrancey],
        HouseInfo[idx][hEntrancez],
        HouseInfo[idx][hExitx],
        HouseInfo[idx][hExity],
        HouseInfo[idx][hExitz],
        HouseInfo[idx][hHealthx],
        HouseInfo[idx][hHealthy],
        HouseInfo[idx][hHealthz],
        HouseInfo[idx][hArmourx],
        HouseInfo[idx][hArmoury],
        HouseInfo[idx][hArmourz],
        HouseInfo[idx][hOwner],
        HouseInfo[idx][hDiscription],
        HouseInfo[idx][hValue],
        HouseInfo[idx][hHel],
        HouseInfo[idx][hArm],
        HouseInfo[idx][hInt],
        HouseInfo[idx][hLock],
        HouseInfo[idx][hOwned],
        HouseInfo[idx][hRooms],
        HouseInfo[idx][hRent],
        HouseInfo[idx][hRentabil],
        HouseInfo[idx][hTakings],
        HouseInfo[idx][hVec],
        HouseInfo[idx][hVcol1],
        HouseInfo[idx][hVcol2],
        HouseInfo[idx][hDate],
        HouseInfo[idx][hLevel],
        HouseInfo[idx][hVirtualWorld]);
        if(idx == 0)
        {
            file2 = fopen("property.cfg", io_write);
        }
        else
        {
            file2 = fopen("property.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    idx = 0;
    while (idx < sizeof(BizzInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%d,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
        BizzInfo[idx][bEntrancex],
        BizzInfo[idx][bEntrancey],
        BizzInfo[idx][bEntrancez],
        BizzInfo[idx][bExitx],
        BizzInfo[idx][bExity],
        BizzInfo[idx][bExitz],
        BizzInfo[idx][bHealthx],
        BizzInfo[idx][bHealthy],
        BizzInfo[idx][bHealthz],
        BizzInfo[idx][bArmourx],
        BizzInfo[idx][bArmoury],
        BizzInfo[idx][bArmourz],
        BizzInfo[idx][bOwner],
        BizzInfo[idx][bDiscription],
        BizzInfo[idx][bValue],
        BizzInfo[idx][bHel],
        BizzInfo[idx][bArm],
        BizzInfo[idx][bInt],
        BizzInfo[idx][bLock],
        BizzInfo[idx][bOwned],
        BizzInfo[idx][bEntcost],
        BizzInfo[idx][bTakings],
        BizzInfo[idx][bDate],
        BizzInfo[idx][bLevel],
        BizzInfo[idx][bProd],
        BizzInfo[idx][bProdCap],
        BizzInfo[idx][bComp],
        BizzInfo[idx][bCompCap],
        BizzInfo[idx][bProdCost],
        BizzInfo[idx][bPayComp],
        BizzInfo[idx][bPriceMod]);
        if(idx == 0)
        {
            file2 = fopen("bizz.cfg", io_write);
        }
        else
        {
            file2 = fopen("bizz.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    idx = 0;
    while (idx < sizeof(SBizzInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%f,%f,%f,%s,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
        SBizzInfo[idx][sbEntrancex],
        SBizzInfo[idx][sbEntrancey],
        SBizzInfo[idx][sbEntrancez],
        SBizzInfo[idx][sbOwner],
        SBizzInfo[idx][sbDiscription],
        SBizzInfo[idx][sbValue],
        SBizzInfo[idx][sbHel],
        SBizzInfo[idx][sbArm],
        SBizzInfo[idx][sbInt],
        SBizzInfo[idx][sbLock],
        SBizzInfo[idx][sbOwned],
        SBizzInfo[idx][sbEntcost],
        SBizzInfo[idx][sbTakings],
        SBizzInfo[idx][sbDate],
        SBizzInfo[idx][sbLevel],
        SBizzInfo[idx][sbProd],
        SBizzInfo[idx][sbProdCap],
        SBizzInfo[idx][sbComp],
        SBizzInfo[idx][sbCompCap],
        SBizzInfo[idx][sbProdCost],
        SBizzInfo[idx][sbPayComp]);
        if(idx == 0)
        {
            file2 = fopen("sbizz.cfg", io_write);
        }
        else
        {
            file2 = fopen("sbizz.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}

Espero ter ajudado
Reply
#3

Vou tentar aqui para ver se dar certo
Obrigado!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)