54 |
#define ADMIN_NAME (1<<4) |
#define ADMIN_NAME (1<<4) |
55 |
|
|
56 |
new g_cmdLoopback[16] |
new g_cmdLoopback[16] |
57 |
|
new bool:g_CaseSensitiveName[33]; |
58 |
|
|
59 |
// pcvars |
// pcvars |
60 |
new amx_mode; |
new amx_mode; |
122 |
loadSettings(configsDir) // Load admins accounts |
loadSettings(configsDir) // Load admins accounts |
123 |
#endif |
#endif |
124 |
} |
} |
125 |
|
public client_connect(id) |
126 |
|
{ |
127 |
|
g_CaseSensitiveName[id] = false; |
128 |
|
} |
129 |
public addadminfn(id, level, cid) |
public addadminfn(id, level, cid) |
130 |
{ |
{ |
131 |
if (!cmd_access(id, level, cid, 3)) |
if (!cmd_access(id, level, cid, 3)) |
631 |
static AuthData[44]; |
static AuthData[44]; |
632 |
static Password[32]; |
static Password[32]; |
633 |
|
|
634 |
|
g_CaseSensitiveName[id] = false; |
635 |
|
|
636 |
Count=admins_num(); |
Count=admins_num(); |
637 |
for (new i = 0; i < Count; ++i) |
for (new i = 0; i < Count; ++i) |
638 |
{ |
{ |
667 |
} |
} |
668 |
else |
else |
669 |
{ |
{ |
670 |
|
if (Flags & FLAG_CASE_SENSITIVE) |
671 |
|
{ |
672 |
|
if (Flags & FLAG_TAG) |
673 |
|
{ |
674 |
|
if (contain(name, AuthData) != -1) |
675 |
|
{ |
676 |
|
index = i |
677 |
|
g_CaseSensitiveName[id] = true |
678 |
|
break |
679 |
|
} |
680 |
|
} |
681 |
|
else if (equal(name, AuthData)) |
682 |
|
{ |
683 |
|
index = i |
684 |
|
g_CaseSensitiveName[id] = true |
685 |
|
break |
686 |
|
} |
687 |
|
} |
688 |
|
else |
689 |
|
{ |
690 |
if (Flags & FLAG_TAG) |
if (Flags & FLAG_TAG) |
691 |
{ |
{ |
692 |
if (containi(name, AuthData) != -1) |
if (containi(name, AuthData) != -1) |
702 |
} |
} |
703 |
} |
} |
704 |
} |
} |
705 |
|
} |
706 |
|
|
707 |
if (index != -1) |
if (index != -1) |
708 |
{ |
{ |
831 |
get_user_name(id, oldname, 31) |
get_user_name(id, oldname, 31) |
832 |
get_user_info(id, "name", newname, 31) |
get_user_info(id, "name", newname, 31) |
833 |
|
|
834 |
|
if (g_CaseSensitiveName[id]) |
835 |
|
{ |
836 |
|
if (!equal(newname, oldname)) |
837 |
|
{ |
838 |
|
accessUser(id, newname) |
839 |
|
} |
840 |
|
} |
841 |
|
else |
842 |
|
{ |
843 |
if (!equali(newname, oldname)) |
if (!equali(newname, oldname)) |
844 |
{ |
{ |
845 |
accessUser(id, newname) |
accessUser(id, newname) |
846 |
} |
} |
847 |
|
} |
848 |
return PLUGIN_CONTINUE |
return PLUGIN_CONTINUE |
849 |
} |
} |
850 |
|
|