ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:pickrandomplayer

PickRandomPlayer

int PickRandomPlayer()

Description

Returns the number of a random player that is in game.

This function was made because many mods implement random player choice incorrectly, resulting in the same player getting chosen over and over again.

Examples

printbold(s:"Choosing a Level Master");
Delay(35);
int player = PickRandomPlayer();
printbold(s:PlayerName(player), s:" is the level master");
functions/pickrandomplayer.txt · Last modified: 2017/06/13 16:38 by korshun