Plugin adminhelp

Vaata eelmist teemat Vaata järgmist teemat Go down

Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 18:54

Tere !
kuidas muuda chat color nii Type 'amx_help<-- roheline'n i the console to see available commands <-- see tekst sinine


amx_help - roheline - Green

Type  in the console to see available commands <--  color roheline - Blue

/* AMX Mod X
* Admin Help Plugin
*
* by the AMX Mod X Development Team
* originally developed by tcquest78
*
* This file is part of AMX Mod X.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/

#include
#include

#define DISPLAY_MSG // Comment to disable message on join
#define HELPAMOUNT 10 // Number of commands per page

public plugin_init()
{
register_plugin("Admin Help", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("adminhelp.txt")
register_concmd("amx_help", "cmdHelp", 0, " [nr of cmds (only for server)] - displays this help")
}

#if defined DISPLAY_MSG
public client_putinserver(id)
{
if (is_user_bot(id))
return

set_task(15.0, "dispInfo", id)
}

public client_disconnect(id)
{
remove_task(id)
}
#endif

public cmdHelp(id, level, cid)
{
new arg1[8], flags = get_user_flags(id)
new start = read_argv(1, arg1, 7) ? str_to_num(arg1) : 1
new lHelpAmount = HELPAMOUNT

// HACK: ADMIN_ADMIN is never set as a user's actual flags, so those types of commands never show
if (flags > 0 && !(flags & ADMIN_USER))
{
flags |= ADMIN_ADMIN;
}

if (id == 0 && read_argc() == 3)
lHelpAmount = read_argv(2, arg1, 7) ? str_to_num(arg1) : HELPAMOUNT

if (--start < 0)
start = 0

new clcmdsnum = get_concmdsnum(flags, id)

if (start >= clcmdsnum)
start = clcmdsnum - 1

console_print(id, "^n----- %L -----", id, "HELP_COMS")

new info[128], cmd[32], eflags
new end = start + lHelpAmount // HELPAMOUNT

if (end > clcmdsnum)
end = clcmdsnum

for (new i = start; i < end; i++)
{
get_concmd(i, cmd, 31, eflags, info, 127, flags, id)
console_print(id, "%3d: %s %s", i + 1, cmd, info)
}

console_print(id, "----- %L -----", id, "HELP_ENTRIES", start + 1, end, clcmdsnum)

if (end < clcmdsnum)
console_print(id, "----- %L -----", id, "HELP_USE_MORE", end + 1)
else
console_print(id, "----- %L -----", id, "HELP_USE_BEGIN")

return PLUGIN_HANDLED
}

#if defined DISPLAY_MSG
public dispInfo(id)
{
ColorChat(id, BLUE, "%L", id, "TYPE_HELP")

new nextmap[32]
get_cvar_string("amx_nextmap", nextmap, 31)

if (get_cvar_float("mp_timelimit"))
{
new timeleft = get_timeleft()

if (timeleft > 0)
{
client_print(id, print_chat, "%L", id, "TIME_INFO_1", timeleft / 60, timeleft % 60, nextmap)
} else {
client_print(id, print_chat, "%L", id, "TIME_INFO_2", nextmap)
}
}
}
#endif
Tonight
Tonight

Plugin adminhelp Vetera11
Liitus : 19/02/2012
Postitusi : 17982

PostitamineTonight 11.02.13 19:15

See tekst, mis sa sinisena tahaksid, oleks terroristidel punane. Soovid nii?
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 19:56

tekst ainult sinine T ja CT
amx_help ainult roheline T ja CT
Tonight
Tonight

Plugin adminhelp Vetera11
Liitus : 19/02/2012
Postitusi : 17982

PostitamineTonight 11.02.13 20:12

Kahjuks pole ainult sinine võimalik. Saad teha tiimi värvi - T-l on samal ajal punane kiri, kui CT-l on sinine.
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 21:10

ok pane T punane ja CT sinine
ja amx_help rohaline
Tonight
Tonight

Plugin adminhelp Vetera11
Liitus : 19/02/2012
Postitusi : 17982

PostitamineTonight 11.02.13 21:37

Tegelt võtaks ma sinu asemel display message maha ning kasutaks ad pluginat selle jaoks ;)
https://www.faval.eu/t22-amxx-automaatne-reklaam
Kood:
!tKirjuta konsooli !gamx_help!t, et vaadata saadaval olevaid commande
Muidu peaks siin colorchatiga jamama hakkama ;)
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 21:49

mis ma muudan adminhelp.sma?
ColorChat(id, BLUE, "%L", id, "TYPE_HELP") see text sinine
register_concmd("amx_help", "cmdHelp", 0, " [nr of cmds (only for server)] - displays this help") kuidas ma panen amx_help roheline ? nii
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 21:58

ma kohe teen screenshots :D
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 22:07

Plugin adminhelp Aim_ak-colt0001
Tonight
Tonight

Plugin adminhelp Vetera11
Liitus : 19/02/2012
Postitusi : 17982

PostitamineTonight 11.02.13 22:21

Hmm, ma pole eriline colorchat spetsialist...
Proovi nii:
Lisa .sma faili:
Kood:
#include <colorchat>

Ava fail adminhelp.txt (amxmodx\data\lang kaustas)
Otsi ülesse rida TYPE_HELP = Type 'amx_help' in the console to see available commands
Muuda see:
Kood:
TYPE_HELP = !tType '!gamx_help!t' in the console to see available commands
Compilimisel vaata, et sul oleks olemas colorchat module ning pead local compile tegema.
Fast-One
Fast-One
Juunior
Liitus : 16/01/2013
Postitusi : 17

PostitamineFast-One 11.02.13 22:49

kuidas compile adminhelp.txt? ma ainult tean kuidas adminhelp.sma compile
Tonight
Tonight

Plugin adminhelp Vetera11
Liitus : 19/02/2012
Postitusi : 17982

PostitamineTonight 11.02.13 23:02

:D
adminhelp.txt lihtsalt salvesta, adminhelp.sma compiled (enne lisad #include <colorchat> sinna)

Vaata eelmist teemat Vaata järgmist teemat Tagasi üles

Soovid vestluses osaleda?

Selleks logi sisse või tee endale kasutaja.

Liitu foorumiga

Tee endale kasutaja ning osale aruteludes.


Tee uus kasutaja

Logi sisse

Omad foorumis juba kasutajat? Logi sisse.


Logi sisse

 
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele