View Single Post
VJScope
Senior Member
Join Date: Jul 2012
Location: Finland
Old 08-01-2015 , 07:13   Re: [CSGO] Free taser
Reply With Quote #2

Hello!

I didn't think that I would publish this plugin because my coding skills are not that great. But here is a taser related plugin that you can use freely. The idea is that you will get another taser if you kill a player but if you miss or just wound him, you won't get another taser.

Some issues (I might fix them myself soon):
- If you kill your teammate with a taser, you will get another one.
- For some reason you will lose your taser at the beginning of the next round unless you haven't fired it at all.

Some suggestions:
- How about players getting tasers directly to their hand after a kill? Right now it takes pistol or other gun so you have to either throw away all guns or switch really fast.


Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>
#include <colors>
#include <updater>

#define		MAX_WEAPON_STRING		80

new Handle:ClientTimer[MAXPLAYERS+1] = {INVALID_HANDLE, ...};

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

public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new killer = GetClientOfUserId(GetEventInt(event, "attacker"));
	
	decl String:weapon[MAX_WEAPON_STRING];
	weapon[0] = '\0';
	
	GetEventString(event, "weapon", weapon, sizeof(weapon));
	
	if (StrEqual(weapon, "taser", false) || StrEqual(weapon, "knife", false))
	{
		ClientTimer[killer] = CreateTimer(0.5, Timer_GiveZeus, killer);
	}
}

public Action:Timer_GiveZeus(Handle:timer, any:client)
{
	ClientTimer[client] = INVALID_HANDLE;
	
	GivePlayerItem(client, "weapon_taser");
}
__________________
Strange women lying in ponds distributing swords is no basis for a system of government. Supreme executive power derives from a mandate from the masses, not from some farcical aquatic ceremony.
VJScope is offline