Problem with entering -
Universal - 26.12.2011
FIXED it by myself. Thanks for help.
Re: Problem with entering -
Calgon - 26.12.2011
You probably need to increase the size of the following defines:
- MAX_HOUSES
- MAX_BIZZ
- MAX_ENTRANCES
The problem with your code is that if a player tries to enter a house, business or entrance that has a higher ID than the define, it will just ignore it and they won't be able to enter.
For example, if you create a house and its ID is 504, but if MAX_HOUSES is 503, every house up to 503 will be checked, but anything higher will just be ignored.
Re: Problem with entering -
Universal - 26.12.2011
Quote:
Originally Posted by Calgon
You probably need to increase the size of the following defines: - MAX_HOUSES
- MAX_BIZZ
- MAX_ENTRANCES
The problem with your code is that if a player tries to enter a house, business or entrance that has a higher ID than the define, it will just ignore it and they won't be able to enter.
For example, if you create a house and its ID is 504, but if MAX_HOUSES is 503, every house up to 503 will be checked, but anything higher will just be ignored.
|
Yes, but I defined my MAX_HOUSES and others to the actual size of hosues and bizzes and others that I have in my db... And I added +1 to that define also...
EDIT: I deleted about 50 bizz'es and about 100 hosues from my db, and now its working perfectly. But it cant be that way, because I need more houses and other stuff...
Re: Problem with entering -
Calgon - 26.12.2011
Try increase it to a higher amount, as your IDs might exceed the MAX_* defines, but you may have less than the define.
Re: Problem with entering -
Universal - 26.12.2011
Quote:
Originally Posted by Calgon
Try increase it to a higher amount, as your IDs might exceed the MAX_* defines, but you may have less than the define.
|
I tried that also. Instead of MAX_BIZZ, MAX_HOSUES... I created two variables: Hosues, Bizzes.
I'll give you an example:
Im loading my stuff from db this way:
pawn Код:
LoadBizzes()
{
format(Sql, sizeof(Sql), "SELECT * FROM bizz");
mysql_query(Sql);
mysql_store_result();
new
id = 0;
if(mysql_num_rows())
{
while(mysql_retrieve_row())
{
...
Then in the back of this while loop, i do:
Also, I use this "id" var, as an id of bizzes and houses I load. (bizzDB[
id][owner] = blahblah)
On the end of this Load function I did:
So now it stores the actual size of bizzes. I tried to use that instead of MAX_BIZZ in the OnPlayerKeyStateChange... But nothing happened. Is there a limit or something?
Re: Problem with entering -
Universal - 26.12.2011
Can someone help me? Im need of a help very much.