Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //global
- const int STAT_TFSTATE_0 = 33; // Q1: Is this correct?
- void() worldspawn =
- {
- // this is where the ssqc variables get assigned to numbers CSQC can use/detect
- // received by CSQC, listed in csqc_my_csqc_defs.qc
- //clientstat(33, EV_INTEGER, tfstate);
- clientstat(34, EV_FLOAT, time_till_hack_finished);
- clientstat(35, EV_FLOAT, max_health);
- clientstat(36, EV_FLOAT, maxarmor);
- clientstat(37, EV_FLOAT, current_menu);
- clientstat(38, EV_FLOAT, respawn_time);
- clientstat(39, EV_FLOAT, job_finished); //STAT_TIMELEFT_TO_USE_SKILL
- clientstat(40, EV_FLOAT, is_in_tele); // is the player in a tele?
- clientstat(41, EV_FLOAT, job); //
- clientstat(42, EV_ENTITY, inspirator); //
- for (int i = 0; i < 32; i++)
- {
- pointerstat(STAT_TFSTATE_0+i, EV_INTEGER, &edict_num(i + 1).tfstate); //Q2: is *this correct?
- }
- //Q3: DO I need to do anything else in ssqc?
- // CSQC
- const int STAT_TFSTATE_0 = 43; // global Q4: is *this* right?
- void(float apilevel, string enginename, float engineversion) CSQC_Init =
- {
- .
- .
- deltalisten("progs/player.mdl", UpdatePlayer, 0);
- // 'self' is the entity which is using the model
- float(float isnew) UpdatePlayer =
- {
- .
- .
- .
- // runs every frame
- // this is how we get the players colour
- float team_no = stof(getplayerkeyvalue(self.colormap-1, "agr_team_no")); // I think this *used* to work? anyway, including it here for completion
- self.tfstate = getstati(STAT_TFSTATE_0+self.entnum); // Q5: is *this* right?
- print(sprintf("%s, colour %d, tfstate %i\n", etos(self), team_no, self.tfstate));
- //////////////////////
- prints:
- entity 4, colour 0, tfstate 0
- entity 4, colour 0, tfstate 0
- entity 4, colour 0, tfstate 0
- entity 4, colour 0, tfstate 0
- entity 4, colour 0, tfstate 0
- entity 4, colour 0, tfstate 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement