Скриптер
Проверенный
Участник
Пользователь
- Сообщения
- 584
- Реакции
- 1,006
- Помог
- 18 раз(а)
with this you will get recursion.server_cmd("amx_reloadprefixes")
with this you will get recursion.server_cmd("amx_reloadprefixes")
Sorry !! This recursion, makes difficult for me to understand since its used in programming and I'm TBH noob in it, I'm Medical Student by profession which makes me much more noob in it.with this you will get recursion.
public plugin_init()
{
register_srvcmd("amx_reaload_prefixes", "Reloadprefixes");
// to addons
register_srvcmd("amx_reaload_blocklist", "ReloadBlocklist");
register_srvcmd("amx_reaload_whitelist", "ReloadWhitelist");
}
public Reloadprefixes() {
TrieDestroy(g_tSteamPrefixes);
TrieDestroy(g_tNamePrefixes);
ArrayDestroy(g_aFlagPrefixes);
g_iTrieSteamSize = 0; // so maybe exist some global counters, this need set to 0
g_iTrieNameSize = 0;
LoadPlayersPrefixes();
}
public ReloadBlocklist()
{
ArrayDestroy(g_aBlackList);
g_iBlackListSize = 0;
LoadBlackList()
}
public ReloadWhitelist()
{
ArrayDestroy(g_aWhiteListIp);
ArrayDestroy(g_aWhiteListDomain);
LoadWhiteList();
}
Perfect but won't this also come in core instead of addon? since this is part of core and whitelist and blacklist are of addons? [A Question]Код:public plugin_init() { register_srvcmd("amx_reaload_prefixes", "Reloadprefixes"); // to addons register_srvcmd("amx_reaload_blocklist", "ReloadBlocklist"); register_srvcmd("amx_reaload_whitelist", "ReloadWhitelist"); } public Reloadprefixes() { TrieDestroy(g_tSteamPrefixes); TrieDestroy(g_tNamePrefixes); ArrayDestroy(g_aFlagPrefixes); g_iTrieSteamSize = 0; // so maybe exist some global counters, this need set to 0 g_iTrieNameSize = 0; LoadPlayersPrefixes(); } public ReloadBlocklist() { ArrayDestroy(g_aBlackList); g_iBlackListSize = 0; LoadBlackList() } public ReloadWhitelist() { ArrayDestroy(g_aWhiteListIp); ArrayDestroy(g_aWhiteListDomain); LoadWhiteList(); }
}
public Reloadprefixes() {
TrieDestroy(g_tSteamPrefixes);
TrieDestroy(g_tNamePrefixes);
ArrayDestroy(g_aFlagPrefixes);
g_iTrieSteamSize = 0; // so maybe exist some global counters, this need set to 0
g_iTrieNameSize = 0;
LoadPlayersPrefixes();
}
Mistrick Sorry for being late.DrStrange, yes, code for reload prefixes need paste to core sma.
// to chatmanager
public plugin_init()
{
register_concmd("amx_reload_prefixes", "Reloadprefixes", ADMIN_RCON, "Reload Chat Manager Prefixes");
}
public Reloadprefixes(id) {
TrieDestroy(g_tSteamPrefixes);
TrieDestroy(g_tNamePrefixes);
ArrayDestroy(g_aFlagPrefixes);
g_iTrieSteamSize = 0; // so maybe exist some global counters, this need set to 0
g_iTrieNameSize = 0;
LoadPlayersPrefixes();
console_print(id, "Reloaded Chat Manager Prefixes");
}
// to addons
public plugin_init()
{
register_concmd("amx_reload_blacklist", "ReloadBlacklist", ADMIN_RCON, "Reload Chat Manager Blacklist");
register_concmd("amx_reload_whitelist", "ReloadWhitelist", ADMIN_RCON, "Reload Chat Manager Whitelist");
}
public ReloadBlacklist(id)
{
ArrayDestroy(g_aBlackList);
g_iBlackListSize = 0;
LoadBlackList();
console_print(id, "Reloaded Chat Manager Blacklist");
}
public ReloadWhitelist(id)
{
ArrayDestroy(g_aWhiteListIp);
ArrayDestroy(g_aWhiteListDomain);
LoadWhiteList();
console_print(id, "Reloaded Chat Manager Whitelist");
}