Raised This Month: $ Target: $400
 0% 

Pedido , Menu De Municiones [HNS]


  
 
 
Thread Tools Display Modes
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 12-30-2012 , 23:19   Re: Pedido , Menu De Municiones [HNS]
#11

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "HNS Armas"
#define VERSION "1.0"
#define AUTHOR "BlackFur"

#define TAG "Escondidas"

enum _:Data 
{  
    
Text[99],  
    
Money ,
    
Ammo ,
    
Weapon[99] ,
    
IdWeapon
     
}  

new const 
g_MenuBuyMoney[9][Data] = 
{
    { 
"Schmidt Scout"12000 "weapon_scout" CSW_SCOUT} ,
    { 
"AK-47 Kalashnikov"10500 "weapon_ak47" CSW_AK47} ,
    { 
"Steyr AUG A1"9000 "weapon_aug" CSW_AUG} ,
    { 
"Desert Eagle .50 AE"6500 "weapon_deagle" CSW_DEAGLE} ,
    { 
"M4A1 Carbine" 10500 "weapon_m4a1" CSW_M4A1} ,
    { 
"USP .45 ACP Tactical"6000 "weapon_usp" CSW_USP} ,
    { 
"M3 Super 90"8000 "weapon_m3" CSW_M3} ,
    { 
"SG-550 Auto-Sniper"15000 "weapon_sg550" CSW_SG550} , 
    { 
"AWP Magnum Sniper"16000 "weapon_awp" CSW_AWP}
    
}  

