Could this idea work out - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Could this idea work out (
/showthread.php?tid=249146)
Could this idea work out -
Voldemort - 17.04.2011
So, since my scipt is getting bigger and bigger, now its compiling over 1 min, so now I started to think about one idea how to reduce that time, yes Im going to optimize string lenghts etc, just that would save me only some 10 secs, so here comes my idea
what about make FS where I make like
new PlayerVar[MAX_PLAYERS];
new PlayerVar2[MAX_PLAYERS];
and so on
And in Main Gamemode just use CallRemoteFunction to write data in these variables.
in FS it could look like this
pawn Код:
new PV[MAX_PLAYERS];
SetVar(playerid,value)
{
PV[playerid] = value;
}
GetVar(playerid)
{
return PV[playerid];
}
and in Gamemode
pawn Код:
CallRemoteFunction("SetVar","ii",playerid,value);
and
MyValue = CallRemoteFunction("GetVar","i",playerid);
So my question is will this slow down proccesing time?
And no I dont want start to use PVars
Re: Could this idea work out -
iJumbo - 17.04.2011
have you make this
#undef MAX_PLAYERS
#define MAX_PLAYERS Your max players
you can get more faster compiling
Re: Could this idea work out -
Voldemort - 17.04.2011
That is already done, I have redefined to 75, but still, I have over some 300 per player variables
Re: Could this idea work out -
Vince - 17.04.2011
Quote:
Originally Posted by Voldemort
just use CallRemoteFunction to write data in these variables.
|
No, just no. CallRemoteFunction is
the slowest function ever.
Quote:
Originally Posted by ******
Different language features take different times to execute, in general the order is (from fastest to slowest):
Nothing
Constants
Variables
Arrays
Native functions
Custom functions
Remote functions
|
AW: Could this idea work out -
Nero_3D - 17.04.2011
I rly dont want to know why people need that many player based variables
Quote:
Originally Posted by Voldemort
And no I dont want start to use PVars
|
Why not?