AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   a quick q (https://forums.alliedmods.net/showthread.php?t=56104)

|OnEHiTwOnDeR| 06-06-2007 17:57

a quick q
 
have guys a quick q...i wanna have a say plugin that bring up a motd type window ingame i know how to do that but, i want it to work for /top10 and /topx at the same type but dunno how that would go into a code for both commands to bring up ssame thing or do i need to separate plugins?

this a code id use for it:

Code:

#include <amxmodx>
#include <amxmisc>

public admin_motd(id,level,cid) {

    if (!cmd_access(id,level,cid,1))
    return PLUGIN_CONTINUE
   
    show_motd(id,"top.txt","Stats Info")
    return PLUGIN_CONTINUE 
}

public plugin_init() {

    register_plugin("say /top10","1.1","OneHit")
    register_clcmd("say /top10","admin_motd",0,"- Shows the TOP10 HlStatsX.")
}


Jenger 06-07-2007 00:42

Re: a quick q
 
Two things:

a) Does the code you have work, or are you having problems with it?
b) You can define both clcmds in the same file.

Code:

register_clcmd("say /top10", "Function", 0, " - Description");
register_clcmd("say /topx", "Function, 0, " - Description");

And by the way, the:
if (!cmd_access(id,level,cid,1))
return PLUGIN_CONTINUE
is pointless, because you are giving everybody access to that command, so there's no point in checking if they have access.


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

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