Just restating what I said in IRC: Putting in
Code: Select all
if (Player.SpawnStatus == CSmPlayer::ESpawnStatus::Spawned) continue;
would indeed stop it from crashing, but it'd also stop players from changing weapons while they're alive, which ... kind of misses the point.
EDIT: So, apparently this is intentional behavior. Ugh. Please, just ... please rethink this.
The only thing these restrictions are doing is harming the game's longevity, really. You advertise a scripting language, but most who attempt to use it will be put off of it after hours of work gets wasted by a built in restriction that makes no sense and completely ruins all of their work.
I can't change max ammo of a player who's alive either. In this case you can actually get around that by setting the player's AmmoGain to 0 when at a certain point but ... why should you even need to do that when there's a perfectly fine function in the game that sets the HUD correctly and everything?
I can do almost nothing with the player's stamina bar. I can neither turn it off completely or give the player more stamina, as both StaminaMax and StaminaGain are restricted to the range of 0.1-1.0.
And yet, I can fully alter a player's armor and armor maximum at any time.
The restrictions are arbitrary and make no sense.
The scripting language is perfectly fine for doing simple things like making everyone have laser/rail gun (by the way, I dislike Instagib servers)... but the more I try to make anything complex with it, the more I risk running into an arbitrary restriction I didn't know about that makes all of my work pointless.
This is not at all how it should be, and it will likely turn a lot of people away from using ManiaScript. Which ... isn't what you want, is it?