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

[CSGO] Tactical grenades training


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cubuspl42
New Member
Join Date: Dec 2012
Old 12-20-2012 , 16:13   [CSGO] Tactical grenades training
Reply With Quote #1

In CoD4 there was a mod which allowed to practice tactical grenades. It would be cool if it existed in CS:GO.
The idea is simple. You have infinite number of grenades. After you throw it, the camera follows it and you can see the result immediately.

Does a mod like this exist? Would it be possible to implement it in Sourcemod? If so, I'll start learning the api and stuff and write a plugin like this

Last edited by cubuspl42; 12-20-2012 at 16:14.
cubuspl42 is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 12-21-2012 , 01:09   Re: [CSGO] Tactical grenades training
Reply With Quote #2

EDIT: Functional plugin is available HERE.

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

#pragma semicolon 1;

#define PLUGIN_VERSION "0.5"

public Plugin:myinfo = 
{
	name = "Grenade View",
	author = "Sheepdude",
	description = "",
	version = PLUGIN_VERSION,
	url = "http://www.clan-psycho.com"
};

new bool:ClientView[MAXPLAYERS+1];

public OnPluginStart()
{
	HookEvent("hegrenade_detonate", OnDetonate);
}

public OnEntityCreated(iEntity, const String:classname[]) 
{
	if(StrEqual(classname, "hegrenade_projectile"))
		SDKHook(iEntity, SDKHook_SpawnPost, OnEntitySpawned);
}

public OnEntitySpawned(iGrenade)
{
	new client = GetEntPropEnt(iGrenade, Prop_Send, "m_hOwnerEntity");
	if(!ClientView[client] && IsClientInGame(client))
	{
		SetClientViewEntity(client, iGrenade);
		ClientView[client] = true;
	}
}

public OnDetonate(Handle:event, const String:name[], bool:dontBroadcast)
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	if(ClientView[client])
	{
		ClientView[client] = false;
		if(IsClientInGame(client))
			SetClientViewEntity(client, client);
	}
}
I don't know how to stop the grenade rotation, however. If someone has some ideas about that I'd love to know.
Attached Files
File Type: sp Get Plugin or Get Source (grenade_view.sp - 696 views - 1.1 KB)
File Type: smx grenade_view.smx (2.7 KB, 413 views)
__________________

Last edited by Sheepdude; 01-02-2013 at 15:50.
Sheepdude 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 04:19.


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