Raised This Month: $ Target: $400
 0% 

add minigun store


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Juuhz
Junior Member
Join Date: Sep 2012
Old 09-03-2012 , 19:32   add minigun store
Reply With Quote #1

Hello, I added this to my server plugins

http://forums.alliedmods.net/showthread.php?t=95129

wanted to know if the plugins to add that in my shop

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

new i
new bool:g_iSet[33]
new 
g_szDefault_Model[33][50]
#define weapon_sg550 = ADMIN_LEVEL_H

enum _:items_data {
    
item_Name[100],
    
item_Cost,
    
item_Team
}

new Array:
g_aItems
new gmsgSetFOV 
new bool:has_drug[33]

public 
plugin_init()
{
    
register_plugin("JailBreak SHOP.""2.0""Andre Neves")
    
    
register_clcmd("say /shop""cmdShop")
    
    
register_event("CurWeapon""set_speed""be""1=1");
    
    
g_aItems ArrayCreate(items_data)
    
    
Add_Item("500 Hp\r [VIP]"2000CS_TEAM_CT)
    
Add_Item("255 Hp"5000CS_TEAM_CT)
    
Add_Item("TEC-TEC\r [VIP]"10000CS_TEAM_CT)
    
Add_Item("Gravidade\d [20s]"5000CS_TEAM_CT)
    
Add_Item("1 Bomba HE" 2500CS_TEAM_CT)
    
Add_Item("2 Bombas Flash"2000CS_TEAM_CT)
    
Add_Item("Park Bombas"8000CS_TEAM_CT)
    
Add_Item("1 Bombas Congelante"3000CS_TEAM_CT)
    
Add_Item("Speed 6.0"8500CS_TEAM_CT)
    
Add_Item("Colete 255",1000CS_TEAM_T)
    
Add_Item("Invencibilidade\d [5s]"10000CS_TEAM_T)
    
    
gmsgSetFOV get_user_msgid("SetFOV"
}

public 
cmdShop(id)
{
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"[Click #1] Voce precisa estar vivo para abrir o Shop !!")
    }
    
    static 
iMoneyszBuffer[50], iTotalItemsitem_Data[items_data], team
    team    
_:cs_get_user_team(id)
    
iMoney  cs_get_user_money(id)
    
    
formatex(szBuffercharsmax(szBuffer), "\r[Click #1] - Shop ^n Seu dinheiro:\w%i^n\wPag"iMoney)
    new 
iMenu menu_create(szBuffer"MenuHandler")
    
    new 
szMenuId[10]
    
    
iTotalItems ArraySize(g_aItems)
    
    for( 
0iTotalItemsi++)
    {
        
ArrayGetArray(g_aItemsiitem_Data)
        
        if(
item_Data[item_Team] != _:team)
            continue
        
        if(
item_Data[item_Cost] > iMoney)
        {
            
remove_colorMenu(item_Data[item_Name], charsmax(item_Data[item_Name]))
            
formatex(szBuffercharsmax(szBuffer), "%s \y- R$ %i"item_Data[item_Name], item_Data[item_Cost])
        }
        
        else
            
formatex(szBuffercharsmax(szBuffer), "%s \y- R$ %i"item_Data[item_Name], item_Data[item_Cost])
        
        
num_to_str(iszMenuId9)
        
menu_additem(iMenuszBufferszMenuId)
    }
    
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL)
    
menu_display(idiMenu)
    
    return 
1
}

public 
MenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
        return
    
    new 
data[6], iName[64]
    new 
iAccesscallback
    menu_item_getinfo
(menuitemiAccessdata5iName63callback)
    new 
itemId str_to_num(data)
    
    static 
iMoneyitem_Data[items_data]
    
    
iMoney cs_get_user_money(id)
    
    
ArrayGetArray(g_aItemsitemIditem_Data)
    
    if(
iMoney item_Data[item_Cost])
    {
        
client_print(idprint_chat"[Click #1] Voce ainda precisa de mais dinheiro para comprar este item !!")
        return
    }
    
    
iMoney -= item_Data[item_Cost]
    
    
cs_set_user_money(idiMoney)
    
    switch(++
itemId)
    {
        case 
1:                         
        {
    new 
user_flags get_user_flags(id);
    
    if(
user_flags ADMIN_LEVEL_H) {
            
set_user_health(id500)
            
            
client_printidprint_chat"[Click #1] Voce comprou 500 de Vida !!")
        
         } else {
        
client_printidprint_chat"[Click #1] Voce tem que ser VIP para comprar essa arma /vip"
    }
}  
        case 
2:   
        {
            
set_user_health(id255)
            
            
client_printidprint_chat"[Click #1] Voce comprou 255 de Vida !!")
}
        case 
3:  
{
    new 
user_flags get_user_flags(id);
    
    if(
user_flags ADMIN_LEVEL_H) {
        
cs_set_weapon_ammo(give_item(id"weapon_sg550"), 12
        
cs_set_user_bpammo(idCSW_USP0
    
        
client_printidprint_chat"[Click #1] Voce comprou uma TEC-TEC !!"
    } else {
        
client_printidprint_chat"[Click #1] Voce tem que ser VIP para comprar essa arma /vip"
    }
}  
        case 
4:
        {
            
set_user_gravity(id0.5)
            
set_task(20.0"remove_gravity"id)
            
            
client_printidprint_chat"[Click #1] Voce comprou 20 segundos de Gravidade reduzida !!")
                
        }
        case 
5:
        {
            
give_item(id"weapon_hegrenade")
            
            
client_printidprint_chat"[Click #1] Voce comprou 1 Granada !!")
                
        }
        case 
