AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   Admin Prefixes V4.0 by m0skVi4a ;] (https://forums.alliedmods.net/showthread.php?t=183491)

m0skVi4a 04-22-2012 10:38

Admin Prefixes V4.0 by m0skVi4a ;]
 
8 Attachment(s)
Plugin Name: Admin Prefixes
Plugin Author: m0skVi4a ;]
Plugin Version: 4.0
Modification: Counter - Strike
Category: Fun Stuff



Description:

With this plugin you can set prefixes to Admins with special flags. Also Admins can put custom prefixes to them or to other players if they want, but only if they have the required flag.


Pictures:
http://i48.tinypic.com/a3o66u.png


Commands:

Commands:

say /prefix
Toggles Prefix ON or OFF.

say_team /prefix
Toggles Prefix ON or OFF.

ap_reload_prefixes
Reloads Prefixes' file from console without restarting the server.

ap_reload_badprefixes
Reloads Bad Prefixes' file from console without restarting the server.

ap_put "type (f, i, s, n)" "key(Flag, IP, SteamID, name)" "Prefix"
Puts prefix to the key you type if you have the special flag. Or if there is no prefix typed, removes the prefix which the player has.


CVARS:

Code:

"ap_bad_prefixes"        -        Is the Bad Prefixes option on(1) or off(0).  Default: 1
"ap_listen"                -        Is the Admin Listen option on(1) or off(0).  Default: 1
"ap_listen_flag"        -        The flag, needed for Listen option.  Default: a
"ap_custom"                -        Is the Custom Prefix option for each Admin is on(1) or off(0).  Default: 1
"ap_custom_flag"        -        The flag, needed for setting custom prefix.  Default: b
"ap_say_characters"        -        Is the Start Say Characters option on(1) or off(0).  Default: 1
"ap_prefix_characters"        -        Is the Checker for Characters in Custom Prefixes' Options on(1) or off(0).  Default: 1

All CVARS are without quotes


Credits:

m0skVi4a ;] - for the idea, making and testing the plugin
SpeeDeeR - for little help with the plugin
Ant1Lamer - for testing the plugin
Vasilii-Zaicev - for testing the plugin


Changelog:

Code:

April 22, 2012  -  V1.0:
        -  First Release
       
May 19, 2012  -  V2.0:
        -  Full optimization
        -  Added Bad Prefixes' file
        -  Added Multi-Lingual file
        -  Added IP and Name support in ap_prefixes.ini
        -  Added Forbidden Say characters
        -  New CVARS for setting the flags for each of the options

May 29, 2012  -  V2.1:
        -  Fixed bug with some say or say_team commands are not executed

January 17, 2013  -  V3.0:
        -  Full optimization
        -  Fixed bug when typing spaces and in tha chat is showing an empty message
        -  SteamID support
        -  Removed nvault
        -  Removed ap_put_player command
        -  ap_put_player command is combined with ap_put command
        -  Removed some CVARs

August 18, 2013  -  V4.0:
        -  Small code changes and little bug fixes
        -  Added Prefux Toggle command
        -  Fixed bug with the supporting of the plugin on AMXX 1.8.2
        -  AMXX 1.8.2 Supprot!
        -  SQL Version!


Moduls:
PHP Code:

#include <amxmodx>
#include <cstrike> 


Libraries:
PHP Code:

#include <amxmisc>
#include <celltrie>[
#include <sqlx>[ 


Installation
1. Compile the plugin
2. .amxx file goes to plugins dir
3. admin_prefixes.txt goes to data/lang dir
4. ap_prefixes.ini and ap_bad_prefixes.ini go to configs dir and customize them.
5. Add the name of the .amxx file in plugins.ini and start your server


How to set up ap_prefixes.ini
- When adding new prefix, you should conform that you must set the type of the prefix. There are 4 types: type Flag, type IP, type SteamID and type Name, each begins with the character "f", "i", "s" и "n" accordingly.
Here are some examples:
"f" "n" "[PREFIX FLAG]" - this way person with Flag n will have prefix [PREFIX FLAG]
"i" "192.168.1.100" "[PREFIX IP]" - this way person with IP 192.168.1.100 will have prefix [PREFIX IP]
"s" "STEAM_0:1:52985922" "[PREFIX STEAMID]" - this way person with Name m0skVi4a ;] will have prefix [PREFIX NAME]
"n" "m0skVi4a ;]" "[PREFIX NAME]" - this way person with Name m0skVi4a ;] will have prefix [PREFIX NAME]

- If you want to edit who can use the reload command for the plugin's file, open the .sma file and find
PHP Code:

#define FLAG_LOAD ADMIN_CFG 

