PDA

View Full Version : player.attr setting.


Chandler
03-08-2007, 06:18 PM
I use it for quite alot for things, I thought other people might use it too.

public function onremoveAttr(attrIndexs)
for (temp.currentAttr: temp.attrIndexs)
player.attr[temp.currentAttr] = "";

public function assignAttr(attrData)
for (temp.playerAttr: temp.attrData[0])
player.attr[temp.playerAttr] = temp.attrData[1][temp.attrData[0].index(temp.playerAttr)];

How it's used:

//Sets individual attrs
assignAttr({{2, 3},{"ter_statdisplay.gani", clientr.hp @"/"@ clientr.maxhp}});
this.assignAttr({{attrIndex0, attrIndex1}, {attrIndex0 value, attrIndex1 value}})
//Would clear both indexes
scheduleevent(5, "removeAttr", {2, 3}, ""); //Has a timer of five seconds
this.onremoveAttr({attrIndex0, attrIndex1}); //Removes indexs straight away