Player Name
#1

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....
Reply
#2

I have an array
pawn Код:
Name[MAX_PLAYERS][MAX_PLAYER_NAME]
and I store the players name OnPlayerConnect
Reply
#3

if you are confused, then don't use it
Reply
#4

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?
Reply
#5

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
Reply
#6

I recommend you to use PVars to store players name because using normal variables will make the AMX size big.
Reply
#7

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)