and edit ADMIN_CFG to the flag that you want (It mustn't be just a character)

- If you want to edit how many prefixes can be loaded, open the .sma file and find
PHP Code:

#define MAX_FLAGS 33 

and edit 33 to any number you want (It is recommended not to be touched)

- If you want the prefix to be coloured, use !g for green, !t for team and !n for noramal colour (It DOES NOT works and with the commands ap_put and ap_put_player)


How to set up ap_bad_prefixes.ini
- If you want to add new Bad Prefix, just write each prefix on new line.
Here is an example:
"[OWNER]"
"[BOSS]"
"[PROSTAK]"
"[IDIOT]"
- that way people who can set Custom Prefixes, can not set these.

- If you want to edit who can use the reload command for the plugin's file, open the .sma file and find
PHP Code:

#define FLAG_LOAD ADMIN_CFG 

and edit ADMIN_CFG to the flag that you want (It mustn't be just a character) (same as ap_prefixes.ini)

- If you want to edit how many prefixes can be loaded, open the .sma file and find
PHP Code:

#define MAX_BAD_PREFIXES 100 

and edit 100 to any number you want (It is recommended not to be touched)


This plugin is tested by me, m0skVi4a ;] , on AMX MOD X 1.8.2 and it works properly!!!

spike1554746 04-22-2012 11:51

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
nice plugin i well try it

Ex1ne 04-22-2012 12:12

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Isn't this already made?

pacheco 04-22-2012 12:36

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
gj

m0skVi4a 04-22-2012 12:36

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Quote:

Originally Posted by Ex1ne (Post 1694481)
Isn't this already made?

If you mean this http://forums.alliedmods.net/showthread.php?t=156578 it is not the same at all.

akcaliberg 04-22-2012 17:25

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
I installed but, it gave bad_load error ? Help pls

m0skVi4a 04-23-2012 11:12

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Quote:

Originally Posted by akcaliberg (Post 1694735)
I installed but, it gave bad_load error ? Help pls

Please give more information or picture

akcaliberg 04-23-2012 16:58

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Thanks, I solved the problem. cstrike module was missing. I installed the module and it worked.

bazhenov93 04-24-2012 03:07

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
#if defined USE_SQL
#include <sqlx>
#endif

Would be better!

shadybg 04-24-2012 08:08

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
How about ML support?

m0skVi4a 04-24-2012 11:20

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
@bazhenov93
@shadybg
I will think for thise suggestions :)

puRpl haZe 04-26-2012 06:07

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
hey guys, i tried this plugin at my server, and it works awesome! plugin is great.
I just have one problem. Im not a good in this kind of programing, so i need some help.
I've set admin prefix on d flag, bcus only admins have it. So when admin say something it looks like this:
[Admin] puRpl' haZe!: Hello! - the trick is here, text of admin message is set to be green by default.
So i would like to change it, to be normal color, like default chat of players.
Please, can anyone tell me how to do this? So, once more, prefix [Admin] should still be green, but i want text to be normal color.
Thanks in advance!

m0skVi4a 04-26-2012 12:36

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
formatex(g_message, charsmax(g_message), "^4%s^3 %s :^4 %s", client_prefix[id], g_name, g_typed)
--->
formatex(g_message, charsmax(g_message), "^4%s^3 %s :^1 %s", client_prefix[id], g_name, g_typed)

Difference:
:^4 %s
->
:^1 %s

^4 - green
^3 - team
^1 - normal

GarbageBox 04-26-2012 13:15

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
I think it would be better that if players can custom their own prefix.

m0skVi4a 04-26-2012 15:18

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Quote:

Originally Posted by GarbageBox (Post 1696877)
I think it would be better that if players can custom their own prefix.

They can :)
In admin_prefixes.ini
CUSTOM_CURRENT z

puRpl haZe 04-26-2012 20:52

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Thank you very much!
Ok here is one more problem.
On my server it is like this:
head admin - abcdefghijklmnopqrstux
adv admin - abcdefgijkmnopqrstu
admin - abcdeimnopqrstu
trial admin - bcdeiu
members - b
players - z
So, now i want to make like this:
[head admin] - for head admins
[adv admin] - for adv admins
[admin] - for admins and trial admins
[z-hq] - for members
But i have a conflict between flags. If i make b flag to be [z-hq], than all other admins have prefix [z-hq] bcus they have b flag. same problem for the rest of list. Can i solve this issue somehow?

m0skVi4a 04-27-2012 14:05

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
You don't have to put all of the flags..
Only one is needed

Nick Haldem 04-27-2012 14:16

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Great work.Will test it today!

NBRider88 05-06-2012 18:25

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
I downloaded the plugin, however I do not see the .amxx file? Only sma & cfg What Am I doing wrong? :-/

