[TF2attributes] Grab attributs of a player ?
Just wondering if there is anyway to grab a attribut of a player ?
I have done this : PHP Code:
And after I correctly grab the value of attribute in 'result' can I use it to like this ? PHP Code:
|
Re: [TF2attributes] Grab attributs of a player ?
you need to validate the return values...
also, if it doesn't matter what the value is, you can just set it, and it will overwrite the existing one. Likewise, you can call remove and it will safely remove it even if it's not there. |
Re: [TF2attributes] Grab attributs of a player ?
Is this on a Windows or Linux server?
It could be that the gamedata in TF2Attributes broke in a recent update (like yesterday's update). Quote:
|
Re: [TF2attributes] Grab attributs of a player ?
Yeah, doing that will get you an int of something like 91829382193 or something, when you wanted 2
int > float do float(val) float > int use RoundFloat, RoundToNearest, RoundToCeil, or RoundToFloor convert anything to boolean just do bool:val |
Re: [TF2attributes] Grab attributs of a player ?
Windows server, I'm trying to save the old to apply it later. I don't know how to validate the value. Fonction for this ?
Exemple : 1) Original "damage bonus" = 10%, I save it somewhere 2) I set to 50% using TF2Attrib_SetByName(client, "damage bonus", 0.50); and start a timer. 3) When timer end, I apply back the original value. (10%) using TF2Attrib_SetByName(client, "damage bonus", OLD_VALUE); So the correct to do this should be this ? PHP Code:
|
Re: [TF2attributes] Grab attributs of a player ?
PHP Code:
PHP Code:
|
Re: [TF2attributes] Grab attributs of a player ?
Thanks, gonna test. And what with this validation of value ?
|
Re: [TF2attributes] Grab attributs of a player ?
It should be noted that you will not always be able to get "old values" or even stock values from items, as they are not accessable at the moment, and will return as if the item doesn't have them at all (when in fact they do).
You'll always be able to read them however, if they were applied with tf2attributes, or if they are MVM upgrades. |
Re: [TF2attributes] Grab attributs of a player ?
Well, that's why my server crash ? Because when I run the plugin, server immediatly crash, without warnings.
EDIT : Well, you can't grab atttribut on weapon but only on player! That's why my server crash. So the correct code is : PHP Code:
|
All times are GMT -4. The time now is 20:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.