Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   onPlayerAttributesUpdated() (https://forums.graalonline.com/forums/showthread.php?t=85694)

Chompy 05-23-2009 10:30 AM

onPlayerAttributesUpdated()
 
An event occuring when a player get their attributes changed by RC ('edit attributes' or '/open <account>' for example).

Parameters: Player object or account name
Usage: I had in mind using it for an automatic staff-abuse detector, but it could have other usages as well.

Having this function would make it easier to make systems monitoring staff-abuse.
Instead of having a timeout checking all the player's variables every that amount of seconds, a function like this would eliminate just that.

Thoughts?

PS, would be nice to have onServerOptionsUpdated() too

Crow 05-23-2009 12:12 PM

I support this/these idea(s).

cbk1994 05-23-2009 06:48 PM

Awesome idea; it could also be used to solve some problems with items stored in flags (e.g. cutting off when you update with RC), though I can't think of a perfect way right now, since this would still require you to use text files. I suppose you could do something like

PHP Code:

function onPlayerAttributesUpdated(pl) {
  
temp.items.loadVars("players/" pl.account);
  
  for (
temp.item items.getDynamicVarNames()) {
    
pl.clientr.item.(@ item[0]) = {item[1], item[2], [...]};
  }



Chompy 05-23-2009 06:55 PM

Quote:

Originally Posted by cbk1994 (Post 1493410)
Awesome idea; it could also be used to solve some problems with items stored in flags (e.g. cutting off when you update with RC), though I can't think of a perfect way right now, since this would still require you to use text files. I suppose you could do something like

PHP Code:

function onPlayerAttributesUpdated(pl) {
  
temp.items.loadVars("players/" pl.account);
  
  for (
temp.item items.getDynamicVarNames()) {
    
pl.clientr.item.(@ item[0]) = {item[1], item[2], [...]};
  }



Yep, if you have an item system or any other system using variables with a value length over 255, you could use the event to fix the variable.


All times are GMT +2. The time now is 07:44 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.