Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

Brak przywilejów


Gość
 Udostępnij

Rekomendowane odpowiedzi

Witam

Postanowiłem pójść na łatwiznę i wygenerować sobie vipa, wszystko ładnie pięknie lecz po wrzuceniu nic się nie dzieje, plugin nie dodaje przywilejów itp.

Od razu uprzedzę nie posiadam żadnych error logów, oraz plugin prawidłowo pokazuje pod komendą sm plugins

 

#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo =
{
	name = "[CS:GO] VIP",
	author = "xBonio & Avgariat & Vasto_Lorde",
	description = "VIP Generator by cs-plugin.com",
	version = "1.0",
	url = "http://cs-plugin.com"
};

char tag[64] = "";

int offsetHe;
int offsetFlash;
int offsetSmoke;
int offsetInc;
int offsetMol;
public void OnPluginStart()
{
	HookEvent("bomb_planted", EventBombPlanted);
	HookEvent("bomb_defused", EventBombDefused);
	HookEvent("player_spawn", PlayerSpawn);
	HookEvent("player_death", PlayerDeath);
}
public void OnMapStart()
{
	int entindex;

	entindex = CreateEntityByName("weapon_hegrenade");
	DispatchSpawn(entindex);
	offsetHe = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
	AcceptEntityInput(entindex, "Kill");

	entindex = CreateEntityByName("weapon_flashbang");
	DispatchSpawn(entindex);
	offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
	AcceptEntityInput(entindex, "Kill");

	entindex = CreateEntityByName("weapon_smokegrenade");
	DispatchSpawn(entindex);
	offsetSmoke = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
	AcceptEntityInput(entindex, "Kill");

	entindex = CreateEntityByName("weapon_incgrenade");
	DispatchSpawn(entindex);
	offsetInc = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
	AcceptEntityInput(entindex, "Kill");
	
	entindex = CreateEntityByName("weapon_molotov");
	DispatchSpawn(entindex);
	offsetMol = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
	AcceptEntityInput(entindex, "Kill");

}

public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(!IsPlayerVIP(client)) return;
	if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0)
		SetEntProp(client, Prop_Send, "m_ArmorValue", 100);
	if(GetTeamScore(CS_TEAM_CT) + GetTeamScore(CS_TEAM_T) != 0)
		SetEntProp(client, Prop_Send, "m_bHasHelmet", 1);
	int money = GetEntProp(client, Prop_Send, "m_iAccount");
	SetEntProp(client, Prop_Send, "m_iAccount", money+200);
	if(GetClientTeam(client) == CS_TEAM_CT)
		if(GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0) GivePlayerItem(client, "item_defuser");
	for(int x = 0; x < 1; x++)
		if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHe) < 1) GivePlayerItem(client, "weapon_hegrenade");
	for(int x = 0; x < 1; x++)
		if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash) < 1) GivePlayerItem(client, "weapon_flashbang");
	for(int x = 0; x < 1; x++)
		if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetSmoke) < 1) GivePlayerItem(client, "weapon_smokegrenade");
	if(GetClientTeam(client) == CS_TEAM_CT)
	{
		for(int x = 0; x < 1; x++)											// ilosc inc 
			if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc) < 1) GivePlayerItem(client, "weapon_incgrenade");
	}
	else if(GetClientTeam(client) == CS_TEAM_T)
	{
		for(int x = 0; x < 1; x++)
			if(GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol) < 1) GivePlayerItem(client, "weapon_molotov");
	}
}
public Action PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
{
	int attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	if(!IsValidPlayer(attacker) || !IsPlayerVIP(attacker)) return;
	int health = GetClientHealth(attacker);
	SetEntityHealth(attacker, health+5);
	int money = GetEntProp(attacker, Prop_Send, "m_iAccount");
	SetEntProp(attacker, Prop_Send, "m_iAccount", money+100);
	bool headshot = GetEventBool(event, "headshot", false);
	if(headshot)
	{
		health = GetClientHealth(attacker);
		SetEntityHealth(attacker, health+10);
		money = GetEntProp(attacker, Prop_Send, "m_iAccount");
		SetEntProp(attacker, Prop_Send, "m_iAccount", money+150);
	}
	if(GetClientHealth(attacker) > 100)
				SetEntityHealth(attacker, 100);
}

public Action EventBombPlanted(Event event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	int money = GetEntProp(client, Prop_Send, "m_iAccount");
	if(IsPlayerVIP(client))
		SetEntProp(client, Prop_Send, "m_iAccount", money+150);
}
public Action EventBombDefused(Event event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	int money = GetEntProp(client, Prop_Send, "m_iAccount");
	if(IsPlayerVIP(client))
		SetEntProp(client, Prop_Send, "m_iAccount", money+150);
}

public void OnClientPostAdminCheck(int client)
{
	if(IsPlayerVIP(client))
	{
			
		PrintToChatAll(" %s \x03%N\x01 \x01", tag, client);
	}
}

stock bool IsValidPlayer(int client)
{
	if(client >= 1 && client <= MaxClients && IsClientInGame(client) && !IsFakeClient(client) && !IsClientSourceTV(client))
		return true;
	return false;
}
stock bool IsPlayerVIP(int client)
{
	if(GetUserFlagBits(client) & ADMFLAG_CUSTOM6 && !(GetUserFlagBits(client) & ADMFLAG_ROOT))
		return true;
	return false;
}

 

Edytowane przez Gość
Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...