Raised This Month: $ Target: $400
 0% 

Send cvars when reach get_realplayersnum help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-24-2010 , 06:37   Send cvars when reach get_realplayersnum help
Reply With Quote #1

This plugin send mp_forcechasecam 2 and mp_forcecamera 2 even if it is 0 players in the server.
PHP Code:
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
(playersplayerCnt"ch")
    
    return 
playerCnt


Last edited by Rirre; 06-24-2010 at 06:42.
Rirre is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode