How to make more efficient
#1

So I have this:

pawn Код:
enum wInfo
{
    WantedZone,
    WantedTime
};
new WantedInfo[MAX_PLAYERS][MAX_PLAYERS[wInfo];
pawn Код:
WantedInfo[playerid][i][WantedZone] = GangZone();
I really don't think an array with that much data is really efficient and it could be slowing down some stuff.

Although I could do
pawn Код:
new string[128];
format(string, 128, "zone_%d", i);
SetPVarInt(playerid, string, GangZone());
But, I dont know if that is quite efficient and I would need to format the string everytime I loop through a player to check if the gangzone exists.

Any other ideas or methods?

Thanks.
Reply
#2

What are you trying to do?
Reply
#3

At least you could take down the string size, which will be a very bit slowing down. At second you could use an enum PlayerInfo in stead of a PVar (though I prefer PVars).

Btw, what are you wanting to do though?
Reply
#4

Use the array to make it faster/more memory. PVars slower/less memory.
The faster it is the less CPU it uses so i'd go with regular arrays. But there isn't much difference in it.
Go with what you prefer it won't make a difference to efficiency.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)