PDA

View Full Version : Send cvars when reach get_realplayersnum help


Rirre
06-24-2010, 06:37
This plugin send mp_forcechasecam 2 and mp_forcecamera 2 even if it is 0 players in the server.
public client_putinserver(id)
UpdateCvars()

public client_disconnect(id)
UpdateCvars()

UpdateCvars()
{
if (get_realplayersnum() <= 3)
{
set_cvar_string("mp_forcecamera", "2")
set_cvar_string("mp_forcechasecam", "2")
}
else
{
set_cvar_string("mp_forcecamera", "0")
set_cvar_string("mp_forcechasecam", "0")
}
}

stock get_realplayersnum()
{
new players[32], playerCnt
get_players(players, playerCnt, "ch")

return playerCnt
}

Alucard^
06-24-2010, 08:02
So? what is the help that you need?

Oh and use pcvars (with pointers in this case).

YamiKaitou
06-24-2010, 08:47
Yes, that plugin is doing exactly what it should do. What help do you need? Don't expect us to read your mind.

Rirre
06-24-2010, 10:40
Doesn't work the way I need it.

As I want it:
When it reach 3 players, send cvars.
And when its lower than 3 players, send "else".

YamiKaitou
06-24-2010, 10:56
The way you have it is when get_realplayesnum() returns a value of less than or equal to 3, set cvars to "2". If it is greater than 3, set them to "0".

abdul-rehman
06-24-2010, 11:26
I think it should be like this:

set_cvar_string("mp_forcecamera", "2")
set_cvar_string("mp_forcechasecam", "2")
---->

set_cvar_num("mp_forcecamera", 2)
set_cvar_num("mp_forcechasecam", 2)