View Single Post
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-10-2018 , 20:59   Re: Block grenade with X numbers of online players
Reply With Quote #2

Quote:
Originally Posted by tarsisd2 View Post
I have seen this plugin somewhere but i can't find it

only allow players to buy grenades, depending on how many players on server, with cvar
and print a msg
[amxx] you are not allowed to buy grenades with less then 10 players on the server

if anyone have it
Use this awsome plugin:

https://forums.alliedmods.net/showthread.php?t=149380

Then:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cl_buy>

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


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_buy(idiItem)
{
    if(!
isBuyBlock(iItem))
        return 
PLUGIN_CONTINUE
        
    
if((get_playersnum() >= 9))
        return 
PLUGIN_CONTINUE

    client_print
(id,print_chat"The message you wanted")
    
client_cmd(id,"speak buttons/blip2")
    return 
PLUGIN_HANDLED
}

bool:isBuyBlock(iItem)
{
    switch(
iItem)
    {
        case 
CSW_HEGRENADECSW_FLASHBANGCSW_SMOKEGRENADE:    return true
    
}
    return 
false

iceeedr is offline
Send a message via Skype™ to iceeedr