PVar or Variables?
#1

Heey all,

My whole script is bugged so i am debugging it.
I am using much variables.
Whats better to use: Variables or Pvar?

Thanks Admigo
Reply
#2

Variables of course
Reason is here:
https://sampforum.blast.hk/showthread.php?tid=268499
Reply
#3

i have to admit: i was (still am indeed) using PVars for almost every variable. they are "slower", we ALL know that, but is listing 100 variables once per 4 seconds worth a /cry? it will not harm your server performance if you load a debug filterscript, handle some checks (your admin level==16? interior set properly?) with pvars.
if you script each single variable like
Код:
if(GotShit#1[playerid]>0) blablaa
if(GotShit#2[playerid]<4)blabla else something else blabla
if(GotEvenMoreAwesomeShit[playerid] equals blabla2 etcetcetc
this list could go on for 200 variables, its a fucking hazzle to manage all of them,
OR:
one single loop using GetPVarsUpperIndex(), maybe a proper dialog input+response.if you are done debugging, unload the filterscript which handles pvars. done.

to all who are complaining about the bad performance of PVars: try to script your own system which enables all scripts to access them. no file operations allowed = you'll fail.
i sometimes wonder why theyre got invented. to be ignored, i guess...
Reply
#4

It really depends on the situation, you can script some very neat things while combining pvars and gvars, properties. I use pvars in situations where I don't know how much of something there will be and don't really want a set limit.
Reply
#5

Okay and what about my script? Should i place all codes in gamemode or make filterscripts to?
Reply
#6

start with the gamemode itself. as soon you see "oh, this command/skill should be placed in the adminscript", then do that. tbh, i did it this way: move all shit from gamemode to a filterscript, then you are forced to use G/P vars. if that works, you may move some code which unlikely will be changed, back to the gamemode.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)