House sistem help.. -
DyduShxD - 02.04.2013
Hello SAMP.COM
My system has 2 bugs houses, those being:
- No saves owner after restart
- Not everything is 3dtext to it ..
example-house is for sale | house server is shown only for
ajutatima please ..
Look here texts must occur and that the chown directories do not know what to give so please tell me you: D
Who will help me get + rep
Sorry my bad english
Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(string, sizeof(string), ""color_cyan"Owned"wh": "color_yellow"%s\n"color_cyan"Level"wh": %d",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
house1[h] = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], 0.8+HouseInfo[h][hEntrancez],10.0,0);
}
if(HouseInfo[h][hRentabil] == 1)
{
format(string, sizeof(string), ""color_cyan"Owned"wh": "color_yellow"%s\n"color_cyan"Rent"wh": "color_green"%d$ \n"color_cyan"Level"wh": %d\n"color_cyan"Type "color_yellow"/rentroom\n"color_cyan"To rent a room",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
house1[h] = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], 0.8+HouseInfo[h][hEntrancez],10.0,0);
}
}
if(HouseInfo[h][hOwned] == 0)
{
format(string, sizeof(string), ""color_cyan"House is for sale !\n"color_cyan"Discription"wh": %s\n"color_cyan"Cost"wh": "color_green"%d$\n"color_cyan"Level"wh": %d\n"color_cyan"To buy this house\ntype "color_yellow"/buyhouse",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
house1[h] = Create3DTextLabel(string,COLOR_YELLOW, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], 0.8+HouseInfo[h][hEntrancez],10.0,0);
}
}
Re: House sistem help.. -
FunnyBear - 02.04.2013
Show us how you save the house info
Re: House sistem help.. -
DyduShxD - 02.04.2013
Код:
public LoadProperty()
{
new arrCoords[30][64];
new strFromFile2[256];
new File: file = fopen("Properties/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]);
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]);
printf("HouseInfo:%d Owner:%s",idx,HouseInfo[idx][hOwner]);
idx++;
}
fclose(file);
}
return 1;
}
Код:
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][hWorld]);
HouseInfo[idx][hWorld] = idx;
if(idx == 0)
{
file2 = fopen("Properties/property.cfg", io_write);
}
else
{
file2 = fopen("Properties/property.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
If I did not look this good download link to gm ..
http://www.fileshare.ro/e29421903
Please help me newbie.
Re: House sistem help.. -
FunnyBear - 02.04.2013
Quote:
Originally Posted by FunnyBear
Show us how you save the house info
|
Why not use Y_INI instead of SAMPs simple log saving
Re: House sistem help.. -
DyduShxD - 02.04.2013
... Not much I'd like to get too complicated. can someone help me?
Re: House sistem help.. -
DyduShxD - 03.04.2013
UP? please
Respuesta: House sistem help.. -
Parka - 03.04.2013
make sure you have pHousekey
Re: House sistem help.. -
DyduShxD - 03.04.2013
One look and you can have it if you want the download link I left my gamemode