m0skVi4a 05-07-2012 13:00

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Attaching .amxx files here is forbidden :D
Compile localy or here http://www.amxmodx.org/webcompiler.cgi

bLacK-bLooD 05-07-2012 15:15

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Wouldn't this be easier?

PHP Code:

#include <amxmodx> 
#include <colorchat>

#define PLUGIN "Admin Tags" 
#define VERSION "1.1" 
#define AUTHOR "emblaze" 

new flagi[] = { 
    
ADMIN_IMMUNITY

new 
tagi[][] = { 
    
"[ADMIN]"


public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR

public 
client_authorized (id) { 
    new 
username[32
    
get_user_name(idusername31
    
    new 
user_flags get_user_flags(id
    for (new 
ii<sizeof(flagi); i++) 
        if (
user_flags flagi[i]) 
        { 
            if (
contain(usernametagi[i])==-1
                
ColorChat(idGREEN"name ^"%s^x01 %s^""tagi[i], username
            break 
        } 



NBRider88 05-07-2012 15:54

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Quote:

Originally Posted by m0skVi4a (Post 1704318)
Attaching .amxx files here is forbidden :D
Compile localy or here http://www.amxmodx.org/webcompiler.cgi


Got it. Thank you

m0skVi4a 05-08-2012 11:49

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
@bLacK-bLooD The idea of this plugin is not to be edited if you want to add more prefixes.

Devil259 05-10-2012 05:23

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
http://forums.alliedmods.net/showthread.php?t=173113

m0skVi4a 05-10-2012 12:11

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
Quote:

Originally Posted by Devil259 (Post 1706082)

I have not seen this before. After reading the topic I realized that my plugin does not have any unnecessary functions..

INDEST 05-10-2012 14:20

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
In my users.ini i have the flags "abcdefghijklmnopqrstu" for head admins and "t" for vips.
But when i enter my server as head admin,it recognises me as a vip,because the flag "t" is also in the head admins,not only in vip. Is there any way to solve this flag conflict or the plugin is useless?

m0skVi4a 05-11-2012 14:41

Re: Admin Prefixes V1.0 by m0skVi4a ;]
 
"[HEAD ADMIN]" "o"
"[VIP]" "t"

This in admin_prefixes.ini

m0skVi4a 05-19-2012 14:36

Re: Admin Prefixes V2.0 by m0skVi4a ;]
 
Update :)
See changelog!

akcaliberg 05-21-2012 08:56

Re: Admin Prefixes V2.0 by m0skVi4a ;]
 
I have not understood what is mean of bad prefix ?

And here: Turkish Translate
Code:

[tr]
PREFIX_PERMISSION = %s Prefix Dosyasini Yeniden Yuklemek Icin Yetkin Yok!
PREFIX_NOT_FOUND = %s Prefix dosyasi -  %s bulunamadi !
PREFIX_LOAD_IP = %s YUKLENDI: Prefix:  %s Belirtilen IP'ye Verildi... IP:  %s
PREFIX_LOAD_NAME = %s YUKLENDI: Prefix:  %s Belirtilen Isimdeki Oyuncuya Verildi... Isim:  %s
PREFIX_LOAD_FLAG = %s YUKLENDI: Prefix:  %s Belirtilen Yetkideki Oyunculara Verildi... Yetki:  %s
PREFIX_NO = %s Hic Prefix Bulunamadi !
PREFIX_LOADED_BY = %s Prefix Dosyasi %s Tarafindan Yuklendi !
PREFIX_LOADED = %s Prefix Dosyasi Yuklendi !
BADP_OFF = %s Bad Prefix Ayari Suanda Devre Disi !
BADP_PERMISSION = %s Bad Prefix Dosyasini Yuklemek Icin Yetkin Yok !
BADP_NOT_FOUND = %s Bad Prefix Dosyasi -  %s bulunamadi !
BADP_LOAD = %s YUKLENDI: Bad Prefix:  %s
BADP_NO = %s Hic Bad Prefix Bulunamadi !
BADP_LOADED_BY = %s Bad Prefix Dosyasi %s Tarafindan Yuklendi !
BADP_LOADED = %s Bad Prefix Dosyasi Yuklendi !
CUSTOM_OFF = %s Ozel Prefix Ayari Suanda Devre Disi !
CUSTOM_PERMISSION = %s Ozel Prefix Ayari Icin Yetkin Yok !
CUSTOM_FORBIDDEN = %s Yazdigin Prefix - %s bu serverda yasakli ! Baska bir tane dene!
CUSTOM_SYMBOL = %s Yazdigin Prefix - %s kotu karakter iceriyor -  %s  Kaldir ve baska bir tane dene .
CUSTOM_REMOVE = %s Ozel Prefixini Basariyla Kaldirdin !
CUSTOM_REMOVE_INFO = %s Oyuncu %s Ozel Prefixini Kaldirdi !
CUSTOM_CHANGE = %s Ozel Prefixini Basariyla %s Olarak Degistirdin !
CUSTOM_CHANGE_INFO = %s Oyuncu %s Ozel Prefixini %s Olarak Degistirdi !
CO_OFF = %s Ozel Prefix Ayari Suanda Devre Disi !
CO_PERMISSION = %s Ozel Prefix Ayarlamak Icin Yetkin Yok !
CO_REMOVE = %s Basariyla  ^"%s^"'s Ozel Prefixini Kaldirdin
CO_REMOVE_INFO = %s Oyuncu %s kendi ^"%s^"'s Ozel Prefixini Kaldirdi.
CO_CHANGE = %s Basariyla ^"%s^"'s Ozel Prefixini  %s Olarak Degistirdin.
CO_CHANGE_INFO = %s Oyuncu %s kendi ^"%s^"'s Ozel Prefixini %s Olarak Degistirdi !


Nick Haldem 05-21-2012 09:41

Re: Admin Prefixes V2.0 by m0skVi4a ;]
 
He meant that players and admins cant put themselves prefixes that will be in your cfg file

Moskvi4ka thank you!Great on, like your works :)

m0skVi4a 05-29-2012 14:03

Re: Admin Prefixes V2.1 by m0skVi4a ;]
 
Update! See changelog

Added White Chat Support. Just compile AdminPrefixes_WHITE_CHAT

samer 123 06-03-2012 12:00

Re: Admin Prefixes V2.1 by m0skVi4a ;]
 
