Raised This Month: $32 Target: $400
 8% 

Change VIP plugin for all players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dominik Rozporka
New Member
Join Date: Dec 2013
Old 06-14-2019 , 12:32   Change VIP plugin for all players
Reply With Quote #1

Hello, please help me please edit access and features on access and features for all players of this plugin and send me code please.

Code:
//------------------------------------------------------------------------------
// GPL LISENCE (short)
//------------------------------------------------------------------------------
/*
* Copyright (c) 2016 R1KO

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <vip_core>

public Plugin:myinfo =
{
	name = "[VIP] Kill Screen",
	author = "R1KO (skype: vova.andrienko1)",
	version = "1.0.2"
};

new const String:g_sFeature[] = "KillScreen";

public VIP_OnVIPLoaded()
{
	VIP_RegisterFeature(g_sFeature, BOOL);
}

public OnPluginEnd()
{
	VIP_UnregisterFeature(g_sFeature);
}

new g_iDuration;
new g_iColor[4];
new bool:g_bHSOnly;

public OnPluginStart()
{
	new Handle:hCvar = CreateConVar("vip_kill_screen_duration", "0.6", "Длительность эффекта (сек.)");
	HookConVarChange(hCvar, OnDurationChange);
	g_iDuration = RoundToCeil(GetConVarFloat(hCvar)*1000.0);
	
	hCvar = CreateConVar("vip_kill_screen_color", "0 0 200 100", "Цвет эффекта");
	HookConVarChange(hCvar, OnColorChange);
	GetConVarColor(hCvar, g_iColor);
	
	hCvar = CreateConVar("vip_kill_screen_hs_only", "0", "Отображать эффект только при убийстве в голову");
	HookConVarChange(hCvar, OnHSOnlyChange);
	g_bHSOnly = GetConVarBool(hCvar);
	
	HookEvent("player_death", Event_PlayerDeath);
	
	AutoExecConfig(true, "VIP_KillScreen", "vip");
}

public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max)
{
	MarkNativeAsOptional("BfWriteByte");
	MarkNativeAsOptional("BfWriteShort");

	MarkNativeAsOptional("PbSetInt");
	MarkNativeAsOptional("PbSetColor");

	return APLRes_Success;
}

public OnDurationChange(Handle:hCvar, const String:sOldVal[], const String:sNewVal[])	g_iDuration = RoundToCeil(GetConVarFloat(hCvar)*1000.0);
public OnColorChange(Handle:hCvar, const String:sOldVal[], const String:sNewVal[])		GetConVarColor(hCvar, g_iColor);
public OnHSOnlyChange(Handle:hCvar, const String:sOldVal[], const String:sNewVal[])	g_bHSOnly = GetConVarBool(hCvar);

GetConVarColor(Handle:hCvar, iColor[4])
{
	decl String:sBuffer[16], String:sParts[4][4], i;
	GetConVarString(hCvar, sBuffer, sizeof(sBuffer));
	ExplodeString(sBuffer, " ", sParts, sizeof(sParts), sizeof(sParts[]));
	for(i = 0; i < 4; ++i)
	{
		StringToIntEx(sParts[i], iColor[i]);
	}
}

public Event_PlayerDeath(Handle:hEvent, const String:sEvName[], bool:bDontBroadcast)  
{
	if(g_bHSOnly && !GetEventBool(hEvent, "headshot"))
	{
		return;
	}

	new iClient = GetClientOfUserId(GetEventInt(hEvent, "attacker"));
	if(iClient && VIP_IsClientVIP(iClient) && VIP_IsClientFeatureUse(iClient, g_sFeature))
	{
		decl iClients[1], Handle:hMessage;
		iClients[0] = iClient;
		hMessage = StartMessage("Fade", iClients, 1); 
		if(GetUserMessageType() == UM_Protobuf) 
		{
			PbSetInt(hMessage, "duration", g_iDuration);
			PbSetInt(hMessage, "hold_time", 0);
			PbSetInt(hMessage, "flags", 0x0001);
			PbSetColor(hMessage, "clr", g_iColor);
		}
		else
		{
			BfWriteShort(hMessage, g_iDuration);
			BfWriteShort(hMessage, 0);
			BfWriteShort(hMessage, (0x0001));
			BfWriteByte(hMessage, g_iColor[0]);
			BfWriteByte(hMessage, g_iColor[1]);
			BfWriteByte(hMessage, g_iColor[2]);
			BfWriteByte(hMessage, g_iColor[3]);
		}
		EndMessage(); 
	}
}
Dominik Rozporka is offline
CliptonHeist
Senior Member
Join Date: Feb 2016
Old 06-14-2019 , 15:48   Re: Change VIP plugin for all players
Reply With Quote #2

Need vip_core to be able to do anything
CliptonHeist is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 06-14-2019 , 17:15   Re: Change VIP plugin for all players
Reply With Quote #3

simple code

CS:S
PHP Code:

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public void OnPluginStart() {
    
HookEvent("player_death"PlayerDeath);
}


public 
Action PlayerDeath(Event event, const char[] namebool dontBroadcast) {
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
    if(!
IsValidClient(attacker))
        return;
        
    
FadeEffect(attacker600, {00200100});
}

void FadeEffect(int clientint fadeduration, const fadecolor[4]) {
    
Handle cMessageFade StartMessageOne("Fade"client);
    
BfWriteShort(cMessageFadefadeduration);
    
BfWriteShort(cMessageFade0);
    
BfWriteShort(cMessageFade, (0x0001));
    
BfWriteByte(cMessageFadefadecolor[0]);
    
BfWriteByte(cMessageFadefadecolor[1]);
    
BfWriteByte(cMessageFadefadecolor[2]);
    
BfWriteByte(cMessageFadefadecolor[3]);
    
EndMessage();
}

stock bool IsValidClient(int client) {
    if (
client <= 0) return false;
    if (
client MaxClients) return false;
    if (!
IsClientConnected(client)) return false;
    return 
IsClientInGame(client);

CS:GO
PHP Code:

#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#pragma newdecls required

public void OnPluginStart() {
    
HookEvent("player_death"PlayerDeath);
}


public 
Action PlayerDeath(Event event, const char[] namebool dontBroadcast) {
    
int attacker GetClientOfUserId(GetEventInt(event"attacker"));
    
    if(!
IsValidClient(attacker))
        return;
        
    
FadeEffect(attacker600, {00200100});
}

void FadeEffect(int clientint fadeduration, const fadecolor[4]) {
    
Handle cMessageFade StartMessageOne("Fade"client);
    
PbSetInt(cMessageFade"duration"fadeduration);
    
PbSetInt(cMessageFade"hold_time"0);
    
PbSetInt(cMessageFade"flags"0x0001);
    
PbSetColor(cMessageFade"clr"fadecolor);
    
EndMessage();
}

stock bool IsValidClient(int client) {
    if (
client <= 0) return false;
    if (
client MaxClients) return false;
    if (!
IsClientConnected(client)) return false;
    return 
IsClientInGame(client);

farawayf is offline
Dominik Rozporka
New Member
Join Date: Dec 2013
Old 06-14-2019 , 18:29   Re: Change VIP plugin for all players
Reply With Quote #4

Thanks I will testing it today maybe after afternoon.
I hope it will be working.
Dominik Rozporka is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode