Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function init()
- {
- switch(this.objType)
- {
- case "character":
- this.join("rpg_container");
- this.subDir = (this.id.substring(0, 2) @ "/");
- break;
- case "item":
- this.join("rpg_item");
- break;
- default:
- echo("Non-existant type: " @ this.objType @ " in " @ this.name @ "!");
- break;
- }
- if(fileexists("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt"))
- {
- this.loadVars("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt");
- }
- if(this.displayName.pos("/") != -1)
- {
- this.displayName = this.displayName.substring(this.displayName.pos("/"));
- }
- }
- public function uninit()
- {
- this.saveVars("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt", 0);
- sleep(0.1);
- this.destroy();
- }
- public function reflect()
- {
- for(temp.var: server.reflectvars)
- {
- findPlayerByCommunityName(this.id).clientr.(@temp.var) = this.(@temp.var);
- }
- }
- public function reflectItems()
- {
- temp.super = findPlayerByCommunityName(this.id);
- temp.super.clientr.itemList = {};
- for(temp.var: this.items)
- {
- temp.itemObj = makevar("item_" @ temp.var[0]);
- temp.super.clientr.itemc.(@temp.var[0]) = temp.var[1];
- temp.super.clientr.itemList.add({temp.var[0], temp.itemObj.iconImage, temp.itemObj.catagory});
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement