Jump to content

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

Posted Image Posted Image

Guest Message by DevFuse
 

Photo
CS:GO

Problem z pluginem na test vipaAdministrator traci uprawnienia na serwerze po użyciu komendy na test vipa

cs:go plugin sourcemod vip

  • You cannot start a new topic
  • Please log in to reply
No replies to this topic

#1 Kaiser

    Nowy

  • Nowy

Reputacja: 0
Nowy

  • Postów:2
  • Imię:Dominik
Offline

Posted 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);
		}
	}
}

  • +
  • -
  • 0





Also tagged with one or more of these keywords: cs:go, plugin, sourcemod, vip

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users