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

Only 1 bullet deagle in all maps


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 06-21-2018 , 14:17   Only 1 bullet deagle in all maps
Reply With Quote #1

If anyone could make a plugin that allow deagle to have only 1 bulletthat was realy nice. The plugin need to force the deagle that the map already have to have only 1 bullet in deagle. Not 1/35 bullets. I want to have the bullet so that if they reload they dont have anymore. Some maps already have deagle so the plugin will need to force.
TrullSin is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-22-2018 , 12:18   Re: Only 1 bullet deagle in all maps
Reply With Quote #2

Tested.

Code:
//Pragma
#pragma semicolon 1
#pragma newdecls required

//Defines

//Sourcemod Includes
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

//Globals

public Plugin myinfo =
{
	name = "One Bullet Deags",
	author = "Keith Warren (Shaders Allen)",
	description = "Automatically sets deagles to have 1 bullet.",
	version = "1.0.0",
	url = "https://github.com/ShadersAllen"
};

public void OnPluginStart()
{
	int entity = -1;
	while ((entity = FindEntityByClassname(entity, "weapon_deagle")) != -1)
	{
		RequestFrame(Frame_Delay, EntIndexToEntRef(entity));
	}
}

public void OnEntityCreated(int entity, const char[] classname)
{
	if (StrEqual(classname, "weapon_deagle"))
	{
		SDKHook(entity, SDKHook_SpawnPost, OnSpawnPost);
	}
}

public void OnSpawnPost(int entity)
{
	RequestFrame(Frame_Delay, EntIndexToEntRef(entity));
}

public void Frame_Delay(any data)
{
	int entity = EntRefToEntIndex(data);

	if (IsValidEntity(entity))
	{
		SetEntProp(entity, Prop_Data, "m_iClip1", 1);
		SetEntProp(entity, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
	}
}
Attached Files
File Type: sp Get Plugin or Get Source (onebulletdeags.sp - 272 views - 1.1 KB)

Last edited by Drixevel; 06-22-2018 at 12:18.
Drixevel is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 06-22-2018 , 12:49   Re: Only 1 bullet deagle in all maps
Reply With Quote #3

It gives 1 bullet at the start of the round but you can reload. You have 1/35 on deagle. Im using the latest version fo sourcemod for linux.
TrullSin is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-23-2018 , 06:52   Re: Only 1 bullet deagle in all maps
Reply With Quote #4

Quote:
Originally Posted by TrullSin View Post
It gives 1 bullet at the start of the round but you can reload. You have 1/35 on deagle. Im using the latest version fo sourcemod for linux.
It should hook current deagles as well that are created in-engine, see if it affects deagles you give yourself with the give command?
Drixevel is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 06-29-2018 , 08:59   Re: Only 1 bullet deagle in all maps
Reply With Quote #5

Not working Drixevel, i keep getting 1/35 bullets on deagle and if i reload i get the 7 bullets again.
TrullSin is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 06-29-2018 , 10:34   Re: Only 1 bullet deagle in all maps
Reply With Quote #6

Some maps work the only 1 bullet on deagle but others maps dont work. And some rounds dont work, i think its because the map have droped deagles and at the spawn i get 1 full.

Last edited by TrullSin; 06-29-2018 at 10:36.
TrullSin 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 17:09.


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