# Set Player Difficulty Level
Grammar — Set player player difficulty level to difficultyLevel
Flags —Native
|Action
Sets the difficulty level for the specified player.
# Arguments
int
— Playerint
[ difficulty ] — Difficulty Level
Returns — void
native void PlayerSetDifficulty(
int inPlayer,
int inDifficulty,
);
# Related
Category: Player / Difficulty Levels
- [F] —
void
— Set Player Difficulty Level — ( PlayerSetDifficulty ) - [F] —
int
[ difficulty ] — Difficulty Level For Player — ( PlayerDifficulty ) - [F] —
bool
— Difficulty Level Is Enabled — ( DifficultyEnabled ) - [F] —
text
— Name Of Difficulty Level — ( DifficultyName ) - [F] —
text
— Name Of Campaign Difficulty Level — ( DifficultyNameCampaign ) - [F] —
int
— APM Of Difficulty Level — ( DifficultyAPM )
# Examples
# campaigns/void.sc2campaign
// L1345
PlayerSetDifficulty(autoF0CFB556_var, 4)
// L1345
PlayerSetDifficulty(autoF0CFB556_var, 4)
# campaigns/voidstory.sc2campaign
// L5469
PlayerSetDifficulty(1, libVCUI_gf_PU_MissionSelectedDifficulty())
// L5492
PlayerSetDifficulty(1, libVCUI_gf_PU_MissionSelectedDifficulty())
# campaigns/voidstory.sc2campaign
// L7868
PlayerSetDifficulty(1, libVCUI_gf_PU_MissionSelectedDifficulty())
# mods/missionpacks/novacampaign.sc2mod
// L5703
PlayerSetDifficulty(1, libNCUI_gf_NU_MissionSelectedDifficulty())
# mods/starcoop/starcoop.sc2mod
// L1090
PlayerSetDifficulty(lp_player, libCOMI_gf_GetMissionDifficulty())
// L12343
PlayerSetDifficulty(1, PlayerDifficulty(3))
// L12347
PlayerSetDifficulty(2, PlayerDifficulty(4))
# mods/starcoop/starcoop.sc2mod
// L4629
PlayerSetDifficulty(lv_indexPlayer, 2)
// L4698
PlayerSetDifficulty(lv_indexPlayer, 2)