Raised This Month: $ Target: $400
 0% 

Every 2 rounds "clear" in console of anyone


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 08-22-2010 , 05:31   Every 2 rounds "clear" in console of anyone
Reply With Quote #1

Hello all. Help noob please! I am just learning in writing plugins. I think my players need to be console cleared.

So i want so plugin:
cliend_cmd "clear" in console of ALL players every 2 rounds.

Thanks for listen!
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 08-22-2010 , 07:34   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #2

I wouldn't want my console cleared every 2 rounds.
__________________
hleV is offline
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 08-22-2010 , 07:37   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #3

Quote:
Originally Posted by hleV View Post
I wouldn't want my console cleared every 2 rounds.
If it will not be in 30% players overflow
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
tm.
Member
Join Date: Apr 2010
Old 08-22-2010 , 09:25   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #4

I doubt it that the size of the print in players console has anything to do with overflows, but here you go:
PHP Code:
#include <amxmodx>

new g_RoundCounter;

public 
plugin_init()
{
    
register_plugin("New""1.0""TM.");
    
register_event("HLTV""NewRound""a""1=0""2=0");
}

public 
NewRound()
{
    
g_RoundCounter++;

    if(
g_RoundCounter 2)
    {
        return 
PLUGIN_HANDLED;
    }

    
client_cmd(0"clear");

    return 
PLUGIN_CONTINUE;

tm. is offline
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 08-22-2010 , 09:44   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #5

Thanks! Will test and reply!
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 08-22-2010 , 15:32   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #6

Quote:
Originally Posted by tm. View Post
I doubt it that the size of the print in players console has anything to do with overflows, but here you go:
PHP Code:
#include <amxmodx>

new g_RoundCounter;

public 
plugin_init()
{
    
register_plugin("New""1.0""TM.");
    
register_event("HLTV""NewRound""a""1=0""2=0");
}

public 
NewRound()
{
    
g_RoundCounter++;

    if(
g_RoundCounter 2)
    {
        return 
PLUGIN_HANDLED;
    }

    
client_cmd(0"clear");

    return 
PLUGIN_CONTINUE;

It works fine!

But can you change it for do this every 5 minutes?
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-22-2010 , 20:29   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #7

PHP Code:
#include <amxmodx>

new g_RoundCounter;

public 
plugin_init()
{
    
register_plugin("New""1.0""TM.");
    
set_task(300.0"FiveMinutes"___"b"
}

public 
FiveMinutes()
{

    
client_cmd(0"clear");

    return 
PLUGIN_CONTINUE;

if you want to change the time, change "300" in set_task to whatever amount of seconds.
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Mofforg
Senior Member
Join Date: Aug 2010
Location: Moscow, Russia
Old 08-22-2010 , 20:30   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #8

Quote:
Originally Posted by nikhilgupta345 View Post
PHP Code:
#include <amxmodx>

new g_RoundCounter;

public 
plugin_init()
{
    
register_plugin("New""1.0""TM.");
    
set_task(300.0"FiveMinutes"___"b"
}

public 
FiveMinutes()
{

    
client_cmd(0"clear");

    return 
PLUGIN_CONTINUE;

if you want to change the time, change "300" in set_task to whatever amount of seconds.
Thanks!

Close the topic!
Mofforg is offline
Send a message via ICQ to Mofforg Send a message via Skype™ to Mofforg
platzpatrone
Veteran Member
Join Date: Apr 2007
Location: Germany
Old 08-22-2010 , 21:12   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #9

īsnt 0 meant the server ? so u have to do id ?

client_cmd(0, "clear");

->

client_cmd
(id, "clear");


and go through all players then ?
platzpatrone is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-22-2010 , 21:29   Re: Every 2 rounds "clear" in console of anyone
Reply With Quote #10

0 is sending the command to everyone in the server. To send a server command you must do

server_cmd("command here")
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 23:30.


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