Raised This Month: $ Target: $400
 0% 

admin.txt plugin help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-08-2005 , 18:04   admin.txt plugin help
Reply With Quote #1

i want to make a plugin
that when you say /admin you see a file like motd.txt
but then admin.txt that is located in addons/amxmodx/configs folder
and the server must have it
and you have to code it in html
first say if it all can be done

sry first plugin i'm a noob
do i just do this show_(56)
but then with admins i have this code but I think it doesn't work
Code:
show_admins(id,"addons/amxmodx/config/admin.txt","All Admins")
__________________
- Bye bye!
nightscreem is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-08-2005 , 18:33  
Reply With Quote #2

whole .sma I want to edit it
real plugin name say /motd
Code:
#include <amxmodx> #include <amxmisc> public admin_motd(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         show_motd(id,"motd.txt","Message of the Day.")     return PLUGIN_HANDLED   } public admin_admin(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         show_admins(id,"addons/amxmodx/configs/admin.txt","All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say_motd","0.2","Nightscream")     register_concmd("say /motd","admin_motd",0,"- Shows the MOTD.")       register_concmd("say /admins","admin_admins",0,"- shows the admins.")     return PLUGIN_CONTINUE }
i get error with show_admins
__________________
- Bye bye!
nightscreem is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-08-2005 , 19:00  
Reply With Quote #3

Yes, because show_admins isn't a function..
Code:
#include <amxmodx> #include <amxmisc> public admin_motd(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         show_motd(id,"motd.txt","Message of the Day.")     return PLUGIN_HANDLED   } public admin_admins(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         show_motd(id,"addons/amxmodx/configs/admin.txt","All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say_motd","0.2","Nightscream")     register_concmd("say /motd","admin_motd",0,"- Shows the MOTD.")       register_concmd("say /admins","admin_admins",0,"- shows the admins.")     return PLUGIN_CONTINUE }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-09-2005 , 07:28  
Reply With Quote #4

i know but what do i have to do
__________________
- Bye bye!
nightscreem is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 03-09-2005 , 08:27  
Reply With Quote #5

I now have this is changed it but it still doesn't work
Code:
#include <amxmodx> #include <amxmisc> public admin_motd(id,level,cid){     if (!cmd_access(id,level,cid,1))         return PLUGIN_HANDLED         show_motd(id,"motd.txt","Message of the Day.")     return PLUGIN_HANDLED   } public mandatoryinform(stringdex[]) {     new admins     if (admins>0)     show_motd(admins,"/addons/amxmodx/config/admin.txt","All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say_motd","0.2","Nightscream")     register_concmd("say /motd","admin_motd",0, "- Shows the MOTD.")       register_concmd("say /admins", "admin_admins",0, "- shows the admins.")     return PLUGIN_CONTINUE }
the motd works fine but the admin thing don't plz help
__________________
- Bye bye!
nightscreem is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-09-2005 , 09:29  
Reply With Quote #6

That cuz you changed:

public admin_admins(id,level,cid){

To:

public mandatoryinform(stringdex[]) {


The second function is not registered to any command, like you had it before... Make sure the function matches what you regsiter here:

register_concmd("say /admins", "admin_admins",0, "- shows the admins.")

See, when you say /admins it should be calling the admin_admins() function, but you dont have it anymore..
xeroblood is offline
Send a message via MSN to xeroblood
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 03-09-2005 , 09:30  
Reply With Quote #7

This should work...
Code:
#include <amxmodx> public say_motd(id) {         show_motd(id, "motd.txt", "Message of the Day")     return PLUGIN_HANDLED     } public say_admins(id) {     show_motd(id, "addons/amxmodx/config/admin.txt", "All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say /motd", "0.2", "Nightscream")     register_clcmd("say /motd", "say_motd")       register_clcmd("say /admins", "say_admins") }
XunTric is offline
Extremeone
Senior Member
Join Date: Jan 2005
Old 03-09-2005 , 10:14  
Reply With Quote #8

Quote:
Originally Posted by XunTric
This should work...
Code:
#include <amxmodx> public say_motd(id) {         show_motd(id, "motd.txt", "Message of the Day")     return PLUGIN_HANDLED     } public say_admins(id) {     show_motd(id, "addons/amxmodx/config/admin.txt", "All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say /motd", "0.2", "Nightscream")     register_clcmd("say /motd", "say_motd")       register_clcmd("say /admins", "say_admins") }
addons/amxmodx/configs/admin.txt
Extremeone is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-09-2005 , 12:02  
Reply With Quote #9

You shouldn't hard-code the configs directory path, instead Include <amxmisc> into your plugin and use:

Code:
stock get_configsdir(name[],len)


Example:
Code:
#include <amxmodx> #include <amxmisc> public say_motd(id) {     show_motd(id, "motd.txt", "Message of the Day")     return PLUGIN_HANDLED } public say_admins(id) {     new szFileDir[64]     get_configsdir( szFileDir, 63 )     format( szFileDir, 63, "%s/admin.txt", szFileDir )     show_motd(id, szFileDir, "All Admins")     return PLUGIN_HANDLED } public plugin_init() {     register_plugin("say /motd", "0.2", "Nightscream")     register_clcmd("say /motd", "say_motd")     register_clcmd("say /admins", "say_admins") }
xeroblood is offline
Send a message via MSN to xeroblood
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-09-2005 , 19:24  
Reply With Quote #10

Good idea . I'll do that from now on.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x 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 14:10.


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