Raised This Month: $51 Target: $400
 12% 

Timed Rank Display


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-10-2019 , 10:12   Timed Rank Display
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() 
{
    
register_plugin"Timed Rank""1.0""Noone_lol" )
}
public 
server_changelevel()
{
    for( new 
1<= get_maxplayers(); i++ )
    {
        if( !
is_user_connected) )
            continue
        
        
client_cmdi"say /rank" )
    }

How could I time this to run every 10 minutes with set task?

Fyi I'm running gameME stats and not stats from amxmodx.

https://github.com/gamemedev/plugin-...me_cstrike.sma

Last edited by iclassdon; 12-10-2019 at 10:15.
iclassdon is offline
Send a message via MSN to iclassdon
ZaX
Senior Member
Join Date: Jan 2015
Old 12-10-2019 , 13:25   Re: Timed Rank Display
Reply With Quote #2

You want to display rank every 10minutes?
If so, use set_task, put the time 600.0, with "b" flags in plugin_init
ZaX is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-10-2019 , 13:44   Re: Timed Rank Display
Reply With Quote #3

Also, instead of the entire code you put in the function, you can simply run "client_cmd" with index 0 - this will execute the command for all connected players and you don't need any checks nor loops.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-10-2019 , 13:48   Re: Timed Rank Display
Reply With Quote #4

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init() 
{
    
register_plugin"Timed Rank""1.0""Noone_lol" )
    
set_task 600.0"setit"0,_,_,"b"
}

public 
setit()
{
    for( new 
1<= get_maxplayers(); i++ )
    {
        if( !
is_user_connected) )
            continue
        
        
client_cmdi"say /rank" )
    }

Thanks! Why am I getting loose indentation warning?
iclassdon is offline
Send a message via MSN to iclassdon
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-10-2019 , 13:59   Re: Timed Rank Display
Reply With Quote #5

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

public plugin_init() 
{
    
register_plugin"Timed Rank""1.0""Noone_lol" )
    
set_task 600.0"setit"0,_,_,"b"
}

public 
setit()
{
    for( new 
1<= get_maxplayers(); i++ )
    {
        if( !
is_user_connected) )
            continue
        
        
client_cmdi"say /rank" )
    }

Thanks! Why am I getting loose indentation warning?
I don't get any warnings. using visual studio for editing and 1.9 build 5263 compiler.
DjSoftero is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 12-10-2019 , 14:01   Re: Timed Rank Display
Reply With Quote #6

That warning doesnt matter, what matter is: did steam blocked also say command sent from plugins, i didnt test it yet
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-10-2019 , 14:04   Re: Timed Rank Display
Reply With Quote #7

Just do this:

PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_plugin"Timed Rank""1.0""Noone_lol" )
    
set_task 600.0"setit"0,_,_,"b"
}

public 
setit()
{
    
client_cmd0"say /rank" )

AFAIK "say" is not blocked (yet).

You're getting indentation error because your indentation (spaces/tabs in the beginning of lines) is not consistent.
__________________

Last edited by OciXCrom; 12-10-2019 at 14:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-10-2019 , 15:36   Re: Timed Rank Display
Reply With Quote #8

Thanks guys, I'll load this up OciXCrom and test it. I used notepad++ for editing.
iclassdon is offline
Send a message via MSN to iclassdon
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-10-2019 , 16:54   Re: Timed Rank Display
Reply With Quote #9

Quote:
Originally Posted by iclassdon View Post
Thanks guys, I'll load this up OciXCrom and test it. I used notepad++ for editing.
Make sure you use TAB instead of manually typing in spaces.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-10-2019 , 17:32   Re: Timed Rank Display
Reply With Quote #10

I can't recommend this one enough instead of notepad: https://forums.alliedmods.net/showthread.php?t=300661
__________________
retired chump

Last edited by DjSoftero; 12-10-2019 at 17:32.
DjSoftero is offline
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 15:54.


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