seta cl_nade_timer 1 "show a visual timer for nades, 1 = only circle, 2 = circle with text"
seta cl_nade_type 3
seta cl_pokenade_type "zombie"
+seta cl_tandemnade_type 0
// ------------
// Nade bonus
registercvar("cl_nade_type", "3");
registercvar("cl_pokenade_type", "zombie");
+ registercvar("cl_tandemnade_type", "0");
registercvar("cl_jumpspeedcap_min", "");
registercvar("cl_jumpspeedcap_max", "");
if(!autocvar_g_vehicles)
return;
- if (vehspawncount < autocvar_g_nades_emerald_vehiclespawnlimit)
- {
- e = spawnvehicle(
- e,
- "random", //this.tandemnade_type,
- VEH_Null,
- this.realowner,
- this.realowner,
- this.origin,
- false,
- false,
- true
- );
-
- if(!e)
- return; // vehicle failed to be spawned
-
- vehspawncount++;
- return;
- }
+ // looks like a bad practice
+ time = 0.7;
+
+ e = spawnvehicle(
+ e,
+ "random",
+ VEH_Null,
+ this.realowner,
+ this.realowner,
+ this.origin,
+ true,
+ false,
+ true
+ );
+
+ if(!e)
+ return; // vehicle failed to be spawned
- PrintToChatAll("^1Someone tried to spawn more vehicles than the maximum allowed! Sorry, cannot be spawned, spawn limit has been reached!");
return;
}
case 2:
if(!autocvar_g_turrets)
return;
- if (turspawncount < autocvar_g_nades_emerald_turretspawnlimit)
- {
- e = spawnturret(
- e,
- "random", //this.tandemnade_type,
- TUR_Null,
- this.realowner,
- this.realowner,
- this.origin,
- false,
- false,
- false,
- 1,
- true
- );
-
- if(!e)
- return; // turret failed to be spawned
-
- turspawncount++;
- return;
- }
+ e = spawnturret(
+ e,
+ "random", //this.tandemnade_type,
+ TUR_Null,
+ this.realowner,
+ this.realowner,
+ this.origin,
+ false,
+ false,
+ false,
+ 1,
+ true
+ );
+
+ if(!e)
+ return; // turret failed to be spawned
- PrintToChatAll("^1Someone tried to spawn more vehicles than the maximum allowed! Sorry, cannot be spawned, spawn limit has been reached!");
return;
}
default:
setsize(fountain, '-16 -16 -16', '16 16 16');
CSQCProjectile(fountain, true, PROJECTILE_NADE_EMERALD_BURN, true);
nade_emerald_dropping(fountain.origin);
+ return;
}
}
}
void nade_dark_fountain_think(entity this)
{
- if(round_handler_IsActive())
- if(!round_handler_IsRoundStarted())
+ if(round_handler_IsActive() && !round_handler_IsRoundStarted())
{
delete(this);
return;
float autocvar_g_nades_emerald_fountain_lifetime = 1; //if much time, fountain will remain
bool autocvar_g_nades_emerald_powerupjetpack_randomdrop = 0;
int autocvar_g_nades_emerald_dropitemselect = 0; //admin/user selects which item wants to drop in-game, if not will be random
-int autocvar_g_nades_emerald_vehiclespawnlimit = 6; //LegendGuard adds new nade cvar of vehicle spawn count limit for the server 26-06-2021
-int autocvar_g_nades_emerald_turretspawnlimit = 4; // 26-06-2021
float autocvar_g_nades_ammo_time = 5; //LegendGuard adds new nade cvars 13-02-2021
float autocvar_g_nades_ammo_rate = 30;
float autocvar_g_nades_ammo_friend = 1;
.float nade_refire;
.float nade_special_time;
.string pokenade_type;
-.float tandemnade_type; //LegendGuard adds new cvar nade .variable 01-07-2021
+.int tandemnade_type; //LegendGuard adds new cvar nade .variable 01-07-2021
.entity nade_damage_target;
.float cvar_cl_nade_type;
.string cvar_cl_pokenade_type;
.float nade_show_particles;
.float nade_veil_prevalpha;
.float nade_dark_prevalpha; //LegendGuard adds new nade .variable 08-02-2021
-int vehspawncount; //LegendGuard adds new .variable 22-06-2021
-int turspawncount; // 26-06-2021
bool orb_send(entity this, entity to, int sf);
this.alpha = 1;
this.avelocity = '0 0 0';
this.velocity = '0 0 0';
- if (this.optionalsetup)
+ if (this.optional_setup)
this.effects = EF_DIMLIGHT;
else
this.effects = eff;
if(IS_DEAD(veh))
{
+ if (veh.cannot_respawn)
+ {
+ delete(veh);
+ return;
+ }
ret.cnt = time + veh.respawntime;
ret.nextthink = min(time + veh.respawntime, time + veh.respawntime - 5);
}
if(MUTATOR_CALLHOOK(VehicleInit, this))
return false;
+ if(this.no_respawn_option)
+ this.cannot_respawn = true;
+
return true;
}
-entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, bool optional)
+entity spawnvehicle (entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional)
{
e.spawnflags = VHF_MULTISLOT;
- e.optionalsetup = optional;
-
- // TODO: Make a respawn option, the following line isn't functional
- if(!respwn) { e.spawnflags |= VHF_ISVEHICLE; }
+
+ // if this spawnflag isn't, it won't be spawned
+ e.spawnflags |= VHF_ISVEHICLE;
+
+ e.optional_setup = optional;
+ e.no_respawn_option = no_respwn;
+ e.cannot_respawn = false;
+
setorigin(e, orig);
bool allow_any = boolean(vehicle == "anyrandom");
return NULL; // no good
}
// select a random valid vehicle type if no valid vehicle was provided
- return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, respwn, removeifinvalid, optional);
+ return spawnvehicle(e, "random", VEH_Null, spawnedby, own, orig, no_respwn, removeifinvalid, optional);
}
}
if(!(e.spawnflags & VHF_ISVEHICLE)) { delete(e); return NULL; } // remove even if told not to, as we didn't spawn any kind of vehicle
- // e.angles = '0 0 0';
e.velocity = randomvec() * 150 + '0 0 325';
e.spawnfunc_checked = true;
- time = 0.7;
-
+
+ // spawn!
vehicle_initialize(e, veh, true);
return e;
.float lock_strength;
.float lock_time;
.float lock_soundtime;
-.bool optionalsetup;
+.bool optional_setup;
+.bool no_respawn_option;
+.bool cannot_respawn;
// vehicle functions
.void(int _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
.float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
-entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool respwn, bool removeifinvalid, bool optional);
+entity spawnvehicle(entity e, string vehicle, Vehicle veh, entity spawnedby, entity own, vector orig, bool no_respwn, bool removeifinvalid, bool optional);
void vehicles_exit(entity vehic, int eject);
bool vehicle_initialize(entity this, Vehicle info, float nodrop);
bool vehicle_impulse(entity this, int imp);
ATTRIB(Client, cvar_cl_buffs_autoreplace, bool, this.cvar_cl_buffs_autoreplace);
ATTRIB(Client, cvar_cl_nade_type, int, this.cvar_cl_nade_type);
ATTRIB(Client, cvar_cl_pokenade_type, string, this.cvar_cl_pokenade_type);
+ ATTRIB(Client, cvar_cl_tandemnade_type, int, this.cvar_cl_tandemnade_type);
ATTRIB(Client, cvar_cl_spawn_near_teammate, bool, this.cvar_cl_spawn_near_teammate);
ATTRIB(Client, cvar_cl_gunalign, int, this.cvar_cl_gunalign);
ATTRIB(Client, cvar_cl_handicap, float, this.cvar_cl_handicap);