SetPVar
#1

Hey guys, what should be actually more efficient
PHP код:
new x[MAX_PLAYERS];
x[playerid] = 1;
//
SetPVarInt(playerid"x"1); 
Reply
#2

Well Option A,as i was told Pvars or slower than arrays.
Reply
#3

(Dis)advantages listed here.

EDIT:
Depends on the situation. If you have an array of MAX_PLAYERS of which you know only a select few elements will be used not very frequently, a PVar is a better choice I think. Otherwise the other elements are just wasted space. On the other hand, if many elements of the array will be used frequently, a normal array would be better. A PVar will still be slower than a normal variable though.
Reply
#4

Only use a PVar when you want to use that same variable within the gamemode and other filterscripts at the same time.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Only use a PVar when you want to use that same variable within the gamemode and other filterscripts at the same time.
Nah thats not true..

It is good to use..for example in Dialogs..to save a specific player value..cause the performance in this situation doesn't matters..and it get deleted..when the dialog was reached...
So you have 0 space waste...for things like temporary availability this is very usefull
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)