Esta parte eu consegui.. mais ae chego nas nas casas/empresas/banco tem coisas estranhas tipo:
PHP код:
if (strcmp(ParameterName, "Business", false) == 0) // If the parametername is correct ("Business")
{
if (strcmp(ABusinessData[strval(ParameterValue)][Owner], Name, false) == 0) // Check if the player is the true owner of the business
{
APlayerData[playerid][Business][BusIndex] = strval(ParameterValue); // Store the BusinessID at the selected slot
BusIndex++; // Select the next business-slot in case another business-id is found
}
}
PHP код:
for (new i; i < MAX_BUSINESSPERPLAYER; i++)
{
// Check if there is a valid business-id in this slot
if (APlayerData[playerid][Business][i] != 0)
{
format(LineForFile, 100, "Business %i\r\n", APlayerData[playerid][Business][i]); // Construct the line: "Business <BusinessID>"
fwrite(PFile, LineForFile); // And save it to the file
}
}
PHP код:
BusinessTime_Load()
{
// Setup local variables
new File:BFile, LineFromFile[100], ParameterName[50], ParameterValue[50];
// Try to load the businesstime file
if (fexist("ServerData/Business/BusinessTime.ini"))
{
BFile = fopen("ServerData/Business/BusinessTime.ini", io_read); // Open the businesstime-file for reading
fread(BFile, LineFromFile); // Read the first line of the file
// Keep reading until the end of the file is found (no more data)
while (strlen(LineFromFile) > 0)
{
StripNewLine(LineFromFile); // Strip any newline characters from the LineFromFile
sscanf(LineFromFile, "s[50]s[50]", ParameterName, ParameterValue); // Extract parametername and parametervalue
// Store the proper value in the proper place
if (strcmp(ParameterName, "BusinessTime", false) == 0) // If the parametername is correct ("BusinessTime")
BusinessTransactionTime = strval(ParameterValue); // Store the BusinessTime
// Read the next line of the file
fread(BFile, LineFromFile);
}
// Close the file
fclose(BFile);
// Return if the file was read correctly
return 1;
}
else
return 0; // Return 0 if the file couldn't be read (doesn't exist)
}
// This function saves the file that holds the current business-time
BusinessTime_Save()
{
new File:BFile, LineForFile[100];
BFile = fopen("ServerData/Business/BusinessTime.ini", io_write); // Open the businesstime-file for writing
format(LineForFile, 100, "BusinessTime %i\r\n", BusinessTransactionTime); // Construct the line: "BusinessTime <BusinessTransactionTime>"
fwrite(BFile, LineForFile); // And save it to the file
fclose(BFile); // Close the file
return 1;
}
Alguem poderia me ajudar com alguns salvamentos?