Player Name - 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: Player Name (
/showthread.php?tid=220928)
Player Name -
DRIFT_HUNTER - 04.02.2011
Well i got one question about player name
Is it better create new variable and use GetPlayerName(.....) for each cmd and function or just better store his name into variable at connect (for example in enum) and use it each time...
I think its better to store it once and use it each time....but i didnt see that anyone just store it once and use it always so thats why im confused....
Re: Player Name -
Rachael - 04.02.2011
I have an array
pawn Код:
Name[MAX_PLAYERS][MAX_PLAYER_NAME]
and I store the players name OnPlayerConnect
Re: Player Name -
Steven Paul - 04.02.2011
if you are confused, then don't use it
Re: Player Name -
DRIFT_HUNTER - 04.02.2011
Quote:
Originally Posted by Rachael
I have an array
pawn Код:
Name[MAX_PLAYERS][MAX_PLAYER_NAME]
and I store the players name OnPlayerConnect
|
Thx thats what i mean with STORE NAME JUST ONCE AND ALWAYS USE IT
Quote:
Originally Posted by Steven Paul
if you are confused, then don't use it
|
Man first read post than reply and how someone can learn if he dont use it?
AW: Player Name -
Nero_3D - 04.02.2011
Memory Usage ~ Speed
Means if you use more memory (in form of an array as example) your code will be faster (should be clear why)
Its a matter of opinion what to do but memory is today not limited so do it
Re: Player Name -
MrDeath537 - 04.02.2011
I recommend you to use PVars to store players name because using normal variables will make the AMX size big.
Re: Player Name -
Mean - 04.02.2011
Quote:
Originally Posted by MrDeath537
I recommend you to use PVars to store players name because using normal variables will make the AMX size big.
|
Yes but normal variables are faster than PVars, that's why I use them. And you prolly' got enough HDD space, so why to save few kilobytes that normal vars use?
Speed or more disk space? I would choose speed!