new const 
AMMOTYPE[][] = { """357sig""""762nato""""buckshot""""45acp""556nato""""9mm""57mm""45acp",
            
"556nato""556nato""556nato""45acp""9mm""338magnum""9mm""556natobox""buckshot",
            
"556nato""9mm""762nato""""50ae""556nato""762nato""""57mm" }


new const 
sound_buyammo[] = "items/9mmclip1.wav"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say armas" "show_menu_armas")
    
register_clcmd("say /armas" "show_menu_armas")
}

public 
plugin_precache() precache_sound(sound_buyammo)

public 
show_menu_armas(id)
{
    if(!
is_user_alive(id))
    {
        
print_chatColor(id "^x04[%s]^x01 Solo Cuando Estes Vivo" TAG)
        return 
PLUGIN_HANDLED
    
}
    
    new 
len[99] , temp[2]
    
    new 
menu_armas menu_create("\y Escondidas Shop-Armas" "armas_menu")
    
    for(new 
sizeof g_MenuBuyMoney i++)
    {
        if(
cs_get_user_money(id) >= g_MenuBuyMoney[i][Money])
            
formatex(len charsmax(len) , "\y%s \r[Balas: %d][Costo: %d]" g_MenuBuyMoney[i][Text] , g_MenuBuyMoney[i][Ammo] , g_MenuBuyMoney[i][Money])    
        else
            
formatex(len charsmax(len) , "\d%s \r[Balas: %d][Costo: %d]" g_MenuBuyMoney[i][Text] , g_MenuBuyMoney[i][Ammo] , g_MenuBuyMoney[i][Money])    
        
        
num_to_str(i,temp2)
        
        
menu_additem(menu_armas len temp)
    }
    
    
menu_setprop(menu_armas MPROP_BACKNAME,"\yAtras")
    
menu_setprop(menu_armas MPROP_NEXTNAME,"\ySiguiente")
    
menu_setprop(menu_armas MPROP_EXITNAME,"\ySalir")
    
menu_display(idmenu_armas 0)    
    return 
PLUGIN_HANDLED
}

public 
armas_menu(id menu_armas item)
{
    if(
item == MENU_EXIT || !is_user_alive(id))
    {
        
menu_destroy(menu_armas)
        return 
PLUGIN_HANDLED
    
}
    
    if(
cs_get_user_money(id) >= g_MenuBuyMoney[item][Money])
    {
        if(!
user_has_weapon(id g_MenuBuyMoney[item][IdWeapon]))
            
cs_set_weapon_ammo(fm_give_item(idg_MenuBuyMoney[item][Weapon]) , g_MenuBuyMoney[item][Ammo]) 
        else
        {
            
ExecuteHamB(Ham_GiveAmmoidg_MenuBuyMoney[item][Ammo], AMMOTYPE[g_MenuBuyMoney[item][IdWeapon]] , 30)
            
emit_sound(idCHAN_ITEMsound_buyammo1.0ATTN_NORM0PITCH_NORM)
        }
        
        
cs_set_user_money(id cs_get_user_money(id) - g_MenuBuyMoney[item][Money])
    }
    else
    {
        
print_chatColor(id "^x04[%s]^x01 Necesitas^x04 %d $^x01 Para Comprar^x04 %s" TAG g_MenuBuyMoney[item][Money] , g_MenuBuyMoney[item][Text])
    }
    return 
PLUGIN_HANDLED
}

stock print_chatColor(id,const input[], any:...)
{
    new 
msg[191], players[32], count 1;
    
vformat(msg,190,input,3);
    
replace_all(msg,190,"\g","^4");// green
    
replace_all(msg,190,"\n","^1");// normal
    
replace_all(msg,190,"\t","^3");// team
    
    
if (idplayers[0] = id; else get_players(players,count,"ch");
    for (new 
i=0;i<count;i++)
    if (
is_user_connected(players[i]))
    {
        
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]);
        
write_byte(players[i]);
        
write_string(msg);
        
message_end();
    }

Un Mundo encontrarlo :c

Last edited by BlackFur; 12-30-2012 at 23:29.
BlackFur is offline
claans
Senior Member
Join Date: Jul 2012
Location: Argentina
Old 12-31-2012 , 00:12   Re: Pedido , Menu De Municiones [HNS]
#12

esta diciendo que solo quiere comprar las balas ._.

sl2
cLAANS.-
__________________
http://amxmodx-es.com/ Allied Modders en espaņol
http://amxmodx-es.com/ Allied Modders in spanish
claans is offline
Send a message via MSN to claans Send a message via Skype™ to claans
StrikerV2
Senior Member
Join Date: Nov 2012
Location: Chile , O Yes!
Old 12-31-2012 , 09:32   Re: Pedido , Menu De Municiones [HNS]
#13

Quote:
Originally Posted by r0ma View Post
PHP Code:
#include <amxmodx>  
#include <engine> 
#include <cstrike>  
#include <fun>  

#define prefix    "[Menu de Balas]" 

enum _:DATA_PACK 
    
PACK_NAME[33], 
    
PACK_WEAPON[33], 
    
PACK_BALAS
    
PACK_COST,
    
PACK_ACCESS


new 
g_pack_data[][DATA_PACK] = { 
    { 
"Scout""weapon_scout"210000}, 
    { 
"Ak-47""weapon_ak47"29500}, 
    { 
"Aug""weapon_aug"27000}, 
    { 
"Deagle""weapon_deagle"14500}, 
    { 
"M3""weapon_m3"18000}, 
    { 
"Usp""weapon_usp"24500}, 
    { 
"Glock""weapon_glock18"24000}, 
    { 
"Five Seven""weapon_fiveseven"25000}, 
    { 
"M4A1""weapon_m4a1"17000}, 
    { 
"Famas""weapon_famas"17000},
    { 
"Awp""weapon_awp"110000ADMIN_KICK }


new 
g_menug_maxplayersg_msgSayText 
new g_compro[33], g_conectado[33

public 
plugin_init()   
{   
    
register_plugin("Menu de Balas""1.7""r0ma'")   
    
    
register_event"HLTV","event_round_start","a","1=0","2=0" 
    
    
register_clcmd("say /shop""show_menu_shop")  
    
    
g_msgSayText get_user_msgid("SayText"
    
g_maxplayers get_maxplayers() 
}   

public 
plugin_cfg() 

    new 
item[64
    
    
g_menu menu_create("\y==============================^n\w Menu Balas \d|| \wVersion 1.7 ^n\y==============================^n""menu_armas"
    
    for(new 
0sizeof g_pack_datai++) 
    { 
        
formatex(itemcharsmax(item), "%S \y(%d Bala%s) \r[$%d]"g_pack_data[i][PACK_NAME], g_pack_data[i][PACK_BALAS], g_pack_data[i][PACK_BALAS] > "s" ""g_pack_data[i][PACK_COST]) 
        
menu_additem(g_menuitem, .paccess g_pack_data[i][PACK_ACCESS]) 
    } 
    
    
menu_setprop(g_menuMPROP_EXITNAME"Salir"


public 
client_putinserver(id

    
g_conectado[id] = 
    g_compro
[id] = 


public 
client_disconnect(id
    
g_conectado[id] = 

public event_round_start() 

    static 
id 
    
for( id 1id <= g_maxplayersid++) 
    { 
        if(
g_conectado[id]) 
        { 
            
g_compro[id] = 
        

    } 


public 
show_menu_shop(id)  
{  
    
menu_display(idg_menu
    return 
PLUGIN_HANDLED 


public 
menu_armas(idmenuitem)  
{  
    if (
item == MENU_EXIT)     
        return 
    
    if(!
is_user_alive(id)) 
    { 
        
hns_print_color(id"^x04%s^x01 Tienes que estar vivo para comprar un balas"prefix
        return 
    } 
    if(
g_compro[id]) 
    { 
        
hns_print_color(id"^x04%s^x01 Ya compraste balas en esta ronda"prefix
        return 
    } 
    
    static 
moneymoney cs_get_user_money(id
    
    if(
money g_pack_data[item][PACK_COST]) 
    { 
        
hns_print_color(id"^x04%s^x01 No tienes suficienet dinero para comprar balas."prefix
        return 
    } 
    
    
cs_set_weapon_ammofind_ent_by_owneridg_pack_dataitem ][ PACK_WEAPON ], id ), g_pack_dataitem ][ PACK_BALAS ] );
    
cs_set_user_money(idmoney g_pack_data[item][PACK_COST]) 
    
    
g_compro[id]++ 
    
    
hns_print_color(id"^x04%s^x01 Compraste:^x04 %d^x01 Bala%s"prefixg_pack_data[item][PACK_BALAS], g_pack_data[item][PACK_BALAS] > "s" ""
}

stock hns_print_color(id, const mensaje[], any:...) 

    if(!
g_conectado[id]) 
        return 
    
    static 
buffer[192
    
vformat(buffercharsmax(buffer), mensaje3
    
    
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_id
    
write_byte(id
    
write_string(buffer
    
message_end() 

Probalo.

EDIT: Adapatado para comprar armas probalo.
Pero ahora se compran las armas , solo queria las balas :B
__________________
Mi firma era tan sexy .-.
StrikerV2 is offline
Send a message via MSN to StrikerV2
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 12-31-2012 , 09:44   Re: Pedido , Menu De Municiones [HNS]
#14

Si el jugador tiene la AWP con una bala y vuelve a comprar una bala mas el arma se bugea , va a tener 1/30 , no te recomiendo eso .

Saludos xGreat
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO

xGreat is offline
Send a message via MSN to xGreat
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 12-31-2012 , 10:07   Re: Pedido , Menu De Municiones [HNS]
#15

Seteas el bpammo en 0 tambien y listo.
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
Old 01-07-2013, 12:16
StorM20
This message has been deleted by StorM20. Reason: No me di cuenta de la fecha. :)
StrikerV2
Senior Member
Join Date: Nov 2012
Location: Chile , O Yes!
Old 01-07-2013 , 13:24   Re: Pedido , Menu De Municiones [HNS]
#16

Quote:
Originally Posted by StorM20 View Post
que el lo adapte si ya le dieron el code que tanto problema se hacen...
Increiblemente ya lo ise . y este post lo ise a hace 2 semanas .-. creo .

No fue tan dificil.

Quise aserlo desde 0 usando enums .
__________________
Mi firma era tan sexy .-.
StrikerV2 is offline
Send a message via MSN to StrikerV2
chetah
Senior Member
Join Date: Jan 2013
Location: BangBros
Old 01-11-2013 , 14:34   Re: Pedido , Menu De Municiones [HNS]
#17

Gracias lo probare ahora en mi sv
chetah is offline
xGreat
Senior Member
Join Date: Jul 2012
Location: Chilean
Old 01-11-2013 , 17:12   Re: Pedido , Menu De Municiones [HNS]
#18

Quote:
Originally Posted by chetah View Post
Gracias lo probare ahora en mi sv
Antes de postear tienes que darte cuenta en la fecha que se hico el post.

Saludos xGreat
__________________
Mi 255
WwW.HnsBJz.Tk = MI FORO


Last edited by xGreat; 01-11-2013 at 18:12.
xGreat is offline
Send a message via MSN to xGreat
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 01-11-2013 , 17:19   Re: Pedido , Menu De Municiones [HNS]
#19

4 Dias ni que fuera mucho aunque lo que posteo es al pedo.
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
 



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 22:05.


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