How can I make there is only one sniper per team?
example: axis only a kar98ksniper and if a player select the sniper (in addition to the one who already has it) be assigned another weapon (kar98k)
Thanksss
How can I make there is only one sniper per team?
example: axis only a kar98ksniper and if a player select the sniper (in addition to the one who already has it) be assigned another weapon (kar98k)
Thanksss
kung foo man (18th May 2021)
a lot of nuances, mode and so on, how people choose weapons, once or each (as an example).
default _weapons.gsc:
PHP Code:
restrictWeaponByServerCvars(response)
{
SNIPER_LIMIT = 1;
if (!isDefined(level.snipers_list))
level.snipers_list = [];
if (!isDefined(level.snipers_list[self.pers["team"]]))
level.snipers_list[self.pers["team"]] = 0;
if (!isDefined(self.isSniper))
self.isSniper = false;
/* other code */
case "kar98k_sniper_mp":
if(!getcvarint("scr_allow_kar98ksniper") || (level.snipers_list[self.pers["team"]] > SNIPER_LIMIT && !self.isSniper))
response = "restricted";
else
{
level.snipers_list[self.pers["team"]]++;
self.isSniper = true;
}
break;
/* other code */
if (response != "restricted" && response != "kar98k_sniper_mp" && self.isSniper)
{
level.snipers_list[self.pers["team"]]--;
self.isSniper = false;
}
/* other code */
}
codecallback_playerDisconnect()
{
/* other code */
if (self.isSniper)
level.snipers_list[self.pers["team"]]--;
/* other code */
}
PHP Code:
class CoronaVirus
{
CoronaVirus(int m = 1): multi(m) { Peoples.RandomDeaths(m); }
~CoronaVirus() { CoronaVirus * again = new CoronaVirus((this->multi * 2)); }
int multi = 1;
} y_2020;
kung foo man (18th May 2021)
Dont forget to clean up the list upon sniper joining spec and/or on sniper joining other team/autobalance.
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
kung foo man (18th May 2021)