6:
        {
            
give_itemid"weapon_flashbang" );
            
give_itemid"weapon_flashbang" );
            
            
client_printidprint_chat"[Click #1] Voce comprou 2 Flash !!")
            
        }
        case 
7:
        {
            
give_item(id"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_smokegrenade")            
            
            
client_printidprint_chat"[Click #1] Voce comprou Park Granadas com Flash , He e Smolk !!")
                
        }
        case 
8:{
            
            
            
give_item(id"weapon_smokegrenade")
            
            
            
client_printidprint_chat"[Click #1] Voce comprou Granada Congelante !!")
            
        }
        case 

        {
            
set_user_maxspeed(id,get_user_maxspeed(id)+100.0)
            
            
client_print(id,print_chat,"[Click #1] Parabens agora voce e o usain bolt")
        }
        case 
10
        {
            
cs_set_user_armor(id255CS_ARMOR_VESTHELM)
            
            
client_printidprint_chat"[Click #1] Voce comprou 255 de Colete !!")
                
        }
                     
        case 
11:
        {
            
set_user_godmode(id1)
            
set_task(5.0"remove_godmode"id)
            
            
client_printidprint_chat"[Click #1] Voce comprou 5 segundos de Invensibilidade !!")
                
        }
    }
    return;
}

Add_Item(name[], costCsTeams:team) {
    static 
item_Data[items_data]
    
    
copy(item_Data[item_Name], charsmax(item_Data[item_Name]), name)
    
item_Data[item_Cost] = cost
    item_Data
[item_Team] = _:team
    
    ArrayPushArray
(g_aItemsitem_Data)     
}

public 
remove_gravity(id)
{
    if(
is_user_connected(id))
        
set_user_gravity(id1.0)
}

public 
remove_noclip(id)
{
    if(
is_user_connected(id))
        
set_user_noclip(id0)
}

public 
remove_godmode(id)
    
set_user_godmode(id0)

public 
remove_CTmodel(id)
    
cs_set_user_model(idg_szDefault_Model[id])

public 
remove_drug(id)
{
    if(!
has_drug[id])
        return;
    
    
message_begin(MSG_ONEgmsgSetFOV, {0,0,0}, id
    
write_byte(90
    
message_end() 
    
has_drug[id] = false
    client_print
idprint_chat"O Efeito da Maconha Acabou !!")
    
client_printidprint_chat"By:  !!")        
}

remove_colorMenu(menu[], len)
{
replace_all(menulen"\r""")
replace_all(menulen"\d""")
replace_all(menulen"\y""")
replace_all(menulen"\w""")

copyc(menulenmenu0)
}

public 
Reset_Stealth(id
{
set_user_renderingidkRenderFxNone000kRenderNormal)
client_print(idprint_chat"[Click #1] Sua Invisibilidade Acabou !!")
        
}

public 
set_speed(id)
{
if(
g_iSet[id])
{
    
set_user_maxspeed(id100.0)
}
}

public 
set_timer(id)
{
set_user_maxspeed(id250.0)
client_print(idprint_chat"[Click #1] Sua Velocidade Acabou !!")
        
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
I have an idea that is + / - so I think it would be simpler, when people click to buy the minigun, she would type / minigun automatically, but only that I can not do it = (

if someone could help me make this newbie very happy

Last edited by Juuhz; 09-04-2012 at 08:14.
Juuhz is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 09-03-2012 , 19:36   Re: add minigun store
Reply With Quote #2

Code:
register_plugin("[Click #1] ZM Base", "2.0", "Juuhz")
Nice. You aren't the author of this code. ;)
__________________




Last edited by pacheco; 09-03-2012 at 19:36.
pacheco is offline
Juuhz
Junior Member
Join Date: Sep 2012
Old 09-03-2012 , 21:18   Re: add minigun store
Reply With Quote #3

yeah i know, just edited
Juuhz is offline
Infernuz
Member
Join Date: May 2011
Old 09-03-2012 , 22:59   Re: add minigun store
Reply With Quote #4

http://forums.alliedmods.net/showthread.php?t=194936

Quote:
Originally Posted by Infernus
If user have enought money, and he clicks on SG550 item AND he won't have the flag ADMIN_LEVEL_H. His money will be gone.

To fix this, you will have to simply move the substraction money code to the end of the switch case and at the bottom make a check if user clicked on some item.
Quote:
Originally Posted by Juuhz
Hello, thank you very much, it worked just right now.
So what did you modify? I don't see the change.

Last edited by Infernuz; 09-03-2012 at 22:59.
Infernuz is offline
Send a message via ICQ to Infernuz
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 09-04-2012 , 03:02   Re: add minigun store
Reply With Quote #5

He modified author. Code is the same !
gogicaa is offline
Juuhz
Junior Member
Join Date: Sep 2012
Old 09-04-2012 , 08:13   Re: add minigun store
Reply With Quote #6

hey, I need help, if no one is asking you to help me close the topic ...
Already edited the author's name, sorry did not know it was forbidden, plus the name of the author of the plugins that are on my server is right

Once again, sorry about that'm newbie
Juuhz is offline
Old 09-05-2012, 17:27
Juuhz
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 10:19.


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