Kategorie: Network
/ League
Ab Engineversion: 5.0 OC
SetLeaguePerformance
Beschreibung
Sets the league score. This function can be used for custom scenario scoring in competition or adventure leagues.
Syntax
bool SetLeaguePerformance(int score, int player_id);
Parameter
- score:
- New player or scenario score
- player_id:
- [opt] ID of player whose score shall be set. If not given, global performance for all players is set.
Anmerkung
Use GetPlayerID() to get the ID of a joined player.
Beispiel
#appendto Rock static g_rocks_collected; func Entrance(clonk) { var plr = clonk->GetController(); if (clonk->GetID() == Clonk && plr != NO_OWNER) { ++g_rocks_collected; Log("%s found a rock! Score: %d", GetTaggedPlayerName(plr), g_rocks_collected); SetLeaguePerformance(g_rocks_collected); return RemoveObject(); } return _inherited(clonk, ...); }
Rock script modification: Whenever a rock is collected by a Clonk, the score of all players is increased.
Siehe auch: GetLeagueScore, SetLeagueProgressData