PVar whatever :P
#1

Hey can someone explain me Pvar or what ever is this thing? how to use it and so on.. thank you
Reply
#2

Everything is explain in the wiki but there is no reason to read that because normal arrays are far better

https://sampwiki.blast.hk/wiki/Per-player_variable_system

The only useful thing is that the memory can be shared between gamemode and filterscript
Reply
#3

You can just use a include with CallRemoteFunction() it's likely you'll need to use the pvar in several sections of code which would end up being slower than using CallRemoteFunction() and not to mention they look ugly and have no error checking for wrong tags best to avoid that non-sense.

I set my standard to never use a PVar for any purpose since they serve no purpose but to make ugly code.

@Edit One more thing, your probably taking the wrong approach if you have filterscripts running on a gamemode especially if the GM is heavily dependent on that FS. A good practice you should ask yourself if you really need to use a FS for what you are trying to do as callback hooking is almost no different than a FS except it allows you to compile the code directly into the gamemode. There are some circumstances where a FS is nice such as a acceleration script or a FS could possibly be part of a dynamic mission type system.

@Gamer_Z They are by no means a replacement, and when you start doing stuff like arrays inside of arrays your going to see a big difference. Also consider you'll probably be using PVars in your code as well which I think is ugly why bother with that non-sense? When it all unfolds throw PVars in the trash it's a stupid design choice I say the extra work is not extra work because I won't have to look at code that makes me sick. I don't believe your reason is a good excuse it's really a bad practice.
Reply
#4

Well thanks I will try to learn it somehow ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)