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

need help disable buy


Post New Thread Reply   
 
Thread Tools Display Modes
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 09:39   Re: need help disable buy
Reply With Quote #11

Quote:
Originally Posted by HKAnson View Post
Shall you upload your SMA to us
PHP Code:
/*******************
*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <chatcolor> 
#include <fun> 
#include <engine>

new const Prefix[] = "[Road To Glory]"

public plugin_init()
{
    
register_plugin"Pistol Fighter""0.0.1""R34Lx" )
    
    
RegisterHam(Ham_Spawn"player""Spawn"1)
    
    
remove_entity_name"game_text" ); 
    
remove_buyzone(); 
}

public 
remove_buyzone() { 
        new 
iEntity = -1
        while( ( 
iEntity find_ent_by_class(iEntity"func_buyzone") ) )  
        
remove_entityiEntity ); 
}  

public 
Spawn(id)
{
    if( 
is_user_alive(id) )
    {
        
set_task(0.1"ShowHud"id__"b");
        {
            switch( 
get_user_team(id) )
            {
                case 
1:
                { 
                    
strip_user_weaponsid 
                    
give_itemid"weapon_knife" );
                    
give_item(id,"weapon_deagle"); 
                    
set_user_health(id700
                    
client_print_color(idGrey"^4%s ^3Type /Health To See Your Health"Prefix);
                    
client_print_color(idGrey"^4%s ^3You Are ^4Deagle Fighter ^3You have ^4 700 Health ^3And only ^4Deagle ^3and ^4Knife ^3to kill Enemy Team"Prefix); 
                }        
                case 
2:
                { 
                    
strip_user_weaponsid 
                    
give_itemid"weapon_knife" );
                    
give_item(id,"weapon_usp");
                    
set_user_health(id1000
                    
client_print_color(idGrey"^4%s ^3Type /Health To See Your Health"Prefix);
                    
client_print_color(idGrey"^4%s ^3You Are ^4Usp Fighter ^3You have ^4 1000 Health ^3And only ^4Usp ^3and ^4Knife ^3to kill Enemy Team"Prefix); 
                }
            }
        }
    }
}  

public 
ShowHud(id)
{
    new 
iHealth get_user_healthid );
    {
        
set_hudmessage(025500.010.6001.00.95.0_1)
        
show_hudmessage(id"You have %i HP"iHealth );
    }

__________________

Last edited by hannes; 10-03-2012 at 09:39.
hannes is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-03-2012 , 09:43   Re: need help disable buy
Reply With Quote #12

This should work.
PHP Code:
/* 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 || PLUGIN_STATE 3)
return

num_to_str(PLUGIN_STATEPLUGIN_STATE_STR1)

ENT_INDEX create_entity(ENT_CLASS)
DispatchKeyValue(ENT_INDEX"buying"PLUGIN_STATE_STR)
DispatchKeyValue(ENT_INDEX"bombradius""800")
DispatchSpawn(ENT_INDEX)
}

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

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

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_NAMECVAR_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_idmsg_destid) {
if (!(
PLUGIN_STATE get_user_teamid(id)))
return 
PLUGIN_CONTINUE

new icon[8]
get_msg_arg_string(2icon7)
if (
equal(iconICON_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
(idteam)

return 
PLUGIN_HANDLED
}

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

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

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

return 
0
}

stock msg_team_cant_buy(idteam) {
message_begin(MSG_ONETEXT_MSG_ID, {000}, id)
write_byte(BIT_CENTER_TEXT)
write_string(MESSAGE_TEXT[team])
message_end()
}

/* ********************************************* ******* EOF ********************************************* ******* */ 
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 09:48   Re: need help disable buy
Reply With Quote #13

i want to add it in my plugin..
__________________
hannes is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-03-2012 , 12:25   Re: need help disable buy
Reply With Quote #14

Do it...
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 16:58   Re: need help disable buy
Reply With Quote #15

Quote:
Originally Posted by quilhos View Post
Do it...
i cant lawl
__________________
hannes is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 10-03-2012 , 17:32   Re: need help disable buy
Reply With Quote #16

you cant? you just need to put this into the plugin --'
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 17:40   Re: need help disable buy
Reply With Quote #17

Quote:
Originally Posted by quilhos View Post
you cant? you just need to put this into the plugin --'
if its so simple do it by ur self
__________________
hannes is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-03-2012 , 20:53   Re: need help disable buy
Reply With Quote #18

Quote:
Originally Posted by hannes View Post
if its so simple do it by ur self
You are in Scripting Help, where we only guide you to the solution. If you want someone to do it for you, go to Requests.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
hannes
Member
Join Date: Sep 2010
Old 10-03-2012 , 23:03   Re: need help disable buy
Reply With Quote #19

Quote:
Originally Posted by YamiKaitou View Post
You are in Scripting Help, where we only guide you to the solution. If you want someone to do it for you, go to Requests.
yeah but he do not guide me how i do it... he just say do it and a pedo smile
__________________
hannes is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-03-2012 , 23:06   Re: need help disable buy
Reply With Quote #20

He guided you to the solution, now it is up to you to figure out how to incorporate it into your plugin.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).

Last edited by YamiKaitou; 10-03-2012 at 23:20.
YamiKaitou 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 17:51.


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