Raised This Month: $ Target: $400
 0% 

Knife shop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-16-2011 , 03:20   Knife shop
Reply With Quote #1

Hi guys!

I want to do for my new server knifes.

I want to make their choice from the menu. But I want this menu is replaced clcmd buy.
So I wrote this plugin. But it does not work correctly. Or buy menu does not work. Or works one time. Either works for one player only.

Help fix.

If you could help me, then lay out in public my plug.
Attached Files
File Type: sma Get Plugin or Get Source (zp_knife_weap.sma - 707 views - 3.2 KB)
HoLLyWooD is offline
Old 01-16-2011, 03:28
eskemo
This message has been deleted by eskemo.
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-16-2011 , 03:31   Re: Knife shop
Reply With Quote #2

Quote:
Originally Posted by eskemo View Post
So you want it, to be done when they press their buy ? As in the button B for a uncustomized cs game ?
yes.
Default config bind "b" "buy"
Very few people change this line.

On my server will not need to purchase through this bind. So I want to ease the players put a call on my menu this function. I've put a sma

I do not know what is wrong there = \
__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD is offline
HoLLyWooD
Senior Member
Join Date: Nov 2010
Location: Ukraine Krivoy Rog
Old 01-16-2011 , 03:57   Re: Knife shop
Reply With Quote #3

its code my sma
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <zombie_plague_advance>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <engine> 

#define PLUGIN "Extra Game Weapons"
#define VERSION "1.0"
#define AUTHOR "HoLLyWooD"

new knife[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("ResetHUD""ResetHUD""abe")
    
    
register_clcmd("buy","cmd_buy");
    
register_clcmd("say /menu","usr_buy_menu");
    
    
register_menucmd(register_menuid("Select type"), 1023"main_buy_menu")
    
register_menucmd(register_menuid("Knife Weapon"), 1023"knife_buy_menu")
}

public 
client_connect(id)
    
knife[id] = 0;
    
public 
client_disconnect(id)
    
knife[id] = 0;
    
public 
ResetHUD(id)
    
knife[id] = 0;

public 
cmd_buy(id){
    if(!
is_user_alive(id))
        return 
PLUGIN_CONTINUE;
        
    
usr_buy_menu(id)
    return 
PLUGIN_HANDLED;
}
public 
usr_buy_menu(id){
    new 
szText555 char ];
    
formatexszTextcharsmax(szText), "SELECT:");
    new 
buy_menu menu_createszText"main_buy_menu" );
    
    
formatexszTextcharsmaxszText ), "KNIFES");
    
menu_additembuy_menuszText"1");
    
    
menu_setprop(buy_menuMPROP_EXITMEXIT_ALL);
    
menu_displayidbuy_menu);
}

public 
main_buy_menu(idbuy_menuitem){
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(buy_menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ], accesscallback;
    
menu_item_getinfobuy_menuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );
    new 
key str_to_numdata );
    
    
menu_destroy(buy_menu);
    
    switch(
key){
        case 
1usr_knife_menu(id);
        default: 
log_amx("default in buy_menu");
    }    
    return 
PLUGIN_HANDLED
}

public 
usr_knife_menu(id){
    new 
szText555 char ];
    
formatexszTextcharsmax(szText), "SELECT KNIFE");
    new 
knife_menu menu_createszText"knife_buy_menu" );
    
    
formatexszTextcharsmaxszText ), "KNIFE_N1");
    
menu_additemknife_menuszText"1");
    
    
formatexszTextcharsmaxszText ), "KNIFE_N2");
    
menu_additemknife_menuszText"2");
    
    
menu_setprop(knife_menuMPROP_EXITMEXIT_ALL);
    
menu_displayidknife_menu);
}

public 
knife_buy_menu(idknife_menuitem){
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(knife_menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data], iName64 ], accesscallback;
    
menu_item_getinfoknife_menuitemaccessdatacharsmaxdata ), iNamecharsmaxiName ), callback );
    new 
key str_to_numdata );
    
    
menu_destroy(knife_menu);
    
    switch(
key){
        case 
1update_knife(id,1);
        case 
2update_knife(id,2);
        
//case 3: update_knife(id,3);
        
default: log_amx("default in knife_buy_menu");
    }
    return 
PLUGIN_HANDLED
}

public 
update_knife(id,no){
    if(!
is_user_alive(id) || zp_get_user_zombie(id))
        return 
PLUGIN_HANDLED;
    
    
knife[id] = no;
    
    if(
knife[id] == || (get_user_weapon(id) != CSW_KNIFE ))
        return 
PLUGIN_HANDLED;

    
client_print(id,print_chat,"your knife is %d",knife[id]);
    
    return 
PLUGIN_CONTINUE;

__________________

You do not know what to tell? Keep silent! You will look cleverer!
Не знаешь что сказать? Промолчи! Будешь выглядеть умней!
Статьи по скриптингу: НА РУССКОМ
HoLLyWooD 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 02:10.


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