Raised This Month: $51 Target: $400
 12% 

[REQ&CSGO] Edit JB Warden plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 02-18-2017 , 17:23   [REQ&CSGO] Edit JB Warden plugin
Reply With Quote #1

Hey everyone. can someone edit that plugin? When a warden chosen warden become blue and also I want a .vtf file upper him like that ;
Spoiler


file dir ;
Code:
materials/sprites/warden_icon.vtf
materials/sprites/warden_icon.vmt
Note : I couldn't create .vtf and .vmt files because VTFEdit software doesn't worked if I can fix it i'll attach here these files.

Original plugin author : ecca

Thank you!
Attached Files
File Type: zip Warden.zip (12.1 KB, 131 views)
__________________

Last edited by spancer35; 02-18-2017 at 17:26.
spancer35 is offline
BombaciMulayim
Junior Member
Join Date: Jan 2017
Old 02-20-2017 , 10:11   Re: [REQ&CSGO] Edit JB Warden plugin
Reply With Quote #2

Code:
 #pragma semicolon 1

#define PLUGIN_VERSION "1.0"

#include <sourcemod>
#include <sdktools>
#include <multicolors>
#include <warden>

#define SPRITE_PATH_VMT "materials/sprites/bombaci/warden.vmt"
#define SPRITE_PATH_VTF "materials/sprites/bombaci/warden.vtf"

#define SPRITE_SCALE		"0.7"
#define SPRITE_HEIGHT		90.0
#define SPRITE_DUCK_DIFF	20.0

int g_iSpriteEntRef[MAXPLAYERS+1] = {INVALID_ENT_REFERENCE,...};

public Plugin myinfo = 
{
	name = "",
	author = "",
	description = "",
	version = "",
	url = ""
};


public void OnPluginStart()
{
	HookEvent("player_death", Event_PlayerDeath);
}

public void OnMapStart()
{
	AddFileToDownloadsTable(SPRITE_PATH_VMT);
	AddFileToDownloadsTable(SPRITE_PATH_VTF);
	PrecacheModel(SPRITE_PATH_VMT, true);
	
	CreateTimer(0.1, Timer_Update, _, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}

public void OnClientConnected(int client)
{
	g_iSpriteEntRef[client] = INVALID_ENT_REFERENCE;
}

public void OnClientDisconnect(int client)
{
	ResetSprite(client);
}

public void warden_OnWardenCreated(int client)
{
	CreateSprite(client);
}

public void warden_OnWardenRemoved(int client)
{
	ResetSprite(client);
}

public Action Event_PlayerDeath(Handle event, const char[] name, bool dontBroadcast)
{
	int client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(!client || !IsClientInGame(client))
		return Plugin_Continue;

	ResetSprite(client);

	return Plugin_Continue;
}

public void ResetSprite(int client)
{
	if(g_iSpriteEntRef[client] == INVALID_ENT_REFERENCE)
		return;

	int m_unEnt = EntRefToEntIndex(g_iSpriteEntRef[client]);
	g_iSpriteEntRef[client] = INVALID_ENT_REFERENCE;
	if(m_unEnt == INVALID_ENT_REFERENCE)
		return;

	AcceptEntityInput(m_unEnt, "Kill");
}

public void CreateSprite(int client)
{
	if(g_iSpriteEntRef[client] != INVALID_ENT_REFERENCE)
		ResetSprite(client);
	
	int sprite = CreateEntityByName("env_sprite_oriented");
	
	if(sprite != -1)
	{
		DispatchKeyValue(sprite, "classname", "env_sprite_oriented");
		DispatchKeyValue(sprite, "spawnflags", "1");
		DispatchKeyValue(sprite, "scale", SPRITE_SCALE);
		DispatchKeyValue(sprite, "rendermode", "1");
		DispatchKeyValue(sprite, "rendercolor", "255 255 255");
		DispatchKeyValue(sprite, "model", SPRITE_PATH_VMT);
		DispatchSpawn(sprite);
		
		float fPos[3];
		GetClientAbsOrigin(client, fPos);
		
		fPos[2] += SPRITE_HEIGHT;
		
		if(GetClientButtons(client) & IN_DUCK)
			fPos[2] -= SPRITE_DUCK_DIFF;

		TeleportEntity(sprite, fPos, NULL_VECTOR, NULL_VECTOR);
		
		SetVariantString("!activator");
		AcceptEntityInput(sprite, "SetParent", client);
	}
	
	g_iSpriteEntRef[client] = EntIndexToEntRef(sprite);
}

public Action Timer_Update(Handle timer, any data)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if(!IsClientInGame(i))
			continue;
			
		if(!IsPlayerAlive(i))
			continue;
			
		if(IsFakeClient(i))
			continue;
			
		if(!warden_iswarden(i))
			continue;
			
		CreateSprite(i);
	}
	
	return Plugin_Continue;
}
Working .#Zipcore
BombaciMulayim is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-20-2017 , 11:31   Re: [REQ&CSGO] Edit JB Warden plugin
Reply With Quote #3

Maybe take a look at MyJailbreaks Warden. You can use MyJBs warden without the other plugins of MyJB.
It has more than you asked, but maybe you like it.

You can also use MyJailbreaks icons (.vmt) with zipcores code.
Spoiler
__________________
coding & free software

Last edited by shanapu; 02-20-2017 at 11:32.
shanapu is offline
spancer35
Senior Member
Join Date: Dec 2014
Location: City 17
Old 02-20-2017 , 14:14   Re: [REQ&CSGO] Edit JB Warden plugin
Reply With Quote #4

Thanks a lot guys!
__________________
spancer35 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 10:26.


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