- self.playerdemo_mode = 0;
-}
-void playerdemo_open_read(string f)
-{
- playerdemo_shutdown();
- self.playerdemo_mode = PLAYERDEMO_MODE_READING;
- self.playerdemo_fh = fopen(f, FILE_READ);
- self.playerdemo_starttime = time - 1;
- self.playerdemo_time = stof(fgets(self.playerdemo_fh));
- self.playerdemo_time += self.playerdemo_starttime;
- self.movetype = MOVETYPE_NONE;
- print("playerdemo: ", self.netname, " reading from ", f, "\n");
-}
-void playerdemo_open_write(string f)
-{
- playerdemo_shutdown();
- self.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
- self.playerdemo_fh = fopen(f, FILE_WRITE);
- self.playerdemo_starttime = time - 1;
- print("playerdemo: ", self.netname, " writing to ", f, "\n");
- print("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
-}
-#define PLAYERDEMO_FIELD(func,t,f) func##t(f,#f);
-#define PLAYERDEMO_FIELDS(func) \
- PLAYERDEMO_FIELD(func,originvector,origin) \
- PLAYERDEMO_FIELD(func,vector,angles) \
- PLAYERDEMO_FIELD(func,sizevector,mins) \
- PLAYERDEMO_FIELD(func,sizevector,maxs) \
- PLAYERDEMO_FIELD(func,vector,v_angle) \
- PLAYERDEMO_FIELD(func,modelstring,model) \
- PLAYERDEMO_FIELD(func,string,playermodel) \
- PLAYERDEMO_FIELD(func,float,skin) \
- PLAYERDEMO_FIELD(func,string,playerskin) \
- PLAYERDEMO_FIELD(func,float,frame) \
- PLAYERDEMO_FIELD(func,float,effects) \
- PLAYERDEMO_FIELD(func,float,switchweapon) \
- PLAYERDEMO_FIELD(func,float,BUTTON_ATCK) \
- PLAYERDEMO_FIELD(func,float,BUTTON_ATCK2) \
- PLAYERDEMO_FIELD(func,float,BUTTON_CROUCH) \
- PLAYERDEMO_FIELD(func,float,BUTTON_HOOK) \
- PLAYERDEMO_FIELD(func,float,BUTTON_USE) \
- PLAYERDEMO_FIELD(func,float,flags) \
+ this.playerdemo_mode = 0;
+}
+void playerdemo_open_read(entity this, string f)
+{
+ playerdemo_shutdown(this);
+ this.playerdemo_mode = PLAYERDEMO_MODE_READING;
+ this.playerdemo_fh = fopen(f, FILE_READ);
+ this.playerdemo_starttime = time - 1;
+ this.playerdemo_time = stof(fgets(this.playerdemo_fh));
+ this.playerdemo_time += this.playerdemo_starttime;
+ set_movetype(this, MOVETYPE_NONE);
+ LOG_INFO("playerdemo: ", this.netname, " reading from ", f);
+}
+void playerdemo_open_write(entity this, string f)
+{
+ playerdemo_shutdown(this);
+ this.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
+ this.playerdemo_fh = fopen(f, FILE_WRITE);
+ this.playerdemo_starttime = time - 1;
+ LOG_INFO("playerdemo: ", this.netname, " writing to ", f);
+ LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!");
+}
+#define PLAYERDEMO_FIELD(ent,func,t,f) func##t(ent,f,#f);
+#define PLAYERDEMO_FIELDS(ent,func) \
+ PLAYERDEMO_FIELD(ent,func,originvector,origin) \
+ PLAYERDEMO_FIELD(ent,func,vector,angles) \
+ PLAYERDEMO_FIELD(ent,func,sizevector,mins) \
+ PLAYERDEMO_FIELD(ent,func,sizevector,maxs) \
+ PLAYERDEMO_FIELD(ent,func,vector,v_angle) \
+ PLAYERDEMO_FIELD(ent,func,modelstring,model) \
+ PLAYERDEMO_FIELD(ent,func,string,playermodel) \
+ PLAYERDEMO_FIELD(ent,func,float,skin) \
+ PLAYERDEMO_FIELD(ent,func,string,playerskin) \
+ PLAYERDEMO_FIELD(ent,func,float,frame) \
+ PLAYERDEMO_FIELD(ent,func,float,effects) \
+ /* PLAYERDEMO_FIELD(ent,func,float,switchweapon) */ \
+ PLAYERDEMO_FIELD(CS(ent),func,float,button0) /* TODO: PHYS_INPUT_BUTTON_ATCK */ \
+ PLAYERDEMO_FIELD(CS(ent),func,float,button3) /* TODO: PHYS_INPUT_BUTTON_ATCK2 */ \
+ PLAYERDEMO_FIELD(CS(ent),func,float,button5) /* TODO: PHYS_INPUT_BUTTON_CROUCH */ \
+ PLAYERDEMO_FIELD(CS(ent),func,float,button6) /* TODO: PHYS_INPUT_BUTTON_HOOK */ \
+ PLAYERDEMO_FIELD(CS(ent),func,float,buttonuse) /* TODO: PHYS_INPUT_BUTTON_USE */ \
+ PLAYERDEMO_FIELD(ent,func,float,flags) \