Restrictmenu

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
alecsoviki
Membru, skill +1
Membru, skill +1
Posts: 213
Joined: 09 Sep 2009, 03:59
Detinator Steam: Da
Detinator server CS: Cs.Playcs.ro
SteamID: gunner_game
Location: Arad
Has thanked: 20 times
Been thanked: 1 time
Contact:

01 Aug 2012, 14:57

Cum pot sa restrictionez tot meniul buy [ B ] ? Acum folosesc restmenu.amxx insa merge doar cand sunt pe server sa restrictionezi manual insa dupa restart la server numai sunt restrictiile.
Cs.Playcs.ro - War3FT+Respawn
Zm.Playcs.ro - Zombie Plague

Image
RoyalServer 2
User avatar
J3FF
Membru, skill +1
Membru, skill +1
Posts: 472
Joined: 27 Oct 2007, 20:02
Detinator Steam: Nu
CS Status: ON and Ready 2 PLAY
Detinator server CS: Nu
Location: SiBiU
Has thanked: 25 times
Been thanked: 39 times

01 Aug 2012, 15:03

Adica vrei sa dezactivezi buy-ul sa nu mai poata cumpara arme ?!
Unii ma mai stiu de e t n a d

Image
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

01 Aug 2012, 15:15

| Afiseaza codul
/* AMX Mod X
* Team No Buy
*
* (c) Copyright 2006 by VEN
*
* This file is provided as is (no warranties)
*
*
* PLUGIN allows to disable buy feature for T/CT/T&CT team
*
* ENGINE module required
*
* CVAR amx_team_nobuy (default: 3)
* 0 - disable the plugin
* 1 - disable buy for the Terrorist team
* 2 - disable buy for the CT team
* 3 - disable buy for both teams
* Note: to apply CVAR change map reload is required
*
* INFO_MAP_PARAMETERS idea by Avalanche
*
* VERSIONS
* 0.2 - added CVAR to enable/disable the plugin
* and disable buy only for a certain team
* therefore plugin renamed to "Team No Buy"
* - buy/buyequip menu disabled
* - buy icon displaying disabled
* 0.1 - initial release
*/

/* ********************************************* **** Init/Base ********************************************* **** */

#include <amxmodx>
#include <engine>

new CVAR_NAME[] = "amx_team_nobuy"
#define CVAR_DEFAULT "3"

new PLUGIN_STATE
new PLUGIN_STATE_STR[2]

new ENT_CLASS[] = "info_map_parameters"
new ENT_INDEX

new ICON_NAME[] = "buyzone"

new TEXT_MSG_ID
#define BIT_CENTER_TEXT (1<<2)
new MESSAGE_TEXT[3][] = {"", "#Terrorist_cant_buy", "#CT_cant_buy"}

public plugin_precache() {
PLUGIN_STATE = get_cvar_num(CVAR_NAME)
if (PLUGIN_STATE < 1 || PLUGIN_STATE > 3)
return

num_to_str(PLUGIN_STATE, PLUGIN_STATE_STR, 1)

ENT_INDEX = create_entity(ENT_CLASS)
DispatchKeyValue(ENT_INDEX, "buying", PLUGIN_STATE_STR)
DispatchKeyValue(ENT_INDEX, "bombradius", "500")
DispatchSpawn(ENT_INDEX)
}

public pfn_keyvalue(entid) {
if (!PLUGIN_STATE)
return

new class[24], temp1[2], temp2[2]
copy_keyvalue(class, 23, temp1, 1, temp2, 1)

if (equal(class, ENT_CLASS)) { // is map contains own "info_map_parameters" entity?
if (ENT_INDEX) {
// remove "info_map_parameters" entity which was created in plugin_precache
// in other case map custom bomb explosion radius may be messed
remove_entity(ENT_INDEX)
ENT_INDEX = 0
}

DispatchKeyValue(entid, "buying", PLUGIN_STATE_STR)
}
}

public plugin_init() {
register_plugin("Team No Buy", "0.2", "VEN")
register_cvar(CVAR_NAME, CVAR_DEFAULT)

if (!PLUGIN_STATE)
return

register_message(get_user_msgid("StatusIcon") , "message_status_icon")

TEXT_MSG_ID = get_user_msgid("TextMsg")

register_clcmd("buy", "block_menu")
register_clcmd("buyequip", "block_menu")

set_cvar_num("sv_restartround", 1)
}

