Advertisement
Guest User

Help!!

a guest
Nov 19th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.80 KB | None | 0 0
  1. //global
  2. const int STAT_TFSTATE_0 = 33; // Q1: Is this correct?
  3.  
  4. void() worldspawn =
  5. {  
  6.  
  7.    
  8.     // this is where the ssqc variables get assigned to numbers CSQC can use/detect
  9.     // received by CSQC, listed in csqc_my_csqc_defs.qc
  10.     //clientstat(33, EV_INTEGER, tfstate);
  11.     clientstat(34, EV_FLOAT, time_till_hack_finished);
  12.     clientstat(35, EV_FLOAT, max_health);
  13.     clientstat(36, EV_FLOAT, maxarmor);
  14.     clientstat(37, EV_FLOAT, current_menu);
  15.     clientstat(38, EV_FLOAT, respawn_time);
  16.     clientstat(39, EV_FLOAT, job_finished); //STAT_TIMELEFT_TO_USE_SKILL
  17.     clientstat(40, EV_FLOAT, is_in_tele); // is the player in a tele?
  18.     clientstat(41, EV_FLOAT, job); //
  19.     clientstat(42, EV_ENTITY, inspirator); //
  20.    
  21.    
  22.    
  23.    
  24.     for (int i = 0; i < 32; i++)
  25.     {
  26.         pointerstat(STAT_TFSTATE_0+i, EV_INTEGER, &edict_num(i + 1).tfstate); //Q2: is *this correct?
  27.  
  28.     }
  29.  
  30. //Q3: DO I need to do anything else in ssqc?
  31.  
  32.  
  33. // CSQC
  34. const int STAT_TFSTATE_0 = 43; // global Q4: is *this* right?
  35.  
  36.  
  37. void(float apilevel, string enginename, float engineversion) CSQC_Init =
  38. {
  39. .
  40. .
  41. deltalisten("progs/player.mdl", UpdatePlayer, 0);
  42.  
  43.  
  44.  
  45.  
  46. // 'self' is the entity which is using the model
  47. float(float isnew) UpdatePlayer =
  48. {
  49. .
  50. .
  51. .
  52.     // runs every frame
  53.  
  54.     // this is how we get the players colour    
  55.         float team_no = stof(getplayerkeyvalue(self.colormap-1, "agr_team_no")); // I think this *used* to work? anyway, including it here for completion
  56.  
  57.     self.tfstate = getstati(STAT_TFSTATE_0+self.entnum); // Q5: is *this* right?
  58.         print(sprintf("%s, colour %d, tfstate %i\n", etos(self), team_no, self.tfstate));
  59.  
  60. //////////////////////
  61. prints:
  62. entity 4, colour 0, tfstate 0
  63. entity 4, colour 0, tfstate 0
  64. entity 4, colour 0, tfstate 0
  65. entity 4, colour 0, tfstate 0
  66. entity 4, colour 0, tfstate 0
  67. entity 4, colour 0, tfstate 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement