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

Help with a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-14-2017 , 11:09   Help with a plugin
Reply With Quote #1

Hello people, i want a plugin to block awp/auto in some maps! Like dust2x2, i know exists the awp/auto limit but i dont want them, because the awp/auto limit is for the number of players and i want a plugin to map!
__________________
FreezerPT is offline
brlight
Senior Member
Join Date: Jun 2011
Old 10-14-2017 , 11:15   Re: Help with a plugin
Reply With Quote #2

Just enable plugin for certain maps
brlight is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-14-2017 , 11:18   Re: Help with a plugin
Reply With Quote #3

Quote:
Originally Posted by brlight View Post
Just enable plugin for certain maps
But bro i dont want to use that plugin! I want a plugin to block awp because the map is 2x2! Not because the players are like 7/10
__________________
FreezerPT is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 10-14-2017 , 11:31   Re: Help with a plugin
Reply With Quote #4

he just gave you the answer. and yet you say that you don`t want a plugin, because you want a plugin.
__________________
retired chump
DjSoftero is offline
FreezerPT
Senior Member
Join Date: Mar 2017
Location: 127.0.0.1
Old 10-14-2017 , 11:49   Re: Help with a plugin
Reply With Quote #5

Quote:
Originally Posted by DjSoftero View Post
he just gave you the answer. and yet you say that you don`t want a plugin, because you want a plugin.

It's not that kind of plugin they suggested! This plugin blocks AWP / AUTO by the number of players and I want a block by being 2x2
__________________
FreezerPT is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 10-14-2017 , 12:15   Re: Help with a plugin
Reply With Quote #6

https://wiki.alliedmods.net/Configur...p_Config_Files

Add in the config:
PHP Code:
amx_restrict on awp 
WhiteFang1319 is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 10-15-2017 , 02:16   Re: Help with a plugin
Reply With Quote #7

omg. just make the minimum of 33 players for awp and then enable by map. Was that so hard to figure out
__________________
retired chump
DjSoftero is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 10-15-2017 , 11:36   Re: Help with a plugin
Reply With Quote #8

You must download cl_buy if you aren't using amxx 1.8.3 - https://forums.alliedmods.net/showthread.php?t=149380

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>

#if AMXX_VERSION_NUM < 183
#include <cl_buy>
#define MAX_PLAYERS 32
#else
#include <cstrike>
#endif

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

const TASK_CHECK 21021020

new const g_szMaps[] = 
{
    
"de_dust2x2"


new 
pCvarMinPlayers

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
pCvarMinPlayers register_cvar("ba_minplayers""10")
    
    if(
IsMap())
    {
        
RegisterHam(Ham_Spawn"player""playerSpawn"1)
    }
}

public 
playerSpawn(id)
{    
    if(
is_user_alive(id))
    {
        
set_task(1.0"check_AutoWeapon"id TASK_CHECK)
    }
}

#if AMXX_VERSION_NUM < 183
public client_buy(idiItem)
#else
public CS_OnBuy(idiItem)
#endif
{
    if(
iItem == CSW_AWP)
    {        
        if(!
isLessThanNeeded())
        {
            
ColorChat(id,"^4[AWPBlock] ^3AWP^x01 is disabled. You can buy whether server has^x04 %d^x01 players."get_pcvar_num(pCvarMinPlayers))  
            return 
PLUGIN_HANDLED
        
}
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
check_AutoWeapon(id)
{
    if(
isLessThanNeeded())
        return
        
    if(
IsMap())
        return
        
    
id -= TASK_CHECK

    
if(user_has_weapon(idCSW_AWP))
    {        
        
remove_weapon(id"weapon_awp")
        
ColorChat(id,"^4[AWPBlock] ^3AWP^x01 is disabled. You can buy whether server has^x04 %d^x01 players."get_pcvar_num(pCvarMinPlayers))  
    }
}

remove_weapon(idweapon[])
{
    if(!
equal(weapon"weapon_"7)) 
        return 
0
    
    
new wId get_weaponid(weapon)
     if(!
wId
        return 
0
    
    
new wEnt
    
while((wEnt engfunc(EngFunc_FindEntityByStringwEnt"classname"weapon)) && pev(wEntpev_owner) != id) {}
    if(!
wEnt
        return 
0
    
    ExecuteHamB
(Ham_Weapon_RetireWeaponwEnt)
    
    if(!
ExecuteHamB(Ham_RemovePlayerItemidwEnt)) 
        return 
0

    ExecuteHamB
(Ham_Item_KillwEnt)
    
    
set_pev(idpev_weaponspev(id,pev_weapons) & ~(1<<wId))
    return 
1
}

bool:IsMap()
{
    new 
szMap[32]
    
get_mapname(szMap,charsmax(szMap))
    for(new 
isizeof g_szMapsi++)
    {
        if(
equal(szMapg_szMaps[i]))
        { 
            return 
true
        
}
    }
    return 
false
}

bool:isLessThanNeeded()
{
    new 
iTNumiPlayersT[MAX_PLAYERS], iCTNumiPlayersCT[MAX_PLAYERS]
    
    
get_players(iPlayersTiTNum"e""TERRORIST")
    
get_players(iPlayersCTiCTNum"e""CT")
        
    return (
iTNum iCTNum) >= get_pcvar_num(pCvarMinPlayers) ? true false
}

ColorChat(const id, const input[], any:...)
{
        new 
count 1players[32]
        static 
msg[191]
        
vformat(msg190input3)

        
replace_all(msg190"!g""^4"// verde
        
replace_all(msg190"!y""^1"// Default
        
replace_all(msg190"!t""^3"// Team

        
if (idplayers[0] = id; else get_players(playerscount"ch")
        {
                for (new 
0counti++)
                {
                        if (
is_user_connected(players[i]))
                        {
                                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                                
write_byte(players[i]);
                                
write_string(msg);
                                
message_end();
                        }
                }
        }

I did not test.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx 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 19:30.


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