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

AWP + Knife only plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LazyKeviin
Junior Member
Join Date: Apr 2019
Old 04-16-2019 , 06:55   AWP + Knife only plugin
Reply With Quote #1

Hey!

I'm trying to make a AWP only server but the thing is i don't find any good awp + knife only plugins?

All i need is:
* all players spawn with AWP + Knife every round
* block the buytime
* A good Ranking/Points system

Thats all i need

Last edited by LazyKeviin; 04-16-2019 at 07:05.
LazyKeviin is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 04-16-2019 , 08:51   Re: AWP + Knife only plugin
Reply With Quote #2

Message me in discord Pilo#8253
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 04-17-2019 , 05:04   Re: AWP + Knife only plugin
Reply With Quote #3

Feel free to give this a whirl.
Attached Files
File Type: sp Get Plugin or Get Source (awpsonly.sp - 724 views - 3.3 KB)

Last edited by Kolapsicle; 04-17-2019 at 05:55.
Kolapsicle is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 04-17-2019 , 07:40   Re: AWP + Knife only plugin
Reply With Quote #4

Quote:
Originally Posted by Kolapsicle View Post
Feel free to give this a whirl.
Nice plugin..
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 04-17-2019 , 20:01   Re: AWP + Knife only plugin
Reply With Quote #5

Quote:
Originally Posted by Pilo View Post
Nice plugin..
Thanks. Sorry for hijacking your sale. I had prepared to make the plugin for OP when I first came across his/her post, but I didn't have time. The plugin I posted doesn't correctly loop the grenade slot, and it will only remove the first grenade. You could probably work out a deal with OP to address it, and maybe add additional features if either you, or OP are interested.
Kolapsicle is offline
Pilo
AlliedModders Donor
Join Date: Jan 2019
Location: Israel
Old 04-18-2019 , 03:45   Re: AWP + Knife only plugin
Reply With Quote #6

Quote:
Originally Posted by Kolapsicle View Post
Thanks. Sorry for hijacking your sale. I had prepared to make the plugin for OP when I first came across his/her post, but I didn't have time. The plugin I posted doesn't correctly loop the grenade slot, and it will only remove the first grenade. You could probably work out a deal with OP to address it, and maybe add additional features if either you, or OP are interested.
That's alright, good job about the plugin, I learned some.
__________________

Taking Private(PAID) Plugins In PM
Feel free to Donate with PayPal
Feel free to message me in Discord Pilo#8253
Total donated : 25$
Pilo is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 04-22-2019 , 08:15   Re: AWP + Knife only plugin
Reply With Quote #7

Quote:
Originally Posted by Kolapsicle View Post
Feel free to give this a whirl.
Made some small edits:

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

#pragma semicolon 1
#pragma newdecls required

#define WEAPON_KNIFE 2
#define WEAPON_C4 4

public Plugin myinfo 
{
    
name "AWPs Only"
    
author "Kolapsicle"
    
description "Spawns players with AWPs, and disables buy zones."
    
version "1.0"
};

ConVar cvBuyZonescvRemoveKnivescvRemoveC4cvWeaponOverride;
ArrayList alBuyZones;

public 
void OnPluginStart()
{
    
cvBuyZones CreateConVar("sm_awpsonly_enable_buyzones""0""Should we enables buy zones?"_true0.0true1.0);
    if (
cvBuyZones != null)
    {
        
cvBuyZones.AddChangeHook(onBuyZonesChanged);
    }
    
    
cvRemoveKnives CreateConVar("sm_awpsonly_remove_knives""0""Should we remove knives from players on spawn?"_true0.0true1.0);
    
cvRemoveC4 CreateConVar("sm_awpsonly_remove_c4""1""Should we remove the bomb from players on spawn?"_true0.0true1.0);
    
cvWeaponOverride CreateConVar("sm_awpsonly_weapon_override""weapon_awp""Overrides players' primary weapons. (Note: Invalid weapon names may cause server issues!)");
    
    
HookEvent("player_spawn"Event_PlayerSpawn);
    
AutoExecConfig(true"awpsonly");
}

public 
void onBuyZonesChanged(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
SetBuyZones(view_as<bool>(StringToInt(newValue2)));
}

public 
void OnMapStart()
{
    if (
alBuyZones != null)
    {
        
delete alBuyZones;
    }
    
    
alBuyZones = new ArrayList(1);
    
    
GetBuyZones();
    
SetBuyZones(GetConVarBool(cvBuyZones));
}

public 
Action Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if (!
IsValidClient(client))
    {
        return 
Plugin_Continue;
    }
    
    
// Delay strip function in order to catch C4
    
RequestFrame(StripNextTickclient);
    return 
Plugin_Continue;
}

void StripNextTick(int client)
{
    if (!
IsValidClient(client))
    {
        return;
    }
    
    
StripWeapons(clientGetConVarBool(cvRemoveKnives), GetConVarBool(cvRemoveC4));
    
    
char classname[32];
    
cvWeaponOverride.GetString(classnamesizeof(classname));
    if (
StrContains(classname"weapon_"false) != -1)
    {
        
GivePlayerItem(clientclassname);
        
        return;
    }
    
    
GivePlayerItem(client"weapon_awp");
}

void StripWeapons(int clientbool removeKnife falsebool removeC4 true)
{
    for (
int i 05i++)
    {
        if (!
removeKnife && == WEAPON_KNIFE)
        {
            continue;
        }
        
        if (!
removeC4 && == WEAPON_C4)
        {
            continue;
        }
        
        
int weapon GetPlayerWeaponSlot(clienti);
        if (!
IsValidEntity(weapon))
        {
            continue;
        }
        
        
RemovePlayerItem(clientweapon);
        
AcceptEntityInput(weapon"Kill");
    }
}

void GetBuyZones()
{
    
char classname[32];
    
    for (
int i MaxClientsGetMaxEntities(); i++)
    {
        if (!
IsValidEntity(i))
        {
            continue;
        }
        
        
GetEntityClassname(iclassnamesizeof(classname));
        if (
StrEqual("func_buyzone"classnamefalse))
        {
            
alBuyZones.Push(i);
        }
    }
}

void SetBuyZones(bool enabled true)
{
    for (
int i 0alBuyZones.Lengthi++)
    {
        
int zone alBuyZones.Get(i);
        if (!
IsValidEntity(zone))
        {
            continue;
        }
        
        
AcceptEntityInput(zoneenabled "Enable" "Disable");
    }
}

bool IsValidClient(int client)
{
    return 
client <= MaxClients && IsClientInGame(client) && <= GetClientTeam(client) <= 3;

__________________
B3none 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 13:44.


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