18/03/2021 12:39
Código PHP:
Business_CreateEntrance(BusID)
{
// Setup local variables
new Msg[1000], Float:x, Float:y, Float:z, BusType, Icon;
// Get the coordinates of the house's pickup (usually near the door)
x = ABusinessData[BusID][BusinessX];
y = ABusinessData[BusID][BusinessY];
z = ABusinessData[BusID][BusinessZ];
// Get the business-type and icon
BusType = ABusinessData[BusID][BusinessType];
Icon = ABusinessInteriors[BusType][IconID];
// Add a dollar-sign to indicate this business
ABusinessData[BusID][PickupID] = CreateDynamicPickup(1274, 1, x, y, z, 0);
// Add a map-icon depending on which type the business is
ABusinessData[BusID][MapIconID] = CreateDynamicMapIcon(x, y, z, Icon, 0, 0, 0, -1, 150.0);
// Add a new 3DText at the business's location (usually near the door)
if (ABusinessData[BusID][Owned] == true)
{
new FileAccount[100];
format(FileAccount, sizeof(FileAccount), PlayerFile, ABusinessData[BusID][Owner]);
if(fexist(FileAccount))
{
new File:ArquivoConta, StrConta[48], LineFromFile[100], ParameterName[50], ParameterValue[50];
format(StrConta, 48, PlayerFile, ABusinessData[BusID][Owner]);
ArquivoConta = fopen(StrConta, io_read);
fread(ArquivoConta, LineFromFile);
while (strlen(LineFromFile) > 0)
{
StripNewLine(LineFromFile);
sscanf(LineFromFile, "s[50]s[50]", ParameterName, ParameterValue);
if (strcmp(ParameterName, "UltimoLogin", false) == 0)
format(ABusinessData[BusID][UltimoLogin], 30, ParameterValue); // Ultimo Login Casa
fread(ArquivoConta, LineFromFile);
}
fclose(ArquivoConta);
// Create the 3DText that appears above the business-pickup (displays the businessname, the name of the owner and the current level)
format(Msg, 1000, "%s\n{FFC978}Empresa ID: %i\nDono: %s\nEmpresa-level: %i\nTipo:%s\nUltimo Login: %s\n/entrar ou Aperte F", ABusinessData[BusID][BusinessName], BusID, ABusinessData[BusID][Owner], ABusinessData[BusID][BusinessLevel],ABusinessInteriors[BusType][InteriorName], ABusinessData[BusID][UltimoLogin]);
ABusinessData[BusID][DoorText] = CreateDynamic3DTextLabel(Msg, corcasa, x, y, z + 1.0, 15.0);
}
}
else
{
// Create the 3DText that appears above the business-pickup (displays the price of the business and the earnings)
format(Msg, 280, "%s\nPreco\nR$%s\nGanhos: R$%s\n/comprarempresa", ABusinessInteriors[BusType][InteriorName], ConvertMoney(ABusinessInteriors[BusType][BusPrice]), ConvertMoney(ABusinessInteriors[BusType][BusEarnings]));
ABusinessData[BusID][DoorText] = CreateDynamic3DTextLabel(Msg, corcasa, x, y, z + 1.0, 15.0);
}
}