I dont see any error there, but can you try to comment lines out and see, if it still triggers the error?
I dont see any error there, but can you try to comment lines out and see, if it still triggers the error?
timescale 0.01
Only 8 years late to the thread... I'm working on a similar mod but for S&D gametype. The problem is that player.money is set to 0 each round because PlayerConnect is being called after each spawn. No clue on that...
I've solved it by saving the money into server cvars, but doesn't seem like an elegant solution.
Anyone has a better idea?
igstyga (17th June 2020),kung foo man (17th June 2020)
You can try storing money in global variables, I don’t know how good this idea is
PHP Code:
getID()
{
return self getEntityNumber();
}
onPlayerConnect()
{
id = self getID();
level.money[id] = 0;
}
onPlayerDisconnect()
{
id = self getID();
level.money[id] = undefined;
}
Killed(/*...*/)
{
if (mod == "headshot")
money = 100;
else if (mod == "melee")
money = 200;
else
money = 50;
id = self getID();
level.money[id] += money;
}
Last edited by maxdamage99; 18th June 2020 at 06:50.
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 June 2020)
Bad idea. The level var is also cleaned (except for level.game array) on round restart. Furthermore, since players go through the "playerconnecting" callback when the round restarts, their money gets reset using this technique.
Just store in player.pers["money"] or something similar. Look at the stock sd gametype for .pers["kills"] for example.
"Does not work" is an error report for a bug between keyboard and chair.
All hail Artie Effem
kung foo man (18th June 2020)