Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Kaiser - zdjęcie

Kaiser

Rejestracja: 26.05.2020
Aktualnie: Nieaktywny
Poza forum Ostatnio: 24.06.2020 21:49
-----

Moje tematy

Problem z pluginem na test vipa

16.06.2020 18:41

Witam

Problem polega na tym że gdy np admin na serwerze wpisze !freevip to nie może wtedy używać uprawnień administracyjnych.

Tak jakby to blokowało.

Czy jest jakiś sposób aby admin nie tracił swoich uprawnień po wpisaniu komendy?

#include <sourcemod>
#include <clientprefs>
#include <colors_csgo>


Handle g_hClientCookie;

public void OnPluginStart() {
	RegConsoleCmd("sm_freevip", cmd_viptest);
	
	g_hClientCookie = RegClientCookie("csgo_freevip3", "Test Vip", CookieAccess_Private);
}

public Action cmd_viptest(int iClient, int iArgs) {
	char sBuffer[64];
	GetClientCookie(iClient, g_hClientCookie, sBuffer, sizeof(sBuffer));
	
	int iTimeClient = StringToInt(sBuffer);
	
	if (iTimeClient == -1) {
		CPrintToChat(iClient, "{orchid}★{lightred}Nie możesz użyć tej komendy, ponieważ wykorzystałeś już {darkred}Free VIPa{lightred}!{orchid}★");
	} else {
		if (iTimeClient < GetTime()) {
			int iVipTime = 604800; // 7 days
			Format(sBuffer, sizeof(sBuffer), "%i", (GetTime() + iVipTime));
			
			SetClientCookie(iClient, g_hClientCookie, sBuffer);
			
			AddUserFlags(iClient, Admin_Custom1, Admin_Custom2, Admin_Custom3, Admin_Custom4, Admin_Custom5, Admin_Custom6);
			
			CPrintToChat(iClient, "{gold}╔═══════════ FreeVip ═══════════╗");
			CPrintToChat(iClient, "{orchid}★★★{gold}VIP {green}zostal aktywowany na 7 dni!{orchid}★★★");
			CPrintToChat(iClient, "{gold}╚═══════════ FreeVip ═══════════╝");
		} else {
			CPrintToChat(iClient, "{orchid}★{darkred}Free VIP {lightred}został już aktywowany!{orchid}★");
		}
	}
}

public void OnClientCookiesCached(int iClient) {
	char sBuffer[64];
	GetClientCookie(iClient, g_hClientCookie, sBuffer, sizeof(sBuffer));
	
	int iTimeClient = StringToInt(sBuffer);
	
	if (iTimeClient > 0) {
		if (iTimeClient < GetTime()) {
			SetClientCookie(iClient, g_hClientCookie, "-1");
		} else {
			AddUserFlags(iClient, Admin_Custom1, Admin_Custom2, Admin_Custom3, Admin_Custom4, Admin_Custom5, Admin_Custom6);
		}
	}
}

admins.cfg

26.05.2020 19:51

Cześć,

Mam problem z plikiem admins.cfg

Za każdym razem gdy usunę administratorów z tego pliku, lub usunę ten plik, po zmianie mapy wszystko wraca do stanu wcześniejszego :/

Czy ktoś miał taki problem, bardzo proszę o pomoc.