AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   AWP Player limit. (https://forums.alliedmods.net/showthread.php?t=328035)

HowToRuski 10-23-2020 04:42

AWP Player limit.
 
Hey, i just wondered if there is a plugin available on AlliedModders - AWP Limit.
by that i mean if players are lower than 14 on server AWP is not allowed to buy, and if they are 14+ then everyone can buy one.

r0ma 10-23-2020 05:22

Re: AWP Player limit.
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "r0ma'"

// Players needs for buy awp
const MIN_PLAYERS 14;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
CS_OnBuyAttempt(iditem) {
    if(
item == CSW_AWP && get_playersnum() < MIN_PLAYERS) {
        
client_print(idprint_chat"[AMXX] Need have %d players on server for buy AWP."MIN_PLAYERS);
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;



HowToRuski 10-23-2020 06:52

Re: AWP Player limit.
 
Quote:

Originally Posted by r0ma (Post 2722269)
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "r0ma'"

// Players needs for buy awp
const MIN_PLAYERS 14;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
CS_OnBuyAttempt(iditem) {
    if(
item == CSW_AWP && get_playersnum() < MIN_PLAYERS) {
        
client_print(idprint_chat"[AMXX] Need have %d players on server for buy AWP."MIN_PLAYERS);
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;



Did you test the plugin ? Because idk doesnt work for me

CrazY. 10-23-2020 07:40

Re: AWP Player limit.
 
What's the version of your amxmodx?

HowToRuski 10-23-2020 09:11

Re: AWP Player limit.
 
Quote:

Originally Posted by CrazY. (Post 2722281)
What's the version of your amxmodx?

1.8.2

r0ma 10-23-2020 09:50

Re: AWP Player limit.
 
Quote:

Originally Posted by HowToRuski (Post 2722275)
Did you test the plugin ? Because idk doesnt work for me

Plugins load ? no error log? have cstrike module on ?

Tested:
https://prnt.sc/v5cny2

HowToRuski 10-23-2020 10:24

Re: AWP Player limit.
 
Quote:

Originally Posted by r0ma (Post 2722292)
Plugins load ? no error log? have cstrike module on ?

Tested:
https://prnt.sc/v5cny2

Yes no erros and cstrike module is on, still doesnt work

r0ma 10-23-2020 10:30

Re: AWP Player limit.
 
Quote:

Originally Posted by HowToRuski (Post 2722289)
1.8.2

need 1.9 jeje
https://wiki.alliedmods.net/AMX_Mod_X_1.9_Release_Notes

HowToRuski 10-23-2020 10:39

Re: AWP Player limit.
 
and what about 1.8.2? because if i switch to 1.9 i will need to rewrite my entire plugin directory

ZaX 10-23-2020 10:42

Re: AWP Player limit.
 
No you dont, amxx is backward compatible


All times are GMT -4. The time now is 01:28.

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