View Single Post
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 10-22-2011 , 11:47   Re: Player-Based CVARs
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
Main idea is to use client_putinserver instead of client_connect, i think client_connect can be triggered 2 times if players connects and is redirected to downloadurl and then client_disconnect wouldn't be triggered.
May be it is not the situation, but i've read that client_connect could be triggered few times without client_disconnect between different calls.

And the other idea is to not trust a global var but to check each time players value, global var wouldn't be a significant improvement anyway.
It might be true that using client_connect could send false results if it is called more than once. However, I think I remember seeing that when I tried it at client_putinserver at first, and had the server execute mp_startmoney 1000, it would still set my startmoney to the previous start amount, because your starting money is loaded on client_putinserver, so you aren't affected by the server command. Only the next person to join the server is affected by it. And I'm sure that server owners wouldn't want to have the plugin run sv_restart on the server in order to restart everybody's start money every time somebody joins.

With that being said, would you suggest client_connect with get_playersnum() passed with 1 as a parameter so that it counts connecting players as well? I think that may work better.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345