public message_status_icon(msg_id, msg_dest, id) {
if (!(PLUGIN_STATE & get_user_teamid(id)))
return PLUGIN_CONTINUE

new icon[8]
get_msg_arg_string(2, icon, 7)
if (equal(icon, ICON_NAME))
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public block_menu(id) {
if (!is_user_alive(id))
return PLUGIN_CONTINUE

new team = get_user_teamid(id)
if (!(PLUGIN_STATE & team))
return PLUGIN_CONTINUE

msg_team_cant_buy(id, team)

return PLUGIN_HANDLED
}

/* ********************************************* ***** Stocks ********************************************* ****** */

stock get_user_teamid(id) {
new tchar[2]
get_user_team(id, tchar, 1)

switch (tchar[0]) {
case 'T': return 1
case 'C': return 2
}

return 0
}

stock msg_team_cant_buy(id, team) {
message_begin(MSG_ONE, TEXT_MSG_ID, {0, 0, 0}, id)
write_byte(BIT_CENTER_TEXT)
write_string(MESSAGE_TEXT[team])
message_end()
}

/* ********************************************* ******* EOF ********************************************* ******* */
Sau un plugin mai simplu
| Afiseaza codul
#include < amxmodx >
#include < engine >

const FM_NULLENT = -1;

public plugin_init( ) {
register_plugin( "BuyZone Remover", "1.0", "xPaw" );

new iEntity = FM_NULLENT;
while( ( iEntity = find_ent_by_class( iEntity, "func_buyzone" ) ) > 0 )
if( entity_get_int( iEntity, EV_INT_iuser1 ) != 1337 )
remove_entity( iEntity );
}

public plugin_precache( ) {
new iEntity = create_entity( "func_buyzone" );

if( iEntity ) {
entity_set_size( iEntity, Float:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
entity_set_int( iEntity, EV_INT_iuser1, 1337 );
}
}
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
[email protected]
User avatar
alecsoviki
Membru, skill +1
Membru, skill +1
Posts: 213
Joined: 09 Sep 2009, 03:59
Detinator Steam: Da
Detinator server CS: Cs.Playcs.ro
SteamID: gunner_game
Location: Arad
Has thanked: 20 times
Been thanked: 1 time
Contact:

01 Aug 2012, 18:29

J3FF wrote:Adica vrei sa dezactivezi buy-ul sa nu mai poata cumpara arme ?!
Exact, tot meniul arme/echipamente.
K1d0x wrote:
| Afiseaza codul
/* AMX Mod X
* Team No Buy
*
* (c) Copyright 2006 by VEN
*
* This file is provided as is (no warranties)
*
*
* PLUGIN allows to disable buy feature for T/CT/T&CT team
*
* ENGINE module required
*
* CVAR amx_team_nobuy (default: 3)
* 0 - disable the plugin
* 1 - disable buy for the Terrorist team
* 2 - disable buy for the CT team
* 3 - disable buy for both teams
* Note: to apply CVAR change map reload is required
*
* INFO_MAP_PARAMETERS idea by Avalanche
*
* VERSIONS
* 0.2 - added CVAR to enable/disable the plugin
* and disable buy only for a certain team
* therefore plugin renamed to "Team No Buy"
* - buy/buyequip menu disabled
* - buy icon displaying disabled
* 0.1 - initial release
*/

/* ********************************************* **** Init/Base ********************************************* **** */

#include <amxmodx>
#include <engine>

new CVAR_NAME[] = "amx_team_nobuy"
#define CVAR_DEFAULT "3"

new PLUGIN_STATE
new PLUGIN_STATE_STR[2]

new ENT_CLASS[] = "info_map_parameters"
new ENT_INDEX

new ICON_NAME[] = "buyzone"

new TEXT_MSG_ID
#define BIT_CENTER_TEXT (1<<2)
new MESSAGE_TEXT[3][] = {"", "#Terrorist_cant_buy", "#CT_cant_buy"}

public plugin_precache() {
PLUGIN_STATE = get_cvar_num(CVAR_NAME)
if (PLUGIN_STATE < 1 || PLUGIN_STATE > 3)
return

num_to_str(PLUGIN_STATE, PLUGIN_STATE_STR, 1)

ENT_INDEX = create_entity(ENT_CLASS)
DispatchKeyValue(ENT_INDEX, "buying", PLUGIN_STATE_STR)
DispatchKeyValue(ENT_INDEX, "bombradius", "500")
DispatchSpawn(ENT_INDEX)
}

public pfn_keyvalue(entid) {
if (!PLUGIN_STATE)
return

new class[24], temp1[2], temp2[2]
copy_keyvalue(class, 23, temp1, 1, temp2, 1)

if (equal(class, ENT_CLASS)) { // is map contains own "info_map_parameters" entity?
if (ENT_INDEX) {
// remove "info_map_parameters" entity which was created in plugin_precache
// in other case map custom bomb explosion radius may be messed
remove_entity(ENT_INDEX)
ENT_INDEX = 0
}

DispatchKeyValue(entid, "buying", PLUGIN_STATE_STR)
}
}

public plugin_init() {
register_plugin("Team No Buy", "0.2", "VEN")
register_cvar(CVAR_NAME, CVAR_DEFAULT)

if (!PLUGIN_STATE)
return

register_message(get_user_msgid("StatusIcon") , "message_status_icon")

TEXT_MSG_ID = get_user_msgid("TextMsg")

register_clcmd("buy", "block_menu")
register_clcmd("buyequip", "block_menu")

set_cvar_num("sv_restartround", 1)
}

public message_status_icon(msg_id, msg_dest, id) {
if (!(PLUGIN_STATE & get_user_teamid(id)))
return PLUGIN_CONTINUE

new icon[8]
get_msg_arg_string(2, icon, 7)
if (equal(icon, ICON_NAME))
return PLUGIN_HANDLED

return PLUGIN_CONTINUE
}

public block_menu(id) {
if (!is_user_alive(id))
return PLUGIN_CONTINUE

new team = get_user_teamid(id)
if (!(PLUGIN_STATE & team))
return PLUGIN_CONTINUE

msg_team_cant_buy(id, team)

return PLUGIN_HANDLED
}

/* ********************************************* ***** Stocks ********************************************* ****** */

stock get_user_teamid(id) {
new tchar[2]
get_user_team(id, tchar, 1)

switch (tchar[0]) {
case 'T': return 1
case 'C': return 2
}

return 0
}

stock msg_team_cant_buy(id, team) {
message_begin(MSG_ONE, TEXT_MSG_ID, {0, 0, 0}, id)
write_byte(BIT_CENTER_TEXT)
write_string(MESSAGE_TEXT[team])
message_end()
}

/* ********************************************* ******* EOF ********************************************* ******* */
Sau un plugin mai simplu
| Afiseaza codul
#include < amxmodx >
#include < engine >

const FM_NULLENT = -1;

public plugin_init( ) {
register_plugin( "BuyZone Remover", "1.0", "xPaw" );

new iEntity = FM_NULLENT;
while( ( iEntity = find_ent_by_class( iEntity, "func_buyzone" ) ) > 0 )
if( entity_get_int( iEntity, EV_INT_iuser1 ) != 1337 )
remove_entity( iEntity );
}

public plugin_precache( ) {
new iEntity = create_entity( "func_buyzone" );

if( iEntity ) {
entity_set_size( iEntity, Float:{ -4096.0, -4096.0, -4096.0 }, Float:{ -4095.0, -4095.0, -4095.0 } );
entity_set_int( iEntity, EV_INT_iuser1, 1337 );
}
}
Multumesc, o sa probez.
Cs.Playcs.ro - War3FT+Respawn
Zm.Playcs.ro - Zombie Plague

Image
User avatar
TheBestKiller
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 509
Joined: 31 Jul 2012, 10:57
Detinator Steam: Da
Reputatie: Ban 2 luni
Utilizator neserios (tepar)
Has thanked: 42 times
Been thanked: 27 times

01 Aug 2012, 19:36

sau mai simple de atata bagi autobind
si pui asa :
bind b "say Imi place server-ul ASTA"
bind o "say Ce server frumos"
si ei numai pot accesa deloc acesa acele butoane :)
User avatar
K1d0x
Fost moderator
Fost moderator
Posts: 800
Joined: 26 Feb 2012, 15:57
Detinator Steam: Da
CS Status: We Build Together ;3 RedFear
Detinator server CS: PuB.RedFear.Ro
SteamID: k1dox
Reputatie: Fost moderator ajutator
Location: Reșița
Been thanked: 152 times
Contact:

01 Aug 2012, 19:41

TheBestKiller habar nu ai ce zici acolo, ca e greu sa scrie in consola exec config.cfg sau bind b buymenu?
Image
32slots.net - Sursa ta de încredere de KIT-uri CS 1.6
RedFear.Ro România - | Afiseaza codul
Vă aştept cu un Register pe Forum
- Suntem în căutare de Dezvoltatori & Administratori :
HTML
PHP
MYSQL
C++
Ofer Server CS spre administrare | Afiseaza codul
Condiții : 
- Să dispui de timp liber
- Să ai cunoștințe AMXX & HLDS
Boostul este asigurat de către Mine (PM pentru. detalii)
[email protected]
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 19 guests