String too small?
#1

For my banning system, it saves a ban text file in Scriptfiles. everything works fine, except the unban. It's meant to save everything ban line in:
pawn Код:
new resave[500][128];
The first array is 500, which is the maximum amount of bans to save, the second is the lengh of it.

This Extracts each ban line to a different resave e.g. line 1 goes to resave[0], line 2 resave[1] etc...
pawn Код:
while(fread(bans,data,sizeof(data)))
{
  if(makes sure the line isnt the player's who's being banned, but is a ban line){strmid(resave[i],data,0,sizeof(data));}
  i++;
}
But when i compile, i get this:
Код:
Header size:      3832 bytes
Code size:      288304 bytes
Data size:      345772 bytes
Stack/heap size:   16384 bytes; estimated max. usage=65840 cells (263360 bytes)
Total requirements: 654292 bytes
Reply
#2

You're script is using too much memory, search around, this was asked many times.

Or use this:
Quote:

#pragma dynamic value
Sets the size, in cells, of the memory block for dynamic data (the stack and the heap) to the value specified by the expression. The default size of the dynamic data block is implementation defined. An implementation may also choose to grow the block on an as-needed basis (see the host program’s documentation, or the “Implementer’s Guide” for details).

Reply
#3

Once, It happened with me too. I fixed it by merging the loops in a Function.


Reply
#4

so would saving each ban in a separate file and then just deleting the file of the player being unbanned be a better solution?
Reply
#5

Well Yes you can do that too but Another alternative that you have is to use DiNi for maining the Banner player Databse. its pretty easier.

Thanks And Regars
-Abhinav
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)