Can you set it as a variable, like this.That simpel:
Code:getRandomPlayer() { return getplayers()[randomintrange(0,getplayers().size)]; // getplayers or level.players. }
plr = return getplayers()[randomintrange(0,getplayers().size)];
Is this a question?Can you set it as a variable, like this.
Code:plr = return getplayers()[randomintrange(0,getplayers().size)];
plr = getplayers()[randomintrange(0,getplayers().size)];
Here's my code.Is this a question?
And yeah sure, but it need to look than like this:
Code:plr = getplayers()[randomintrange(0,getplayers().size)];
gmi()
{
setDvar("party_autoteams", 0);
setDvar("ui_allow_teamchange", "0");
chosen = getplayers()[randomintrange(0,getplayers().size)];
chosen iPrintln("^1You're on!");
chosen freezeControls(true);
}
chosen self.chosen = true;
This looks correct.Here's my code.
Code:gmi() { setDvar("party_autoteams", 0); setDvar("ui_allow_teamchange", "0"); chosen = getplayers()[randomintrange(0,getplayers().size)]; chosen iPrintln("^1You're on!"); chosen freezeControls(true); }
you can do it like this:How do I do something like this?
Code:chosen self.chosen = true;
level.chosen_player = chosen;
level.chosen_player_name = chosen.name;