Raised This Month: $95 Target: $400
 23% 

Timed Rank Display


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-10-2019 , 11: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 11:15.
iclassdon is offline
Send a message via MSN to iclassdon
ZaX
Member
Join Date: Jan 2015
Old 12-10-2019 , 14: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 , 14: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 , 14: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 , 14: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 , 15: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...)

Quote:
Originally Posted by xRENN1Ex View Post
I'm sorry, I can't try but I didn't
JocAnis is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-10-2019 , 15: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 15:04.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
iclassdon
AlliedModders Donor
Join Date: May 2006
Old 12-10-2019 , 16: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 , 17: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 , 18: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
__________________
I accept private work.

Last edited by DjSoftero; 12-10-2019 at 18:32.
DjSoftero is offline
Reply


Thread Tools
Display Modes

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 05:20.


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