Raised This Month: $32 Target: $400
 8% 

Solved [HELP] Admin Stats


Post New Thread Reply   
 
Thread Tools Display Modes
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-27-2020 , 08:15   Re: [HELP] Admin Stats
Reply With Quote #11

"No Set Stats" - what is this supposed to hold and where does the information come from?
__________________

Last edited by OciXCrom; 05-27-2020 at 08:15.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-27-2020 , 08:37   Re: [HELP] Admin Stats
Reply With Quote #12

Quote:
Originally Posted by OciXCrom View Post
"No Set Stats" - what is this supposed to hold and where does the information come from?
amx_addadmin_stats "One month admin and $ 10 payment"
--->
Code:
"AlferD" "1234" "asdefgsd" "a" "One month admin and $ 10 payment" "2020/25/5 | 20:20 AM"
That's how I know who this admin is,

If I don't write anything in amx_addadmin_stats = "No Set Stats"
--->
Code:
"AlferD" "1234" "asdefgsd" "a" "No Set Stats" "2020/25/5 | 20:20 AM"

Last edited by alferd; 05-27-2020 at 08:39.
alferd is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-27-2020 , 20:42   Re: [HELP] Admin Stats
Reply With Quote #13

Oh, ok, that is much clearer. It was really confusing because you used the word "stats" which means "statistics" and nothing your talking about has anything to do with statistics.

So basically, you want a printout of users.ini. Here is a plugin that will do just that:

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

public plugin_init()
{
	register_plugin("Show Admin List", "0.1", "Frank")
	register_concmd("amx_admininfo", "cmdAdminInfo")
}

public cmdAdminInfo(id)
{
	new usersfile[64], data[128]
	get_configsdir(usersfile, sizeof(usersfile) - 1)
	add(usersfile, sizeof(usersfile) - 1, "/users.ini")
	
	new f = fopen(usersfile, "rt")

	if(f)
	{
		while( fgets(f, data, charsmax(data)) )
		{
			trim(data)
			if( !data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/' ) continue;
			
			console_print(id, data);
		}
		fclose(f)
	}
}
__________________
fysiks is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-28-2020 , 04:56   Re: [HELP] Admin Stats
Reply With Quote #14

Quote:
Originally Posted by fysiks View Post
Oh, ok, that is much clearer. It was really confusing because you used the word "stats" which means "statistics" and nothing your talking about has anything to do with statistics.

So basically, you want a printout of users.ini. Here is a plugin that will do just that:

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

public plugin_init()
{
	register_plugin("Show Admin List", "0.1", "Frank")
	register_concmd("amx_admininfo", "cmdAdminInfo")
}

public cmdAdminInfo(id)
{
	new usersfile[64], data[128]
	get_configsdir(usersfile, sizeof(usersfile) - 1)
	add(usersfile, sizeof(usersfile) - 1, "/users.ini")
	
	new f = fopen(usersfile, "rt")

	if(f)
	{
		while( fgets(f, data, charsmax(data)) )
		{
			trim(data)
			if( !data[0] || data[0] == ';' || data[0] == '/' && data[1] == '/' ) continue;
			
			console_print(id, data);
		}
		fclose(f)
	}
}
Thanks a lot,You are a genius

Code:
] amx_admininfo
"STEAM_0:0:123456789" "1234" "qwertyuiopasdfghjklzxcvbnm" "cea"
"STEAM_0:0:1234567890" "1234" "qwertyuiopasdfghjklzxcvbnm" "cea"
Unknown command: amx_admininfo

Isn't there a way to clear this?:
Code:
Unknown command: amx_admininfo

Last edited by alferd; 05-28-2020 at 04:57.
alferd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-28-2020 , 08:22   Re: [HELP] Admin Stats
Reply With Quote #15

return PLUGIN_HANDLED in the end of the function.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 05-28-2020 , 08:27   Re: [HELP] Admin Stats
Reply With Quote #16

Quote:
Originally Posted by OciXCrom View Post
return PLUGIN_HANDLED in the end of the function.
Solved

Thanks to Frank and OciXCrom

Last edited by alferd; 05-28-2020 at 09:11.
alferd 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 23:48.


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