GF house system HELP!
#1

I have one strange problem....I making GF edit and when i put hInfo something like this > new HouseInfo[58][hInfo]; and put in property.cfg ALL 58 HOUSES and when i run my server it load JUST 3 model of vehicle!!! Why...But when i remove EVRYTHING from property.cfg and put new HouseInfo[0][hInfo]; it load all 54 Model of vehicle...I use house maker this is source code

pawn Код:
#include <a_samp>

#define FILTERSCRIPT
#define COLOR_LIGHTBLUE 0x33CCFFAA
forward split(const strsrc[], strdest[][], delimiter);

new Menu:Property;

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}


public split(const strsrc[], strdest[][], delimiter)
{
    new i, li;
    new aNum;
    new len;
    while(i <= strlen(strsrc)){
        if(strsrc[i]==delimiter || i==strlen(strsrc)){
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return 1;
}

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" In-Game House Maker , By Jack_Sparr!");
    print("--------------------------------------\n");
    Property = CreateMenu("Properties", 1, 50.0, 180.0, 200.0, 200.0);
    SetMenuColumnHeader(Menu:Property, 0, "Property");
    AddMenuItem(Menu:Property, 0, "Trailer");
    AddMenuItem(Menu:Property, 0, "Bedsit");
    AddMenuItem(Menu:Property, 0, "2 Room");
    AddMenuItem(Menu:Property, 0, "3 Room");
    AddMenuItem(Menu:Property, 0, "4 Room");
    AddMenuItem(Menu:Property, 0, "5 Room");
    AddMenuItem(Menu:Property, 0, "6 Room");
    AddMenuItem(Menu:Property, 0, "4 Room Luxury");
    AddMenuItem(Menu:Property, 0, "5 Room Luxury");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

main()
{
    print("\n----------------------------------");
    print(" In-Game House Maker , By Jack Sparr!");
    print(" With Help From Tom Wilson");
    print("----------------------------------\n");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256];
    new idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/house", true) == 0)
        {
            TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(Menu:Property, playerid);
            return 1;
        }
    return 0;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    new Menu:CurrentMenu = GetPlayerMenu(playerid);
    new entry[252];
    if(CurrentMenu == Menu:Property)
    {
        switch(row)
        {
            case 0:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,1.200000,-3.400000,999.400024,0,0,0,0,0,0,The State,Trailer,25000,0,0,2,1,0,0,1000,1,3045,418,-1,-1,132,3\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 1:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,244.500000,305.000000,999.099975,0,0,0,0,0,0,The State, Bedsit,50000,0,0,1,1,0,1,100,1,0,418,-1,-1,133,0\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                 }
            case 2:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,446.100006,507.899993,1001.400024,0,0,0,0,0,0,The State,2 Room Apartment,100000,0,0,12,1,0,1,666,1,77256,418,-1,-1,132,0\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 3:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,221.600006,1143.599975,1082.599975,0,0,0,0,0,0,The State,3 Room Apartment,150000,0,0,4,1,0,1,5000,1,100,418,-1,-1,132,0\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 4:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,261.000000,1286.000000,1080.199951,0,0,0,0,0,0,The State,4 Room House,250000,0,0,4,1,0,0,1500,1,0,418,-1,-1,133,0\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 5:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,234.199996,1064.900024,1084.199951,0,0,0,0,0,0,The State,5 Room House,2500000,0,0,6,1,0,0,0,0,0,418,-1,-1,131,0\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 6:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,140.399993,1370.300048,1083.800048,0,0,0,0,0,0,The State,6 Room House,2000000,0,0,5,1,0,0,5000,0,20000,418,-1,-1,132,9\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 7:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,-285.899993,1470.800048,1084.300048,0,0,0,0,0,0,The State,4 Room Luxury,2000000,0,0,15,1,0,0,1,0,124,418,-1,-1,132,8\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                }
            case 8:
                {
                new Float:X, Float:Y, Float:Z;
                new File:hFile;
                GetPlayerPos(playerid, X, Y, Z);
                AddStaticPickup(1273, 2, X, Y, Z);
                format(entry, 250, "%.2f,%.2f,%.2f,234.199996,1064.900024,1084.199951,0,0,0,0,0,0,The State,5 Room House,2500000,0,0,6,1,0,0,0,0,0,418,-1,-1,131,10\n ", X, Y, Z);
                hFile = fopen("property.cfg", io_append);
                fwrite(hFile, entry);
                fclose(hFile);
                HideMenuForPlayer(Menu:Property, playerid);
                TogglePlayerControllable(playerid, 1);
                 }
        }
    }
    return 1;
}
And this is my house define

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,
hLevel,
};

new HouseInfo[58][hInfo];

please help me....
Reply
#2

Did you have HouseCars in gamemod ?
Reply
#3

My FAIL! XD i make one STUPID mistake XD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)