Hi all i want to know how to pick up a random player to get boost.
This is what i trayied:
new maxplayers = get_maxplayers()
new rand = random_num(1,maxplayers)
client_cmd(rand, "say boost")
It happens on new round.
Code:
public Boost(id)
{
new pinigai = cs_get_user_money(id)
if (prasidejo == true)
{
if (aktiv == false)
{
if(pinigai >= get_pcvar_num(kaina))
{
client_print_color(id, GREY, "^4[Boost]^3 You just bought boost!")
set_user_health(id, ( get_user_health(id)+15 ) );
set_user_gravity(id,Float:0.9)
set_user_maxspeed(id, -1)
new pinigu_praradimas = pinigai - get_pcvar_num(kaina)
cs_set_user_money(id, pinigu_praradimas)
aktiv = true
client_cmd(id, "spk ^"sound/boost.wav^"")
}
else
{
client_print_color(id, GREY, "^4[Boost]^3 You dont have that much money!")
}
}
else
{
client_print_color(id, GREY, "^4[Boost]^3 You already have boost!")
}
}
else
{
client_print_color(id, GREY, "^4[Boost]^3 Round hasn't started yet.")
}
}
And this is the main function, it happens when some one says boost
I don't really know why people uses this array, player[33]
I know that this some how affects the players to know their id :/
And BTW i want to make that player enter one team and the others transfer to other team.