Advertisement
Pinkishu

Untitled

Oct 19th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. /*
  2.  
  3. Usage:
  4. say tool:set <player.variable> <value>
  5.  
  6. so e.g.
  7. tool:set x 5
  8. or
  9. tool:set ani walk
  10. etc
  11.  
  12. didn't have much ideas on what else to add ^^"
  13.  
  14.  
  15. */
  16.  
  17. function onActionServerSide()
  18. {
  19. if(!(findeapon(this.name) in player.weapons)) return;
  20.  
  21. switch(params[0])
  22. {
  23. case "set":
  24. {
  25. temp.attrName = params[1][0];
  26. params[1].delete(0);
  27. player.(@temp.attrName) = strjoin(params[1]," ");
  28. }
  29. break;
  30. }
  31. }
  32.  
  33. function strjoin(arra,sep)
  34. {
  35.  
  36. temp.ret = "";
  37. for(temp.i=0;temp.i<arra.size();temp.i++)
  38. {
  39. if(temp.ret!="") temp.ret @= sep;
  40. temp.ret @= arra[temp.i];
  41. }
  42. return temp.ret;
  43. }
  44.  
  45. // Scripted by *Inari (Inari)
  46. //#CLIENTSIDE
  47.  
  48. function onPlayerChats()
  49. {
  50. if(player.chat.starts("tool:"))
  51. {
  52. temp.toks = player.chat.tokenize(" ");
  53. temp.cmd = temp.toks[0].substring(5);
  54. temp.toks.delete(0);
  55.  
  56. switch(temp.cmd)
  57. {
  58. case "set":
  59. {
  60. triggerServer("gui",this.name,"set",temp.toks);
  61. }
  62. break;
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement