SetPVarInt/SetPVarString vs Enum
#5

Using normal vars/enums can also reduce the amount of code you write like when incrementing a variable.

PVars
pawn Code:
SetPVarInt(playerid, "SomethingE", GetPVarInt(playerid, "SomethingE") +1);
Normal
pawn Code:
Something[playerid][SomethingE]++;
Also a good reason i only use a few PVars is you wont get a warning if you misspell the var somewhere (thats not good). And incase i forget a name of a var (imagine you have 100s of vars), i like being able to look at the top of the code for declarations and not have to look inside functions for variable names. They are my personal prefereces but normal vars also use less CPU, which IMO makes normal vars superior to PVars. But PVars have they're uses/advantages like adamantis said they can be used cross script (you could create functions to do that with normal vars too).
Reply


Messages In This Thread
SetPVarInt/SetPVarString vs Enum - by NRJ53 - 15.05.2011, 21:25
Re: SetPVarInt/SetPVarString vs Enum - by linuxthefish - 15.05.2011, 21:31
Re: SetPVarInt/SetPVarString vs Enum - by NRJ53 - 15.05.2011, 23:11
Respuesta: SetPVarInt/SetPVarString vs Enum - by admantis - 15.05.2011, 23:22
Re: SetPVarInt/SetPVarString vs Enum - by iggy1 - 15.05.2011, 23:28
Re: SetPVarInt/SetPVarString vs Enum - by NRJ53 - 15.05.2011, 23:40
Re: SetPVarInt/SetPVarString vs Enum - by iggy1 - 15.05.2011, 23:42
Re: SetPVarInt/SetPVarString vs Enum - by NRJ53 - 15.05.2011, 23:50
Re: SetPVarInt/SetPVarString vs Enum - by Vince - 16.05.2011, 07:26

Forum Jump:


Users browsing this thread: 2 Guest(s)