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

Problem z vipem


GameUniverse
 Udostępnij

Rekomendowane odpowiedzi

Witam, otóż wygenerowałem sobie vipa na sklepcs.pl i niby bez problemu wrzuciłem, zero errorów, ale nie działa na serwerze. Wie ktoś może w czym tkwi problem?


Poniżej przedstawię kod vipa:
 

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
public Plugin myinfo = {
	name = "VIP Generator",
	author = "Adi - live4net",
	description = "Automatycznie wygenerowany VIP na stronie sklepcs.pl",
	version = "1.02",
	url = "http://sklepcs.pl"
}
int offsetHe, offsetSmoke, offsetFlash, offsetDecoy, offsetHealth, offsetInc, offsetMol, offsetTa;

public void OnPluginStart() {
	HookEvent("player_spawn", Event_PlayerSpawn);
}
public void OnMapStart() {
	int entindex = CreateEntityByName("weapon_hegrenade");
        DispatchSpawn(entindex);
        offsetHe = 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_flashbang");
        DispatchSpawn(entindex);
        offsetFlash = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
        AcceptEntityInput(entindex, "Kill");
        entindex = CreateEntityByName("weapon_decoy");
        DispatchSpawn(entindex);
        offsetDecoy = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
        AcceptEntityInput(entindex, "Kill");
        entindex = CreateEntityByName("weapon_healthshot");
        DispatchSpawn(entindex);
        offsetHealth = 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");
        entindex = CreateEntityByName("weapon_tagrenade");
        DispatchSpawn(entindex);
        offsetTa = GetEntProp(entindex, Prop_Send, "m_iPrimaryAmmoType");
        AcceptEntityInput(entindex, "Kill");

}
public Action Event_PlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if (IsValidPlayer(client) && IsPlayerVip(client)) {
		if ((GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT)) > 0) SetEntProp(client ,Prop_Send,"m_ArmorValue",100,1);
		if ((GetTeamScore(CS_TEAM_T) + GetTeamScore(CS_TEAM_CT)) > 0) SetEntProp(client , Prop_Send, "m_bHasHelmet", 1);
		if (PlayerGrenade(client, 3) < 1) GivePlayerItem(client, "weapon_flashbang");
		if (PlayerGrenade(client, 7) < 1) GivePlayerItem(client, "weapon_tagrenade");
	}
}
stock bool IsValidPlayer(int client) {
	if(client >= 1 && client <= MaxClients && IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) )
	return true;
	return false;
}
stock int PlayerGrenade(int client, int granat)
{
    if (granat == 1) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHe);
    else if (granat == 2) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetSmoke);
    else if (granat == 3) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetFlash);
    else if (granat == 4) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetDecoy);
    else if (granat == 5) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetHealth);
    else if (granat == 6) {
        if (GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc) > GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol)) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetInc);
        else return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetMol);
    }
    else if (granat == 7) return GetEntProp(client, Prop_Send, "m_iAmmo", _, offsetTa);
    return 0;
}stock bool IsPlayerVip(int client) {
    if (CheckCommandAccess(client, "check_vip", ADMFLAG_CUSTOM1, false)) return true;
    return false;
}

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 2 lata później...
Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

×
×
  • Dodaj nową pozycję...