Advertisement
TerminusEst13

magic at work

Mar 15th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. script SAMSARA_ENTER_CLIENT (void) clientside
  2. {
  3. int execInt, oExecInt, execStr;
  4. int pln = PlayerNumber();
  5. int startTime = Timer();
  6.  
  7. // Comment out this line for zdoom
  8. int cpln = ConsolePlayerNumber();
  9.  
  10. execInt = 0; oExecInt = 0;
  11.  
  12. while (ClientEnterTimes[pln] == startTime)
  13. {
  14. // Also this line
  15. if (cpln != pln) { Delay(1); continue; }
  16.  
  17. if (IsServer)
  18. {
  19. array_wolfmove[pln] = !!GetCVar("samsara_cl_wolfmove");
  20. array_vanillaAnim[pln] = !!GetCVar("samsara_cl_vanilladoom");
  21. array_ballgag[pln] = !!GetCVar("samsara_cl_ballgag");
  22. array_weaponBar[pln] = !!GetCVar("samsara_cl_weaponhud");
  23. array_pickupswitch[pln] = !!GetCVar("switchonpickup");
  24. }
  25. else
  26. {
  27. oExecInt = execInt;
  28. execInt = SamsaraClientVars();
  29.  
  30. if (execInt != oExecInt)
  31. {
  32. execStr = StrParam(s:"puke -", d:SAMSARA_PUKE, s:" ", d:execInt, s:" ", d:pln);
  33. ConsoleCommand(execStr);
  34. // This is an ugly, ugly hack. I hate it. But it works.
  35. }
  36. }
  37.  
  38. Delay(1);
  39. }
  40. }
  41.  
  42. script SAMSARA_PUKE (int values, int pln) net
  43. {
  44. array_wolfmove[pln] = values & 1;
  45. array_vanillaAnim[pln] = values & 2;
  46. array_ballgag[pln] = values & 4;
  47. array_weaponBar[pln] = values & 8;
  48. array_pickupswitch[pln] = values & 16;
  49. }
  50.  
  51.  
  52.  
  53. function int SamsaraClientVars(void)
  54. {
  55. int switchOnPickup = !!GetCVar("switchonpickup");
  56. int weaponBar = !!GetCVar("samsara_cl_weaponhud");
  57. int ballgag = !!GetCVar("samsara_cl_ballgag");
  58. int classicAnims = !!GetCVar("samsara_cl_vanilladoom");
  59. int wolfmove = !!GetCVar("samsara_cl_wolfmove");
  60.  
  61. return (switchOnPickup << 4) + (weaponBar << 3) + (ballgag << 2) + (classicAnims << 1) + wolfmove;
  62. }
  63.  
  64. script SAMSARA_SPAWN (int respawning)
  65. {
  66. int pln = PlayerNumber();
  67. int pcount, opcount;
  68. int startTime = Timer();
  69. int endloop;
  70. int canbuddha;
  71. int wsteSide;
  72. int armor, oarmor, type, otype;
  73. int i;
  74.  
  75. ServerEnterTimes[pln] = startTime;
  76.  
  77. [...]
  78.  
  79. while (!endloop && ServerEnterTimes[pln] == startTime)
  80. {
  81.  
  82. if (array_wolfmove[pln]) { GiveInventory("WolfenMovement", 1); }
  83. else { TakeInventory("WolfenMovement", 0x7FFFFFFF); }
  84.  
  85. if (array_ballgag[pln]) { GiveInventory("DukeBallgag", 1); }
  86. else { TakeInventory("DukeBallgag", 0x7FFFFFFF); }
  87.  
  88. [...]
  89.  
  90. Delay(1);
  91.  
  92. opcount = pcount;
  93. pcount = PlayerCount();
  94. }
  95.  
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement