Plugin na cheaterów
esticire
17.01.2025
Cześć, Ostatnio myślałem o próbie napisania pluginu który zamraża gracza oraz nie pozwala mu strzelać, co się udało.
Chciałem go rozbudować o zapisywanie SID do pliku TXT i blokowanie każdego gracza z danym SID który jest obecnie na serwerze.
Niestety nie mogę przeprowadzić tego pluginu przez proces kompilacji i nie rozumiem dlaczego, czy możecie mi w tym pomóc?
Załączam plugin który zatrzymuje (podstawke) i w cytacie to co rozbudowałem.
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <fun> #define PLUGIN "AMX Stay" #define VERSION "1.0" #define AUTHOR "mT[1]g" new bool:g_bStayBlocked[33]; new Float:g_fMaxSpeed[33]; new String:g_szBlockedSIDs[100][32]; new g_iBlockedCount = 0; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_concmd("amx_stay", "cmd_amx_stay", ADMIN_BAN, "<nick/steamid> - Zatrzymaj/odblokuj gracza"); register_concmd("amx_stay_remove", "cmd_amx_stay_remove", ADMIN_BAN, "<SID> - Usuń SID z blokady"); RegisterHam(Ham_Spawn, "player", "client_spawn", 1); register_forward(FM_CmdStart, "on_cmd_start", 1); LoadBlockedSIDs(); } LoadBlockedSIDs() { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "r"); if (handle) { while (!feof(handle)) { new line[32]; fgets(line, sizeof(line), handle); if (line[0] != '\0') { trim(line); formatex(g_szBlockedSIDs[g_iBlockedCount], sizeof(g_szBlockedSIDs[g_iBlockedCount]), "%s", line); g_iBlockedCount++; } } fclose(handle); } } SaveBlockedSID(szSID[]) { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "a"); if (handle) { fprintf(handle, "%s^n", szSID); fclose(handle); } } RemoveBlockedSID(szSID[]) { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "r"); new tempFile[64]; formatex(tempFile, sizeof(tempFile), "temp_blocked_sids.txt"); new tempHandle = fopen(tempFile, "w"); if (handle && tempHandle) { while (!feof(handle)) { new line[32]; fgets(line, sizeof(line), handle); if (line[0] != "\0") { trim(line); if (!equal(line, szSID)) { fprintf(tempHandle, "%s^n", line); } } } fclose(handle); fclose(tempHandle); delete_file(file); rename_file(tempFile, file); } } public cmd_amx_stay(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay <nick/steamid>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); new target = FindTarget(arg); if (!target) { client_print(id, print_console, "[AMX Stay] Nie znaleziono gracza o nicku/SteamID: %s", arg); return PLUGIN_HANDLED; } new targetSID[32]; get_user_authid(target, targetSID, charsmax(targetSID)); for (new i = 0; i < g_iBlockedCount; i++) { if (equal(g_szBlockedSIDs[i], targetSID)) { client_print(id, print_console, "[AMX Stay] Gracz z SID %s jest zablokowany.", targetSID); return PLUGIN_HANDLED; } } SaveBlockedSID(targetSID); g_bStayBlocked[target] = true; g_fMaxSpeed[target] = get_user_maxspeed(target); set_user_maxspeed(target, 0.1); new target_name[32]; get_user_name(target, target_name, charsmax(target_name)); new message[64]; formatex(message, charsmax(message), "[AMX Stay] Zatrzymano gracza %s.", target_name); client_print(id, print_console, message); return PLUGIN_HANDLED; } public cmd_amx_stay_remove(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay_remove <SID>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); bool found = false; for (new i = 0; i < g_iBlockedCount; i++) { if (equal(g_szBlockedSIDs[i], arg)) { found = true; break; } } if (!found) { client_print(id, print_console, "[AMX Stay] SID %s nie został znaleziony w blokadzie.", arg); return PLUGIN_HANDLED; } RemoveBlockedSID(arg); client_print(id, print_console, "[AMX Stay] SID %s został usunięty z blokady.", arg); return PLUGIN_HANDLED; } public client_disconnect(id) { g_bStayBlocked[id] = false; g_fMaxSpeed[id] = 0.1; } public client_spawn(id) { if (g_bStayBlocked[id]) { set_user_maxspeed(id, 0.1); } } public on_cmd_start(id, uc_handle, seed) { if (!g_bStayBlocked[id]) { return FMRES_IGNORED; } set_user_maxspeed(id, 0.1); static uc_cmd; uc_cmd = get_uc(uc_handle, UC_Buttons); set_uc(uc_handle, UC_Buttons, uc_cmd & ~(IN_ATTACK | IN_ATTACK2 | IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP | IN_USE)); return FMRES_SUPERCEDE; } FindTarget(szKey[]) { new iTarget = 0; trim(szKey); remove_quotes(szKey); if (szKey[0] == "#") { iTarget = find_player("a", szKey + 1); } else if ((iTarget = find_player("b", szKey))) { return iTarget; } else if ((iTarget = find_player("c", szKey))) { return iTarget; } return iTarget; }
Cześć, Ostatnio myślałem o próbie napisania pluginu który zamraża gracza oraz nie pozwala mu strzelać, co się udało.
Chciałem go rozbudować o zapisywanie SID do pliku TXT i blokowanie każdego gracza z danym SID który jest obecnie na serwerze.
Niestety nie mogę przeprowadzić tego pluginu przez proces kompilacji i nie rozumiem dlaczego, czy możecie mi w tym pomóc?
Załączam plugin który zatrzymuje (podstawke) i w cytacie to co rozbudowałem.
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <fun> #define PLUGIN "AMX Stay" #define VERSION "1.0" #define AUTHOR "mT[1]g" new bool:g_bStayBlocked[33]; new Float:g_fMaxSpeed[33]; new String:g_szBlockedSIDs[100][32]; new g_iBlockedCount = 0; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_concmd("amx_stay", "cmd_amx_stay", ADMIN_BAN, "<nick/steamid> - Zatrzymaj/odblokuj gracza"); register_concmd("amx_stay_remove", "cmd_amx_stay_remove", ADMIN_BAN, "<SID> - Usuń SID z blokady"); RegisterHam(Ham_Spawn, "player", "client_spawn", 1); register_forward(FM_CmdStart, "on_cmd_start", 1); LoadBlockedSIDs(); } LoadBlockedSIDs() { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "r"); if (handle) { while (!feof(handle)) { new line[32]; fgets(line, sizeof(line), handle); if (line[0] != '\0') { trim(line); formatex(g_szBlockedSIDs[g_iBlockedCount], sizeof(g_szBlockedSIDs[g_iBlockedCount]), "%s", line); g_iBlockedCount++; } } fclose(handle); } } SaveBlockedSID(szSID[]) { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "a"); if (handle) { fprintf(handle, "%s^n", szSID); fclose(handle); } } RemoveBlockedSID(szSID[]) { new file[64]; formatex(file, sizeof(file), "blocked_sids.txt"); new handle = fopen(file, "r"); new tempFile[64]; formatex(tempFile, sizeof(tempFile), "temp_blocked_sids.txt"); new tempHandle = fopen(tempFile, "w"); if (handle && tempHandle) { while (!feof(handle)) { new line[32]; fgets(line, sizeof(line), handle); if (line[0] != "\0") { trim(line); if (!equal(line, szSID)) { fprintf(tempHandle, "%s^n", line); } } } fclose(handle); fclose(tempHandle); delete_file(file); rename_file(tempFile, file); } } public cmd_amx_stay(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay <nick/steamid>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); new target = FindTarget(arg); if (!target) { client_print(id, print_console, "[AMX Stay] Nie znaleziono gracza o nicku/SteamID: %s", arg); return PLUGIN_HANDLED; } new targetSID[32]; get_user_authid(target, targetSID, charsmax(targetSID)); for (new i = 0; i < g_iBlockedCount; i++) { if (equal(g_szBlockedSIDs[i], targetSID)) { client_print(id, print_console, "[AMX Stay] Gracz z SID %s jest zablokowany.", targetSID); return PLUGIN_HANDLED; } } SaveBlockedSID(targetSID); g_bStayBlocked[target] = true; g_fMaxSpeed[target] = get_user_maxspeed(target); set_user_maxspeed(target, 0.1); new target_name[32]; get_user_name(target, target_name, charsmax(target_name)); new message[64]; formatex(message, charsmax(message), "[AMX Stay] Zatrzymano gracza %s.", target_name); client_print(id, print_console, message); return PLUGIN_HANDLED; } public cmd_amx_stay_remove(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay_remove <SID>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); bool found = false; for (new i = 0; i < g_iBlockedCount; i++) { if (equal(g_szBlockedSIDs[i], arg)) { found = true; break; } } if (!found) { client_print(id, print_console, "[AMX Stay] SID %s nie został znaleziony w blokadzie.", arg); return PLUGIN_HANDLED; } RemoveBlockedSID(arg); client_print(id, print_console, "[AMX Stay] SID %s został usunięty z blokady.", arg); return PLUGIN_HANDLED; } public client_disconnect(id) { g_bStayBlocked[id] = false; g_fMaxSpeed[id] = 0.1; } public client_spawn(id) { if (g_bStayBlocked[id]) { set_user_maxspeed(id, 0.1); } } public on_cmd_start(id, uc_handle, seed) { if (!g_bStayBlocked[id]) { return FMRES_IGNORED; } set_user_maxspeed(id, 0.1); static uc_cmd; uc_cmd = get_uc(uc_handle, UC_Buttons); set_uc(uc_handle, UC_Buttons, uc_cmd & ~(IN_ATTACK | IN_ATTACK2 | IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP | IN_USE)); return FMRES_SUPERCEDE; } FindTarget(szKey[]) { new iTarget = 0; trim(szKey); remove_quotes(szKey); if (szKey[0] == "#") { iTarget = find_player("a", szKey + 1); } else if ((iTarget = find_player("b", szKey))) { return iTarget; } else if ((iTarget = find_player("c", szKey))) { return iTarget; } return iTarget; }
Załączone pliki
Użytkownik esticire edytował ten post 17.01.2025 23:09
PANDA_2zl
18.01.2025
nie lepiej użyć biblioteki fvault? https://forums.allie...ead.php?t=76453
coś mniej więcej takiego by było, nie testowane
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <fun> #include <fvault> #define PLUGIN "AMX Stay" #define VERSION "1.0" #define AUTHOR "mT[1]g" new bool:g_bStayBlocked[33]; new Float:g_fMaxSpeed[33]; new const g_vault[] = "blocked_sids"; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_concmd("amx_stay", "cmd_amx_stay", ADMIN_BAN, "<nick/steamid> - Zatrzymaj/odblokuj gracza"); register_concmd("amx_stay_remove", "cmd_amx_stay_remove", ADMIN_BAN, "<SID> - Usuń SID z blokady"); RegisterHam(Ham_Spawn, "player", "client_spawn", 1); register_forward(FM_CmdStart, "on_cmd_start", 1); } public cmd_amx_stay(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnieĹ„ do uĹĽycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] UĹĽycie: amx_stay <nick/steamid>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); new target = FindTarget(arg); if (!target) { client_print(id, print_console, "[AMX Stay] Nie znaleziono gracza o nicku/SteamID: %s", arg); return PLUGIN_HANDLED; } if (get_user_flags(target) & ADMIN_BAN) { client_print(id, print_console, "[AMX Stay] Nie moĹĽesz uĹĽyć tej komendy na adminie."); return PLUGIN_HANDLED; } if (g_bStayBlocked[target]) { g_bStayBlocked[target] = false; set_user_maxspeed(target, g_fMaxSpeed[target]); new target_name[32]; get_user_name(target, target_name, charsmax(target_name)); client_print(id, print_console, "[AMX Stay] Odblokowano gracza %s.", target_name); return PLUGIN_HANDLED; } new authid[22]; get_user_authid(target, authid, 21); fvault_set_data(g_vault, authid, "1"); g_bStayBlocked[target] = true; g_fMaxSpeed[target] = get_user_maxspeed(target); set_user_maxspeed(target, 0.1); new target_name[32]; get_user_name(target, target_name, charsmax(target_name)); new message[64]; formatex(message, charsmax(message), "[AMX Stay] Zatrzymano gracza %s.", target_name); client_print(id, print_console, message); return PLUGIN_HANDLED; } public client_authorized(id, const authid[]){ if(fvault_get_keynum(g_vault, authid)!=-1){ g_bStayBlocked[id] = true; g_fMaxSpeed[id] = get_user_maxspeed(id); } } public cmd_amx_stay_remove(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay_remove <SID>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); if (fvault_get_keynum(g_vault, arg)==-1) { client_print(id, print_console, "[AMX Stay] SID %s nie został znaleziony w blokadzie.", arg); return PLUGIN_HANDLED; } fvault_remove_key(g_vault, arg); client_print(id, print_console, "[AMX Stay] SID %s został usunięty z blokady.", arg); return PLUGIN_HANDLED; } public client_disconnect(id) { g_bStayBlocked[id] = false; g_fMaxSpeed[id] = 0.1; } public client_spawn(id) { if (g_bStayBlocked[id]) { set_user_maxspeed(id, 0.1); } } public on_cmd_start(id, uc_handle, seed) { if (!g_bStayBlocked[id]) { return FMRES_IGNORED; } set_user_maxspeed(id, 0.1); static uc_cmd; uc_cmd = get_uc(uc_handle, UC_Buttons); set_uc(uc_handle, UC_Buttons, uc_cmd & ~(IN_ATTACK | IN_ATTACK2 | IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP | IN_USE)); return FMRES_SUPERCEDE; } FindTarget(szKey[]) { new iTarget; trim(szKey); remove_quotes(szKey); if (szKey[0] == '#' && (iTarget = find_player("kh", szKey[1]))) { return iTarget; } if ((iTarget = find_player("bhl", szKey))) { return iTarget; } if ((iTarget = find_player("ch", szKey))) { return iTarget; } return 0; }
esticire
18.01.2025
poszedłem za twoją radą i wystrugałem coś takiego:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <hamsandwich> #include <fun> #include <fvault> #define PLUGIN "AMX Stay" #define VERSION "1.0" #define AUTHOR "mT[1]g" new bool:g_bStayBlocked[33]; new Float:g_fMaxSpeed[33]; new const g_vault[] = "blocked_sids"; new g_blocked_sids[33][22]; new g_blocked_names[33][32]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_concmd("amx_stay", "cmd_amx_stay", ADMIN_BAN, "<nick/steamid> - Zatrzymaj/odblokuj gracza"); register_concmd("amx_stay_remove", "cmd_amx_stay_remove", ADMIN_BAN, "<SID> - Usuń SID z blokady"); register_concmd("amx_stay_list", "cmd_amx_stay_list", ADMIN_BAN, "Wyświetl listę zablokowanych graczy"); RegisterHam(Ham_Spawn, "player", "client_spawn", 1); register_forward(FM_CmdStart, "on_cmd_start", 1); new vault_keynum[512]; new num_keynum = fvault_get_keynum(g_vault, vault_keynum); for (new i = 0; i < num_keynum; i++) { new sid[22], nick[32]; parse(vault_keynum[i], sid, charsmax(sid), nick, charsmax(nick)); for (new player = 1; player <= 32; player++) { if (is_user_connected(player) && equal(sid, get_user_authid(player))) { g_bStayBlocked[player] = true; formatex(g_blocked_sids[player], charsmax(g_blocked_sids[]), "%s", sid); formatex(g_blocked_names[player], charsmax(g_blocked_names[]), "%s", nick); set_user_maxspeed(player, 0.1); } } } } public cmd_amx_stay(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay <nick/steamid>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); new target = FindTarget(arg); if (!target) { client_print(id, print_console, "[AMX Stay] Nie znaleziono gracza o nicku/SteamID: %s", arg); return PLUGIN_HANDLED; } new authid[22], target_name[32]; get_user_authid(target, authid, charsmax(authid)); get_user_name(target, target_name, charsmax(target_name)); fvault_set_data(g_vault, authid, target_name); g_bStayBlocked[target] = true; g_fMaxSpeed[target] = get_user_maxspeed(target); set_user_maxspeed(target, 0.1); formatex(g_blocked_sids[target], charsmax(g_blocked_sids[]), "%s", authid); formatex(g_blocked_names[target], charsmax(g_blocked_names[]), "%s", target_name); client_print(id, print_console, "[AMX Stay] Zatrzymano gracza %s.", target_name); return PLUGIN_HANDLED; } public cmd_amx_stay_list(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } new list_message[1024]; new count = 0; for (new i = 1; i <= 32; i++) { if (g_bStayBlocked[i]) { new line[256]; formatex(line, sizeof(line), "SID: %s - Nick: %s\n", g_blocked_sids[i], g_blocked_names[i]); strcat(list_message, line, charsmax(list_message)); } } if (count == 0) { client_print(id, print_console, "[AMX Stay] Brak zablokowanych graczy."); } else { client_print(id, print_console, "[AMX Stay] Lista zablokowanych graczy:\n%s", list_message); } return PLUGIN_HANDLED; } public cmd_amx_stay_remove(id, level, cid) { if (!(get_user_flags(id) & ADMIN_BAN)) { client_print(id, print_console, "[AMX Stay] Nie masz uprawnień do użycia tej komendy."); return PLUGIN_HANDLED; } if (read_argc() < 2) { client_print(id, print_console, "[AMX Stay] Użycie: amx_stay_remove <SID>"); return PLUGIN_HANDLED; } new arg[32]; read_argv(1, arg, charsmax(arg)); if (fvault_get_keynum(g_vault, arg) == -1) { client_print(id, print_console, "[AMX Stay] SID %s nie został znaleziony w blokadzie.", arg); return PLUGIN_HANDLED; } fvault_remove_key(g_vault, arg); client_print(id, print_console, "[AMX Stay] SID %s został usunięty z blokady.", arg); new target = FindTarget(arg); if (target) { g_bStayBlocked[target] = false; set_user_maxspeed(target, g_fMaxSpeed[target]); new target_name[32]; get_user_name(target, target_name, charsmax(target_name)); client_print(id, print_console, "[AMX Stay] Gracz %s może teraz się poruszać.", target_name); } return PLUGIN_HANDLED; } public client_disconnect(id) { g_bStayBlocked[id] = false; g_fMaxSpeed[id] = 0.1; } public client_spawn(id) { if (g_bStayBlocked[id]) { set_user_maxspeed(id, 0.1); } } public on_cmd_start(id, uc_handle) { if (!g_bStayBlocked[id]) { return FMRES_IGNORED; } set_user_maxspeed(id, 0.1); static uc_cmd; uc_cmd = get_uc(uc_handle, UC_Buttons); set_uc(uc_handle, UC_Buttons, uc_cmd & ~(IN_ATTACK | IN_ATTACK2 | IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP | IN_USE)); return FMRES_SUPERCEDE; } FindTarget(szKey[]) { new iTarget; trim(szKey); remove_quotes(szKey); if (szKey[0] == '#' && (iTarget = find_player("kh", szKey[1]))) { return iTarget; } if ((iTarget = find_player("bhl", szKey))) { return iTarget; } if ((iTarget = find_player("ch", szKey))) { return iTarget; } return 0; }
Niestety nie chce się to kompilować i nie do końca rozumiem dlaczego.. na pewno będę chciał jeszcze dodać funkcję logowania oprócz tego do jakiegoś pliku .log aczkolwiek borykam się jeszcze z kompilacją tego...
Jakby ktoś wytłumaczył i pomógł ewentualnie tutaj to byłbym wdzięczny
PANDA_2zl
18.01.2025
new vault_keynum[512]; new num_keynum = fvault_get_keynum(g_vault, vault_keynum);
nie zrozumiałeś dokumentacji,
/** * Retrieves a key number specified by its name * * @param vaultname Vault name to look in * @param key Key name to search for * @return Returns key number on success, -1 on failure */ fvault_get_keynum(const vaultname[], const key[])
gdzie key[] to w naszym przypadku sid gracza i zwraca pozycje tego wpisu w pliku, do pobierania całkowitej ilości wpisów używasz
fvault_size(const vaultname[])
patrząc na kod nie rozumiem po co chcesz zapisywać wszystkich do pamięci podręcznej, skoro sprawdzanie gracza w zapisie w trakcie wchodzenia nie wpływa zupełnie na wydajność
g_bStayBlocked[player] = true; formatex(g_blocked_sids[player], charsmax(g_blocked_sids[]), "%s", sid); formatex(g_blocked_names[player], charsmax(g_blocked_names[]), "%s", nick);
zresetować te wartości przy wychodzeniu i sprawdzać, ustawiać na wchodzeniu client_putinserver albo client_authorized
w twoim kodzie: na rozpoczęciu mapy (nawet przy zmianie mapy może nikogo wtedy nie być na serwerze, bo się z nim łączą dopiero), chcesz odczytać wszystkie wpisy z zapisu, sprawdzasz czy są gracze którzy tam widnieją, zupełnie bez sensu, masz odpowiednie eventy do takiego sprawdzania, przykłady tego co chciałeś zrobić jak byk widnieją na stronie biblioteki fvault, wystarczy poczytać
// How to find all keys within a vault: new const vaultname[] = "myvault"; new total = fvault_size(vaultname); new key[32], data[64]; for( new i = 0; i < total; i++ ) { fvault_get_keyname(vaultname, i, key, sizeof(key) - 1); fvault_get_data(vaultname, key, data, sizeof(data) - 1); server_print("Key: %s | Data: %s", key, data); } // More efficient method to find all keys within a vault: new const vaultname[] = "myvault"; new Array:keys = ArrayCreate(64); new Array:datas = ArrayCreate(512); new total = fvault_load(vaultname, keys, datas); new key[64], data[512]; for( new i = 0; i < total; i++ ) { ArrayGetString(keys, i, key, 31); ArrayGetString(datas, i, data, 511); server_print("Key: %s | Data: %s", key, data); }
mam nadzieje że wytłumaczyłem
DarkGL
19.01.2025
Wiadomość wygenerowana automatycznie
Ten temat został zamknięty przez moderatora.
Powód: Temat zamknięty na prośbę użytkownika.
Z pozdrowieniami,
Zespół AMXX.PL