self.model = "";
self.modelindex = 0;
self.weapon = 0;
+ self.switchingweapon = 0;
self.weaponmodel = "";
self.weaponentity = world;
self.exteriorweaponentity = world;
else
self.frags = FRAGS_LMS_LOSER;
}
+ else if(g_ca)
+ {
+ if(self.caplayer)
+ self.frags = FRAGS_LMS_LOSER;
+ else
+ self.frags = FRAGS_SPECTATOR;
+ }
else
self.frags = FRAGS_SPECTATOR;
}
self.switchweapon = w_getbestweapon(self);
self.cnt = self.switchweapon;
self.weapon = 0;
+ self.switchingweapon = 0;
if(!self.alivetime)
self.alivetime = time;
self.pressedkeys = spectatee.pressedkeys;
self.weapons = spectatee.weapons;
self.switchweapon = spectatee.switchweapon;
+ self.switchingweapon = spectatee.switchingweapon;
self.weapon = spectatee.weapon;
self.nex_charge = spectatee.nex_charge;
self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo;
if (other)
self.enemy = other;
-
+
if(self.enemy.classname == "player") {
- if(self.enemy.vehicle)
- {
- msg_entity = self;
- WriteByte(MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity(MSG_ONE, self.enemy);
- //stuffcmd(self, "set viewsize $tmpviewsize \n");
- self.movetype = MOVETYPE_NONE;
- accuracy_resend(self);
- }
- else
- {
- msg_entity = self;
- WriteByte(MSG_ONE, SVC_SETVIEW);
- WriteEntity(MSG_ONE, self.enemy);
- //stuffcmd(self, "set viewsize $tmpviewsize \n");
- self.movetype = MOVETYPE_NONE;
- accuracy_resend(self);
- if(!SpectateUpdate())
- PutObserverInServer();
- }
- return 1;
+ if(self.enemy.vehicle)
+ {
+ msg_entity = self;
+ WriteByte(MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, self.enemy);
+ //stuffcmd(self, "set viewsize $tmpviewsize \n");
+ self.movetype = MOVETYPE_NONE;
+ accuracy_resend(self);
+ }
+ else
+ {
+ msg_entity = self;
+ WriteByte(MSG_ONE, SVC_SETVIEW);
+ WriteEntity(MSG_ONE, self.enemy);
+ //stuffcmd(self, "set viewsize $tmpviewsize \n");
+ self.movetype = MOVETYPE_NONE;
+ accuracy_resend(self);
+
+ if(!SpectateUpdate())
+ PutObserverInServer();
+ }
+ return 1;
} else {
return 0;
}
}
}
+.float motd_actived_time; // used for both motd and campaign_message
+void PrintWelcomeMessage()
+{
+ if (self.motd_actived_time == 0) { // is there already a message showing?
+ if (autocvar_g_campaign) {
+ if ((self.classname == "player" && self.BUTTON_INFO) || (self.classname != "player")) {
+ self.motd_actived_time = time;
+ Send_CSQC_Centerprint_Generic(self, CPID_MOTD, campaign_message, -1, 0);
+ }
+ } else {
+ if ((time - self.jointime > autocvar_welcome_message_time) && self.BUTTON_INFO) {
+ self.motd_actived_time = time;
+ Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), -1, 0);
+ }
+ }
+ } else { // showing MOTD or campaign message
+ if (autocvar_g_campaign) {
+ if (self.BUTTON_INFO)
+ self.motd_actived_time = time;
+ else if ((time - self.motd_actived_time > 2) && self.classname == "player") { // hide it some seconds after BUTTON_INFO has been released
+ self.motd_actived_time = 0;
+ Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
+ }
+ } else {
+ if ((time - self.jointime) > autocvar_welcome_message_time) {
+ if (self.BUTTON_INFO)
+ self.motd_actived_time = time;
+ else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
+ self.motd_actived_time = 0;
+ Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
+ }
+ }
+ }
+ }
+}
+
void ObserverThink()
{
float prefered_movetype;
}
}
}
+
+ PrintWelcomeMessage();
}
void SpectatorThink()
PutObserverInServer();
}
+ PrintWelcomeMessage();
self.flags |= FL_CLIENT | FL_NOTARGET;
}
void() ctf_setstatus;
void() nexball_setstatus;
.float items_added;
-.float motd_actived_time; // used for both motd and campaign_message
void PlayerPreThink (void)
{
WarpZone_PlayerPhysics_FixVAngle();
if(self.cvar_g_xonoticversion)
if(time > self.version_nagtime)
{
- if(strstr(self.cvar_g_xonoticversion, "git", 0) < 0)
+ // don't notify git users
+ if(strstr(self.cvar_g_xonoticversion, "git", 0) < 0 && strstr(self.cvar_g_xonoticversion, "autobuild", 0) < 0)
{
- if(strstr(autocvar_g_xonoticversion, "git", 0) >= 0)
+ if(strstr(autocvar_g_xonoticversion, "git", 0) >= 0 || strstr(autocvar_g_xonoticversion, "autobuild", 0) >= 0)
{
+ // notify release users if connecting to git
dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
}
r = vercmp(self.cvar_g_xonoticversion, autocvar_g_xonoticversion);
if(r < 0)
{
- dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n");
- sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.com/^1!\n"));
+ // give users new version
+ dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n");
+ sprint(self, strcat("\{1}^1NOTE: ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n"));
}
else if(r > 0)
{
- dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+ // notify users about old server version
+ print("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
sprint(self, strcat("\{1}^1NOTE: ^7the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n"));
}
}
PlayerUseKey();
self.usekeypressed = self.BUTTON_USE;
- if (self.motd_actived_time == 0) {
- if (autocvar_g_campaign) {
- if (self.classname == "player" && self.BUTTON_INFO) {
- self.motd_actived_time = time;
- Send_CSQC_Centerprint_Generic(self, CPID_MOTD, campaign_message, -1, 0);
- }
- } else {
- if ((self.classname == "player" || time - self.jointime > autocvar_welcome_message_time) && self.BUTTON_INFO) {
- self.motd_actived_time = time;
- Send_CSQC_Centerprint_Generic(self, CPID_MOTD, getwelcomemessage(), -1, 0);
- }
- }
- } else { // showing MOTD or campaign message
- if (autocvar_g_campaign) {
- if (self.classname == "player") {
- if (self.BUTTON_INFO)
- self.motd_actived_time = time;
- else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
- self.motd_actived_time = 0;
- Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
- }
- }
- } else {
- if (self.classname == "player" || (time - self.jointime) > autocvar_welcome_message_time) {
- if (self.BUTTON_INFO)
- self.motd_actived_time = time;
- else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
- self.motd_actived_time = 0;
- Send_CSQC_Centerprint_Generic_Expire(self, CPID_MOTD);
- }
- }
- }
- }
-
+ PrintWelcomeMessage();
+
if(self.classname == "player") {
// if(self.netname == "Wazat")
// bprint(self.classname, "\n");