Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function init()
  2. {
  3.   switch(this.objType)
  4.   {
  5.     case "character":
  6.       this.join("rpg_container");
  7.       this.subDir = (this.id.substring(0, 2) @ "/");
  8.     break;
  9.    
  10.     case "item":
  11.       this.join("rpg_item");
  12.     break;
  13.    
  14.     default:
  15.       echo("Non-existant type: " @ this.objType @ " in " @ this.name @ "!");
  16.     break;
  17.   }
  18.  
  19.   if(fileexists("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt"))
  20.   {
  21.     this.loadVars("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt");
  22.   }
  23.   if(this.displayName.pos("/") != -1)
  24.   {
  25.     this.displayName = this.displayName.substring(this.displayName.pos("/"));
  26.   }
  27. }
  28.  
  29. public function uninit()
  30. {
  31.   this.saveVars("rpg/" @ this.objType @ "s/" @ this.subDir @ this.id @ ".txt", 0);
  32.   sleep(0.1);
  33.   this.destroy();
  34. }
  35.  
  36. public function reflect()
  37. {
  38.   for(temp.var: server.reflectvars)
  39.   {
  40.     findPlayerByCommunityName(this.id).clientr.(@temp.var) = this.(@temp.var);
  41.   }
  42. }
  43.  
  44. public function reflectItems()
  45. {
  46.   temp.super = findPlayerByCommunityName(this.id);
  47.  
  48.   temp.super.clientr.itemList = {};
  49.  
  50.   for(temp.var: this.items)
  51.   {
  52.     temp.itemObj = makevar("item_" @ temp.var[0]);
  53.     temp.super.clientr.itemc.(@temp.var[0]) = temp.var[1];
  54.     temp.super.clientr.itemList.add({temp.var[0], temp.itemObj.iconImage, temp.itemObj.catagory});
  55.   }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement