If you guys actually use this you can't change the text/commands or I will be very sad
#pragma semicolon 1
#define PLUGIN_AUTHOR "R3TROATTACK"
#define PLUGIN_VERSION "1.0"
#include
#include
#pragma newdecls required
EngineVersion g_Game;
public Plugin myinfo =
{
name = "I'm too lazy to use already made features",
author = PLUGIN_AUTHOR,
description = "The plugins for lazy people by lazier people",
version = PLUGIN_VERSION,
url = "www.go-fuck-yourself.com"
};
#define BuyDelay 10.0
#define RefillAmmoAmount 1000
#define GiveKevlarHelmet 1 // 1 == yes 0 == no
#define KevlarRefillAmount 100
float g_fLastBuy[MAXPLAYERS + 1];
public void OnPluginStart()
{
g_Game = GetEngineVersion();
if(g_Game != Engine_CSGO && g_Game != Engine_CSS)
{
SetFailState("This plugin is for CSGO/CSS only.");
}
RegConsoleCmd("sm_moreammopls", Command_ImTooLazyToUseZmarket);
RegConsoleCmd("sm_morekevlarpls", Command_ImTooLazyToUseZmarketStill);
}
public void OnClientPostAdminCheck(int client)
{
g_fLastBuy[client] = GetGameTime();
}
public void OnClientDisconnect(int client)
{
g_fLastBuy[client] = GetGameTime();
}
public Action Command_ImTooLazyToUseZmarket(int client, int args)
{
if(!IsClientInGame(client))
return Plugin_Handled;
if(GetGameTime() - g_fLastBuy[client] {
PrintToChat(client, " \x06[Lazy People Are Best] \x01You can rebuy armor/kevlar in \x10%0.2f \x01seconds", BuyDelay - (GetGameTime() - g_fLastBuy[client]));
return Plugin_Handled;
}
int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if(weapon == -1)
{
PrintToChat(client, "\x06[Lazy People Are Best] \x01Use a weapon dumb fuck");
return Plugin_Handled;
}
char sClass[128];
GetEntityClassname(weapon, sClass, sizeof(sClass));
if(StrContains(sClass, "weapon_knife", false) != -1 || StrContains(sClass, "grenade", false))
{
PrintToChat(client, "\x06[Lazy People Are Best] \x01Your weapon's ammo cant be changed'");
return Plugin_Handled;
}
SetEntProp(weapon, Prop_Send, "m_iClip2", RefillAmmoAmount);
PrintToChat(client, " \x06[Lazy People Are Best] \x01Your weapon's spare ammo has been set to %i", RefillAmmoAmount);
return Plugin_Handled;
}
public Action Command_ImTooLazyToUseZmarketStill(int client, int args)
{
if(!IsClientInGame(client))
return Plugin_Handled;
if(GetGameTime() - g_fLastBuy[client] {
PrintToChat(client, " \x06[Lazy People Are Best] \x01You can rebuy armor/kevlar in \x10%0.2f \x01seconds", BuyDelay - (GetGameTime() - g_fLastBuy[client]));
return Plugin_Handled;
}
SetEntProp(client, Prop_Send, "m_ArmorValue", KevlarRefillAmount);
SetEntProp(client, Prop_Send, "m_bHasHelmet", GiveKevlarHelmet);
PrintToChat(client, " \x06[Lazy People Are Best] \x01Your kevlar has been set to %i.", KevlarRefillAmount);
return Plugin_Handled;
}
It should work but m_iClip2 has always been weird for me or I'm supposed to be using another net_prop but fuck that too much logic stuff needed
Edit: Punky told me yall didn't mean rebuy WHEN YOU SAID REBUY so now i feel dumb cause i'm 2 lazy 2 read and comprehend posts xd
Edit dos:Here is what I was told you actually wanted
#pragma semicolon 1
#define PLUGIN_AUTHOR "R3TROATTACK"
#define PLUGIN_VERSION "1.0"
#include
#include
#include
#pragma newdecls required
public Plugin myinfo =
{
name = "I'm too lazy to use already made features",
author = PLUGIN_AUTHOR,
description = "The plugins for lazy people by lazier people",
version = PLUGIN_VERSION,
url = "www.go-fuck-yourself.com"
};
char g_sLazyArms[][] = { "weapon_usp_silencer", "weapon_glock", "weapon_hkp2000", "weapon_tec9", "weapon_revolver", "weapon_p250", "weapon_cz75a", "weapon_fiveseven", "weapon_elite", "weapon_deagle" };
StringMap g_hLazyMap = null;
public void OnPluginStart()
{
g_hLazyMap = new StringMap();
}
public void OnMapStart()
{
g_hLazyMap.Clear();
LoadKeyValues();
}
public void OnClientSayCommand_Post(int client, const char[] command, const char[] sArgs)
{
if(!IsClientInGame(client))
return;
char sBuffer[128];
if(g_hLazyMap.GetString(sArgs, sBuffer, sizeof(sBuffer)))
EquipWeapon(client, sBuffer);
}
void EquipWeapon(int client, const char[] sWeapon)
{
int weapon = GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon");
if(IsWeaponSecondary(sWeapon))
{
CS_DropWeapon(client, CS_SLOT_SECONDARY, false);
AcceptEntityInput(weapon, "kill");
weapon = GivePlayerItem(client, sWeapon);
EquipPlayerWeapon(client, weapon);
}
else
{
CS_DropWeapon(client, CS_SLOT_PRIMARY, false);
AcceptEntityInput(weapon, "kill");
weapon = GivePlayerItem(client, sWeapon);
EquipPlayerWeapon(client, weapon);
}
}
bool IsWeaponSecondary(const char[] sWeapon)
{
for (int i = 0; i {
if(StrEqual(sWeapon, g_sLazyArms[i], true))
return true;
}
return false;
}
void LoadKeyValues()
{
char sPath[512];
BuildPath(Path_SM, sPath, sizeof(sPath), "configs/lazypeoplearedumb.cfg");
if(!FileExists(sPath))
SetFailState("[LazyPeople] Could find file \"lazypeoplearedumb.cfg\" at path \"%s\"", sPath);
KeyValues kv = new KeyValues("ZmarketIsHard");
kv.ImportFromFile(sPath);
if (!kv.GotoFirstSubKey())
{
delete kv;
SetFailState("ERROR: No KeyValues were found inside \"%s\", unloading", sPath);
}
do{
char sBuffer[128], sClassname[128];
kv.GetSectionName(sBuffer, sizeof(sBuffer));
kv.GetString("weapon", sClassname, sizeof(sClassname));
if(StrContains(sClassname, "weapon_", true) != -1 && !StrEqual(sClassname, "weapon_taser"))
g_hLazyMap.SetString(sBuffer, sClassname, true);
} while (kv.GotoNextKey());
delete kv;
}
KeyValue file for config folder
"ZmarketIsHard"
{
"!thisiseasierthenzmarketwithnumbers"
{
"weapon" "weapon_negev"
}
}
If anyone actually cares to test/fix the broken stuff in this cause I dont @Punky but theoretically it does work xd