In my enter script, I give each player a unique TID:
Code: Select all
int player = PlayerNumber();
Thing_ChangeTID(0, PLAYERTID + player);
Code: Select all
points[player] += score; // player = PlayerNumber()
GiveActorInventory(PLAYERTID + player, "ScoreItem", score);
This problem can be solved with the points array, but I also need to tackle something else. Each time a LMS round is over and the pointlimit is not hit, the COUNTDOWN phase kick in and after that the whole map and every script is unloaded and then OPEN and ENTER scripts are run. Since the point of the revamped point system is to work between rounds, I need to somehow save the player's score so it won't be zeroed.
As I intend to evaluate pointlimit hit in the COUNTDOWN phase (loop through player scores, check wheter the reached the cvar pointlimit and then Exit_Normal(0), in the OPEN script it should work even with the sv_noexit), I can safely zero the points right before I end the map manually.
I guess your general response would be "use cvar", but does cvar support arrays? I have no interest in copypasting switch statement for eight players not to mention this would be pretty stupid if the max number of the players should rise.
Thanks for help