Raised This Month: $ Target: $400
 0% 

Send cvars when reach get_realplayersnum help


Post New Thread Reply   
 
Thread Tools Display Modes
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
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-24-2010 , 08:02   Re: Send cvars when reach get_realplayersnum help
Reply With Quote #2

So? what is the help that you need?

Oh and use pcvars (with pointers in this case).
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-24-2010 , 08:47   Re: Send cvars when reach get_realplayersnum help
Reply With Quote #3

Yes, that plugin is doing exactly what it should do. What help do you need? Don't expect us to read your mind.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-24-2010 , 10:40   Re: Send cvars when reach get_realplayersnum help
Reply With Quote #4

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".
Rirre is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-24-2010 , 10:56   Re: Send cvars when reach get_realplayersnum help
Reply With Quote #5

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".
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 06-24-2010 , 11:26   Re: Send cvars when reach get_realplayersnum help
Reply With Quote #6

I think it should be like this:
PHP Code:
set_cvar_string("mp_forcecamera""2")
set_cvar_string("mp_forcechasecam""2"
---->
PHP Code:
set_cvar_num("mp_forcecamera"2)
set_cvar_num("mp_forcechasecam"2
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
Reply



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