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

Problem with CS:GO VIP plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakusiowaty
New Member
Join Date: Dec 2017
Old 12-12-2017 , 09:04   Problem with CS:GO VIP plugin
Reply With Quote #1

Hello, I`ve some problems with my VIP plugin from generator... I set 200$ extra for VIP every round but it`s not working, VIPs are earning extra money just only at warmup starts :/ Any ideas? Below I`m sending plugin code



Code:
#include <sourcemod>
#include <cstrike>
#include <sdktools>

#pragma semicolon 1
#pragma newdecls required

Handle WelcomeHUD;
char tag[64] = "[VIP]";

public void OnPluginStart()
{
	HookEvent("bomb_planted", EventBombPlanted);
	HookEvent("bomb_defused", EventBombDefused);
	HookEvent("player_spawn", PlayerSpawn);
	HookEvent("player_death", PlayerDeath);
	WelcomeHUD = CreateHudSynchronizer();
}
public Action PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(!IsPlayerVIP(client)) return;
	SetEntProp(client, Prop_Send, "m_ArmorValue", 100);
	SetEntityHealth(client, 110);
	int money = GetEntProp(client, Prop_Send, "m_iAccount");
	SetEntProp(client, Prop_Send, "m_iAccount", money+200);
	CS_SetClientClanTag(client, tag);
	if(GetClientTeam(client) == CS_TEAM_CT)
		if(GetEntProp(client, Prop_Send, "m_bHasDefuser") == 0) GivePlayerItem(client, "item_defuser");
}
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+1);
	int money = GetEntProp(attacker, Prop_Send, "m_iAccount");
	SetEntProp(attacker, Prop_Send, "m_iAccount", money+50);
	bool headshot = GetEventBool(event, "headshot", false);
	if(headshot)
	{
		health = GetClientHealth(attacker);
		SetEntityHealth(attacker, health+5);
		money = GetEntProp(attacker, Prop_Send, "m_iAccount");
		SetEntProp(attacker, Prop_Send, "m_iAccount", money+100);
	}
	if(GetClientHealth(attacker) > 125)
		SetEntityHealth(attacker, 125);
}

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+50);
}
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+50);
}

public void OnClientPostAdminCheck(int client)
{
	if(IsPlayerVIP(client))
	{
		char text[100];
		Format(text, sizeof(text), "%s %N \n", tag, client);
		Format(text, sizeof(text), "%s wbija na serwer!", text);
		
		SetHudTextParams(-1.0, 0.125, 7.0, 45, 209, 0, 255, 0, 0.25, 1.5, 0.5);
		for(int i = 1; i <= MaxClients; i++)
			if(IsValidPlayer(i))
				ShowSyncHudText(i, WelcomeHUD, text);
			
		PrintToChatAll(" %s \x03%N\x01 wbija na serwer!\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_CUSTOM5)
		return true;
	return false;
}
bakusiowaty is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-12-2017 , 10:19   Re: Problem with CS:GO VIP plugin
Reply With Quote #2

use this

mp_backup_round_file ""
mp_backup_round_file_last ""
mp_backup_round_file_pattern ""
mp_backup_round_auto "0"
__________________
8guawong is offline
bakusiovskyyyy
Junior Member
Join Date: Nov 2017
Location: Poland
Old 12-12-2017 , 14:10   Re: Problem with CS:GO VIP plugin
Reply With Quote #3

All values should be 0?

EDIT: Nevermind, it`s good Thank you for help!

Last edited by bakusiovskyyyy; 12-12-2017 at 14:30.
bakusiovskyyyy is offline
Reply


Thread Tools
Display Modes

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:03.


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