25.11.2011, 19:39
pawn Код:
public Atualizar3Dtexts()
{
for(new h = 0; h < sizeof(HouseInfo); h++)
{
Delete3DTextLabel(HouseLabel[h]);
if(HouseInfo[h][hOwned] == 0)
{
format(gstring, sizeof(gstring), "Casa A Venda\nTipo: %s\nValor: R$%d\nNivel: %d\nPara comprar digite /comprarcasa",HouseInfo[h][hDiscription],HouseInfo[h][hValue],HouseInfo[h][hLevel]);
HouseLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15.0,0);
}
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hRentabil] == 0)
{
format(gstring, sizeof(gstring), "Dono: %s\nNivel: %d",HouseInfo[h][hOwner],HouseInfo[h][hLevel]);
HouseLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15.0,0);
}
else
{
format(gstring, sizeof(gstring), "Dono: %s\nAluguel: R$%d\nNivel: %d\nDigite /alugarquarto para alugar um quarto",HouseInfo[h][hOwner],HouseInfo[h][hRent],HouseInfo[h][hLevel]);
HouseLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]+0.5,15.0,0);
}
}
}
for(new h = 0; h < sizeof(BizzInfo); h++)
{
Delete3DTextLabel(BizzLabel[h]);
if(BizzInfo[h][bOwned] == 0)
{
format(gstring, sizeof(gstring), "%s\nEsta empresa esta a venda\nValor: R$%d Nivel: %d\nPara comprar digite /compraremp",BizzInfo[h][bMessage],BizzInfo[h][bBuyPrice],BizzInfo[h][bLevelNeeded]);
BizzLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,20.0,0);
}
if(BizzInfo[h][bOwned] == 1)
{
format(gstring, sizeof(gstring), "%s\nDono: %s\nExtorcao: %s\nEntrada: R$%d\nNivel: %d\nAperte Enter Para Entrar",BizzInfo[h][bMessage],BizzInfo[h][bOwner],BizzInfo[h][bExtortion],BizzInfo[h][bEntranceCost],BizzInfo[h][bLevelNeeded]);
BizzLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ]+0.5,20.0,0);
}
}
for(new h = 0; h < sizeof(SBizzInfo); h++)
{
Delete3DTextLabel(SBizzLabel[h]);
if(SBizzInfo[h][sbOwned] == 0)
{
format(gstring, sizeof(gstring), "%s\nEsta empresa esta a venda\nValor: R$%d Nivel: %d\nPara comprar digite /compraremp",SBizzInfo[h][sbMessage],SBizzInfo[h][sbBuyPrice],SBizzInfo[h][sbLevelNeeded]);
SBizzLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.5,20.0,0);
}
if(SBizzInfo[h][sbOwned] == 1)
{
format(gstring, sizeof(gstring), "%s\nDono: %s\nExtorcao: %s\nEntrada: R$%d\nNivel: %d\nAperte Enter Para Entrar",SBizzInfo[h][sbMessage],SBizzInfo[h][sbOwner],SBizzInfo[h][sbExtortion],SBizzInfo[h][sbEntranceCost],SBizzInfo[h][sbLevelNeeded]);
SBizzLabel[h] = Create3DTextLabel(gstring,COLOR_AZULBB,SBizzInfo[h][sbEntranceX], SBizzInfo[h][sbEntranceY], SBizzInfo[h][sbEntranceZ]+0.5,20.0,0);
}
}
}
pawn Код:
public 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][hArmorrx],
HouseInfo[idx][hArmorry],
HouseInfo[idx][hArmorrz],
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("Configs/property.cfg", io_write);
}
else
{
file2 = fopen("Configs/property.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(BizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d\n",
BizzInfo[idx][bOwned],
BizzInfo[idx][bOwner],
BizzInfo[idx][bMessage],
BizzInfo[idx][bExtortion],
BizzInfo[idx][bEntranceX],
BizzInfo[idx][bEntranceY],
BizzInfo[idx][bEntranceZ],
BizzInfo[idx][bExitX],
BizzInfo[idx][bExitY],
BizzInfo[idx][bExitZ],
BizzInfo[idx][bLevelNeeded],
BizzInfo[idx][bBuyPrice],
BizzInfo[idx][bEntranceCost],
BizzInfo[idx][bTill],
BizzInfo[idx][bLocked],
BizzInfo[idx][bInterior]);
if(idx == 0)
{
file2 = fopen("Configs/bizz.cfg", io_write);
}
else
{
file2 = fopen("Configs/bizz.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
idx = 0;
while (idx < sizeof(SBizzInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%d|%s|%s|%s|%f|%f|%f|%d|%d|%d|%d|%d\n",
SBizzInfo[idx][sbOwned],
SBizzInfo[idx][sbOwner],
SBizzInfo[idx][sbMessage],
SBizzInfo[idx][sbExtortion],
SBizzInfo[idx][sbEntranceX],
SBizzInfo[idx][sbEntranceY],
SBizzInfo[idx][sbEntranceZ],
SBizzInfo[idx][sbLevelNeeded],
SBizzInfo[idx][sbBuyPrice],
SBizzInfo[idx][sbEntranceCost],
SBizzInfo[idx][sbTill],
SBizzInfo[idx][sbLocked]);
if(idx == 0)
{
file2 = fopen("Configs/sbizz.cfg", io_write);
}
else
{
file2 = fopen("Configs/sbizz.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}