AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   admin.txt plugin help (https://forums.alliedmods.net/showthread.php?t=11056)

nightscreem 03-08-2005 18:04

admin.txt plugin help
 
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")

nightscreem 03-08-2005 18:33

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

v3x 03-08-2005 19:00

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 }

nightscreem 03-09-2005 07:28

i know but what do i have to do

nightscreem 03-09-2005 08:27

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

xeroblood 03-09-2005 09:29

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..

XunTric 03-09-2005 09:30

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") }

Extremeone 03-09-2005 10:14

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

xeroblood 03-09-2005 12:02

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") }

v3x 03-09-2005 19:24

Good idea :). I'll do that from now on.


All times are GMT -4. The time now is 14:10.

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