Hi, I'd posted before, but it wasn't published - donno why.
I wanna eddit the TeamSurvival.script due increasing Hitpoints. I'm quite a noob as for scripting but I really try it hard because I wanna have the best possible gamingexperience on my maps.
Please, can anyone help me with this problem - I'm really despreate!
Is it possible to change the amount of HP, like in Joust? Could anyone say how it can be done?
Thx a lot!
How to increase Hitpoints by script?
Moderator: English Moderator
Re: How to increase Hitpoints by script?
You can increase the number of armors when you spawn a player. In the TeamSurvival script you can search for the SM::SpawnPlayer() function.
This function takes up to five parameters:
- _Player, the player to spawn
- _ClanNum, in which clan to spawn the player. Can be 0 (if it's a free for all mode) 1 or 2 (if it's a team mode)
- _Armor, the number of armor points given to the player. 100 = 1 armor, 200 = 2 armors, 300 = 3 armors, etc ...
- _BlockSpawn, the spawn where the player will start
- _ActivationDate, when the player will be spawned
In TeamSurvival there's three calls to SpawnPlayer()
So you just have to add the number of armor points between Player.RequestedClan and ClanSpawnAnchors[Player.RequestedClan].
Another thing to change is the maximum number of armor of the player. By defaul it's 200. To change that you have to alter Player.ArmorMax. Let's say you want that the players have a maximum of 10 armor points but spawn with only 6. You can do that
Code: Select all
Void SpawnPlayer(CSmPlayer _Player, Integer _ClanNum, Integer _Armor, CSmBlockSpawn _BlockSpawn, Integer _ActivationDate)
- _Player, the player to spawn
- _ClanNum, in which clan to spawn the player. Can be 0 (if it's a free for all mode) 1 or 2 (if it's a team mode)
- _Armor, the number of armor points given to the player. 100 = 1 armor, 200 = 2 armors, 300 = 3 armors, etc ...
- _BlockSpawn, the spawn where the player will start
- _ActivationDate, when the player will be spawned
In TeamSurvival there's three calls to SpawnPlayer()
Code: Select all
SM::SpawnPlayer(Player, Player.RequestedClan, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
Code: Select all
SM::SpawnPlayer(Player, Player.RequestedClan, 700, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
Code: Select all
Player.ArmorMax = 1000;
SM::SpawnPlayer(Player, Player.RequestedClan, 600, ClanSpawnAnchors[Player.RequestedClan], Now + RespawnTime);
Re: How to increase Hitpoints by script?
I thank you so much!! It wokrs very well! If i just knew it earlier... Only a damn value made me happy at the end 

Who is online
Users browsing this forum: No registered users and 1 guest