Jump to content

SetPlayerScore: Difference between revisions

no edit summary
(3.1 is released, so Devfeature templates have been removed)
No edit summary
Tag: Source edit
Line 3: Line 3:
int '''SetPlayerScore''' (int ''player'', int ''type'', int ''value'')
int '''SetPlayerScore''' (int ''player'', int ''type'', int ''value'')


==Usage==
== Usage ==
Changes the score of a player. The type of score to be changed can be many things, whether it's their frag count, how many monsters they killed, how many times they died, etc.
Changes the score of a player. The type of score to be changed can be many things, whether it's their frag count, how many monsters they killed, how many times they died, etc.


==Parameters==
=== Parameters ===
*player: The number of the player whose score we'd like to change.
* ''player'': The number of the player whose score to change.
*type: Can be one of the following:
* ''type'': One of:
**'''SCORE_FRAGS''' = 0, the player's frag count.
:*'''SCORE_FRAGS''' = 0
**'''SCORE_POINTS''' = 1, the player's point count.
::How many frags this player has.
**'''SCORE_WINS''' = 2, the player's win count.
:*'''SCORE_POINTS''' = 1
**'''SCORE_DEATHS''' = 3, how many times this player died.
::How many points this player has.
**'''SCORE_KILLS''' = 4, the number of monsters this player killed.
:*'''SCORE_WINS''' = 2
**'''SCORE_ITEMS''' = 5, the number of items this player picked up.
::How many wins this player has.
**'''SCORE_SECRETS''' = 6, the number of secrets this player found.
:*'''SCORE_DEATHS''' = 3
*value: The new value we'd like to set for the score.
::How many times this player died.
:*'''SCORE_KILLS''' = 4
::The number of monsters this player has killed.
:*'''SCORE_ITEMS''' = 5
::The number of items this player has picked up.
:*'''SCORE_SECRETS''' = 6
::The number of secrets this player has found.


==Return Value==
=== Return value ===
Returns 1 if the player's score was successfully changed, 0 on failure (e.g. the player doesn't exist or an invalid type was passed).
Returns 1 if the player's score was successfully changed, 0 on failure (e.g. the player doesn't exist or an invalid type was passed).


[[category:ACS Functions]]
== Examples ==
{{noexamples}}
 
== See also ==
* [[GetPlayerScore]]
 
[[Category:ACS functions]]