How to avoid limits?
#1

Hello, so for example I have a clan system on gamemode and the limit is defined 100.
The variables for the clan system are as below:
#define MAX_CLANS (100)
enum cInfo
{
cID
//some variables
}
new ClanInfo[MAX_CLANS][cInfo];

How can I avoid this limitation? Is this possible?
I know the question sounds a little stupid but I am really wonder how to do this and if is possible..
Thanks in advance!
Reply
#2

So why you wanna do this?

Actually a Limit is not bad.

Anyway, yes it is possible with many ways.

One would be store things in a Property: https://sampwiki.blast.hk/wiki/Setproperty

Or Store things for players in PVars and save it player specific in a database/file.

You could do risky memory hacking: https://github.com/BigETI/pawn-memory (https://sampwiki.blast.hk/wiki/Memory_a...angerous_sides)

But you should stay in a Limit..i mean you could set it to 1000 this should be rly enough xD
Its just the heap space, so it doesn't really matter, just makes your amx a bit big.
Reply
#3

For example (My)SQL and clever data structuring can avoid most limits with these systems. This should rather be a question of good design than available memory.
There is no need for all clan info to be loaded at all times or even to be stored in the server's memory altogether.

Even without (My)SQL it is possible to do. For example have only the "main" data of a clan loaded when there is at least one player of that clan online. There might be 1500 clans (theoretically) but it's impossible for 1500 clans to be used at the same time. I'd even say it's highly unlikely for more than ~50 clans to be active at once even with 300 players. There are clan-less players (I assume) and having multiple people in one clan is why clans exist.
Reply
#4

Quote:
Originally Posted by NaS
Посмотреть сообщение
For example (My)SQL and clever data structuring can avoid most limits with these systems. This should rather be a question of good design than available memory.
There is no need for all clan info to be loaded at all times or even to be stored in the server's memory altogether.

Even without (My)SQL it is possible to do. For example have only the "main" data of a clan loaded when there is at least one player of that clan online. There might be 1500 clans (theoretically) but it's impossible for 1500 clans to be used at the same time. I'd even say it's highly unlikely for more than ~50 clans to be active at once even with 300 players. There are clan-less players (I assume) and having multiple people in one clan is why clans exist.
First of all thanks for your reply! I don't really want to avoid limits to my clan system, but at other systems like dealership, houses yes, and that's why I asked for. So about MySQL, I'm using Blug's plugin, can you give me an example? Thanks!
Quote:
Originally Posted by Kaliber
Посмотреть сообщение
So why you wanna do this?

Actually a Limit is not bad.

Anyway, yes it is possible with many ways.

One would be store things in a Property: https://sampwiki.blast.hk/wiki/Setproperty

Or Store things for players in PVars and save it player specific in a database/file.

You could do risky memory hacking: https://github.com/BigETI/pawn-memory (https://sampwiki.blast.hk/wiki/Memory_a...angerous_sides)

But you should stay in a Limit..i mean you could set it to 1000 this should be rly enough xD
Its just the heap space, so it doesn't really matter, just makes your amx a bit big.
Thank you for showing me this method!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)