PDA

View Full Version : Stats error?



KingKong
01-20-2011, 06:35 AM
Ok, so I've finally decided to use stats in my script but seems that setvariable and Incvariable seem to do the same thing when commiting to the server.

Here are two commits when I used setvariable:
1) http://stats.villavu.com/commit/12734
2) http://stats.villavu.com/commit/12746

Here are two commits when I used incvariable:
1) http://stats.villavu.com/commit/12813
2) http://stats.villavu.com/commit/12825

Wizzup?
02-06-2011, 10:53 PM
I think you're not supposed to use setvariable at all.

KingKong
02-14-2011, 10:14 AM
I solved the problem by resetting the variable, but i don't see whats the point of having it in the includes, i thought setvariable just set the variable to whatever value you say, but it doesn't.

TomTuff
02-14-2011, 10:37 AM
The point of having it in the include is to initiate a variable that hasn't been added to yet. Don't go raging about because you can't read function headers.

KingKong
02-14-2011, 11:21 AM
(*
stats_SetVariable
~~~~~~~~~~~~~~~~~

.. code-block:: pascal
stats_SetVariable(VarName: string; NewValue: Integer);

Sets the passed variable to the new value regardless of old value. This method
behaves much like stats_InitVariable but checks for the variable present first.

Example:
.. code-block:: pascal
stats_SetVariable('runite', 10)
*)

Now, does that say anything about initiating a variable? Because there is already a proc for doing that, and if you actually used the function then you should've noticed that it does the same thing as Incvariable, which i was pointing out. Also, I was never raging, I was only wondering why it was included because its just a waste of 30 or so lines.

P.S. If i was raging I'd use an emote to show it, because words don't show emotions.

TomTuff
02-14-2011, 11:33 AM
I'm sorry, I thought you were trying to use "stats_InitVariable". The header for stats_InitVariable says not to call it anywhere else. Last time I looked at Stats.Simba, there were only 4 functions. Apologies.

KingKong
02-14-2011, 12:05 PM
No problemo, I understand, it was easy to be mistaken, apology accepted;)

KingKong
11-19-2011, 02:06 AM
A mighty BUMP here!:thumbsup:

Harry
11-19-2011, 02:18 AM
What are you bumping it for? Is your question not answered?

Coh3n
11-19-2011, 06:55 AM
You're only supposed to use stats_IncVariable and stats_Commit. The rest of the stats methods are used somehow in those functions.