27.11.2010, 15:19
Well, since I'm working on a system, I want the system to read the ID of the file.
The file has a number.txt. Inside the txt there's an ID. Exactly the same as the .txt file.
So, I made this command to check what ID you're at:
(IsPlayerInRangeOfPoint has been made shorter, so it'll be easier to read).
Nothing's wrong with this command.
It works fine if the file is called 1.txt or the ID is 1..
This is the stock to load the content:
I just added the necessary part:
No errors.
This is a business system as you may have noticed.
I made it spawn an icon.
The icon is called
BusinessData[i][BusinessID] = CreatePickup(blabla);
So, it works; /enter, /exit, it reads everything the file has (entry fee, stock, everything I want it to read) except the ID.
If you stand on the icon, it will give information who the owner is, entry fee, stock, how much the business cost.
It loads that information, except the ID.
I don't really get it and it's hard to explain.
I hope you can help me with the information I gave you.
I do not wish to post the entire code to prevent copy&paste from people.
Thank you.
The file has a number.txt. Inside the txt there's an ID. Exactly the same as the .txt file.
So, I made this command to check what ID you're at:
pawn Код:
if(strcmp(cmd, "/checkbiz", true) == 0)
{
new file[31];
if(PlayerInfo[playerid][pAdmin] >= 99997) {
for(new i; i < sizeof(BusinessData); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, x,y,z))
{
format(file, sizeof(file), "BusinessData/%i.txt", BusinessData[i][BusinessID]);
format(string, sizeof(string), "You are at business ID: %i", dini_Int(file, "ID"));
SendClientMessage(playerid, NEWBIE_COLOR, string);
return 1;
} else {
SendClientMessage(playerid, COLOR_GRAD1, " You are not at a business.");
return 1;
}
}
}
}
Nothing's wrong with this command.
It works fine if the file is called 1.txt or the ID is 1..
This is the stock to load the content:
I just added the necessary part:
pawn Код:
BusinessData[j][BusinessID] = dini_Int(bfile, "ID");
This is a business system as you may have noticed.
I made it spawn an icon.
The icon is called
BusinessData[i][BusinessID] = CreatePickup(blabla);
So, it works; /enter, /exit, it reads everything the file has (entry fee, stock, everything I want it to read) except the ID.
If you stand on the icon, it will give information who the owner is, entry fee, stock, how much the business cost.
It loads that information, except the ID.
I don't really get it and it's hard to explain.
I hope you can help me with the information I gave you.
I do not wish to post the entire code to prevent copy&paste from people.
Thank you.