Good plugin but there is many plugins like it ... and maby better!

strykercito 06-17-2012 19:42

Re: Admin Prefixes V2.1 by m0skVi4a ;]
 
I'm using the AdminPrefixes_WHITE_CHAT
I can see the ext white which is good.
but players see what I write in team color.
So, pretty much I'm the only one who can see it white.
Same thing happen with admins, they can see what they write in white.
but for everyone else shows up on team color.

Any way to fix this? so everyone will see the white text?

Thanks in advance.

m0skVi4a 06-26-2012 13:38

Re: Admin Prefixes V2.1 by m0skVi4a ;]
 
Quote:

Originally Posted by strykercito (Post 1730827)
I'm using the AdminPrefixes_WHITE_CHAT
I can see the ext white which is good.
but players see what I write in team color.
So, pretty much I'm the only one who can see it white.
Same thing happen with admins, they can see what they write in white.
but for everyone else shows up on team color.

Any way to fix this? so everyone will see the white text?

Thanks in advance.

Bug fixed!
Updated. See changelog.

happy_2012 09-23-2012 09:56

Re: Admin Prefixes V2.2 by m0skVi4a ;]
 
I have been looking for this kinda plugins thanks :)

claudiuhks 09-30-2012 02:55

Re: Admin Prefixes V2.2 by m0skVi4a ;]
 
It's badly coded, take a look here: http://forums.alliedmods.net/showthread.php?p=752407
Why do you return PLUGIN_HANDLED on say command?

brlight 01-19-2013 17:21

Re: Admin Prefixes V2.2 by m0skVi4a ;]
 
Thank you for your effort and for sharing this plugin m0skVi4a, almost everything works fine for me.Donīt know if itīs a bug of the plugin but this plugin along with the sank sounds plugin as issues.The problem is that my Sank Sounds plugin is configured not to show the words I type in chat for playing the sound, for instance, if I write duck1 on chat it starts playing the sound asssociated to the word "duck1" but it doesnīt show on chat the word duck1.
After instaling this plugin it always shows what I type to play sounds.Is it possible to correct this?
Thank you very much.

m0skVi4a 01-20-2013 08:13

Re: Admin Prefixes V2.2 by m0skVi4a ;]
 
"ap_say_characters" - Is the Start Say Characters option on(1) or off(0). Default: 1

Edit this to add more.
PHP Code:

new const forbidden_say_symbols[] = {
    
"/",
    
"!",
    
"%",
    
"$"


If the CVAR is set to 0 it won't block showing this messages. If the CVAR is set to 1 it will block showing this messages

m0skVi4a 02-18-2013 13:23

Re: Admin Prefixes V3.0 by m0skVi4a ;]
 
UPDATE!
See changelog
Soon SQL version!

codeye 03-11-2013 10:37

Re: Admin Prefixes V3.0 by m0skVi4a ;]
 
would it be possible to use this on csgo?


All times are GMT -4. The time now is 13:20.

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