[CORRECION] Tienda para el equipo CT
#1
Hola, bueno les queria pedir si alguien me hace una tienda para solo el equipo CT que tenga esto y que se habra con /shop o /tienda

Tienda de Items:
Glow $1500
130 HP $5000
2 Granadas Smoke y una granada HE $7000
Super velocidad $9500
Doble Salto $16000

Si alguien tan amable que me pueda hacer eso se lo agradeceria mucho garcias
[Imagen: b_560_95_1.png]
Responder
#2
Las quieres por ronda? osea que dure toda la ronda. los items?
Si no te gusta algo, cámbialo. Si no lo puedes cambiar, cambia la forma en que piensas sobre ello <3
Responder
#3
Código PHP:
// creditos twistedeuphoria multijump

#include amxmodx
#include amxmisc
#include cstrike
#include fun
#include hamsandwich
#include engine

new has_speed[33]
new 
has_jump[33]

#define PRECIO_ITEM1    1500
#define PRECIO_ITEM2    5000
#define PRECIO_ITEM3    7000
#define PRECIO_ITEM4    9500
#define PRECIO_ITEM5    16000

#define VELOCIDAD    1000.0

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
    
register_clcmd("say /tienda""tiendita")

    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
register_event("CurWeapon""curweapon","be","1=1")

    
register_cvar("amx_maxjumps","1")
}

public 
client_putinserver(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false
}

public 
client_disconnect(id)
{
    
jumpnum[id] = 0
    dojump
[id] = false
}

public 
fw_PlayerSpawn_Post(id)
{
    
has_speed[id] = 0
    has_jump
[id] = 0

    
if(is_user_alive(id))
        
set_user_rendering(idkRenderFxGlowShell000kRenderNormal25)
}

public 
curweapon(id)
{
    if(
is_user_alive(id) && (has_speed[id]))
        
speed(id)
}    

public 
tiendita(id)
{
    if(!
is_user_admin(id))
    {
        
client_print(idprint_chat"No tienes acceso")
        return 
PLUGIN_HANDLED
    
}

    if(
get_user_team(id) != 2)
    {
        
client_print(idprint_chat"Debes ser CT")
        return 
PLUGIN_HANDLED
    
}

    new 
menu menu_create("menu de compra""menu_menu")

    
menu_additem(menu"Random Glow \r$1500""0"0)
    
menu_additem(menu"130 HP \r$5000""1"0)
    
menu_additem(menu"2 Smoke 1 HE \r$7000""2" 0)
    
menu_additem(menu"Super Velocidad \r$9500""3" 0)
    
menu_additem(menu"Doble Salto \r$16000""4" 0)

    
menu_setprop(menuMPROP_NUMBER_COLOR"\y");
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_setprop(menuMPROP_BACKNAME "Atras");
    
menu_setprop(menuMPROP_NEXTNAME "Mas");
    
menu_setprop(menuMPROP_EXITNAME"Salir")
    
menu_display(idmenu0)

    return 
PLUGIN_HANDLED
}

public 
menu_menu(idmenuitem)
{
    if ( 
item == MENU_EXIT )    
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}

    if(!
is_user_alive(id))
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}

    switch(
item
    {
        case 
0
        {
            if(
cs_get_user_money(id) >= PRECIO_ITEM1)
            {
                
cs_set_user_money(idcs_get_user_money(id) - PRECIO_ITEM1)
                
set_user_rendering(idkRenderFxGlowShellrandom_num(0,255), random_num(0,255), random_num(0,255), kRenderNormal25)
            }

            else
                
client_print(idprint_chat"No tienes dinero")
        } 

        case 
1:
        {
            if(
cs_get_user_money(id) >= PRECIO_ITEM2)
            {
                
cs_set_user_money(idcs_get_user_money(id) - PRECIO_ITEM2)
                
set_user_health(id130)
            }

            else
                
client_print(idprint_chat"No tienes dinero")
        }

        case 
2:
        {
            if(
cs_get_user_money(id) >= PRECIO_ITEM3)
            {
                
cs_set_user_money(idcs_get_user_money(id) - PRECIO_ITEM3)
                
give_item(id"weapon_smokegrenade")
                
cs_set_user_bpammo(idCSW_SMOKEGRENADE2)
                
give_item(id"weapon_hegrenade")
            }

            else
                
client_print(idprint_chat"No tienes dinero")
        }

        case 
3:
        {
            if(
cs_get_user_money(id) >= PRECIO_ITEM4)
            {
                
cs_set_user_money(idcs_get_user_money(id) - PRECIO_ITEM4)
                
speed(id)
                
has_speed[id] = 1
            
}

            else
                
client_print(idprint_chat"No tienes dinero")
        }

        case 
4
        {
            if(
cs_get_user_money(id) >= PRECIO_ITEM5)
            {
                
cs_set_user_money(idcs_get_user_money(id) - PRECIO_ITEM5)
                
has_jump[id] = 1
            
}

            else
                
client_print(idprint_chat"No tienes dinero")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
speed(id)
    
set_user_maxspeed(id Float:VELOCIDAD)

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

    
if(!has_jump[id]) return PLUGIN_CONTINUE

    
new nbut get_user_button(id)
    new 
obut get_user_oldbutton(id)
    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < get_cvar_num("amx_maxjumps"))
        {
            
dojump[id] = true
            jumpnum
[id]++
            return 
PLUGIN_CONTINUE
        
}
    }

    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        
jumpnum[id] = 0
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id)
{
    if(!
is_user_alive(id)) return PLUGIN_CONTINUE
    
    
if(!has_jump[id]) return PLUGIN_CONTINUE

    
if(dojump[id] == true)
    {
        new 
Float:velocity[3]    
        
entity_get_vector(id,EV_VEC_velocity,velocity)
        
velocity[2] = random_float(265.0,285.0)
        
entity_set_vector(id,EV_VEC_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE

Responder
#4
Sorry, no tested.
No vi lo de Nelo.
Código PHP:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < ColorChat >
#include < fakemeta_util >

new const PLUGIN [ ] = "[AMXX] Tienda";
new const 
VERSION [ ] = "1.0";
new const 
AUTHOR [ ] = "heNK'";



enum _:Tienda{
    
NOMBRE 40 ],
    
PRECIO
}

new const 
szTienda [ ] [ Tienda ] = {
    { 
"Glow"1500 }, //0
    
"130HP"5000 }, //1
    
"2 Smoke 1 He"7000 }, //2
    
"Super Velocidad"9500 }, //3
    
"Doble Salto"16000 //4
};

new const 
szPrefix [ ] = "^4[TIENDA]^1";

new 
g_iTiendaShop 33 ] [ ];

new 
bool:bIsJump 33 ] = false;
new 
g_iSaltosMax 33 ];

public 
plugin_init ( ) {
    
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_clcmd "say /tienda""cmdTienda" );
    
register_clcmd "say_team /tienda""cmdTienda" );
    
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink");
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink_Post");
}

public 
FW_PlayerPreThink iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
        
    
    new 
iButton pev iIndexpev_button );
    new 
iOldButton pev iIndexpev_oldbuttons );
    new 
iFlags pev iIndexpev_flags );
    
    
    if ( ( 
iButton IN_JUMP ) && !( iFlags FL_ONGROUND ) && !( iOldButton IN_JUMP ) ) {
        if ( 
g_iSaltosMax iIndex ] < ){
            
bIsJump iIndex ] = true;
            
g_iSaltosMax iIndex ]++;
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( ( 
iButton IN_JUMP ) && ( iFlags FL_ONGROUND ) ){
        
g_iSaltosMax iIndex ] = 0;
        return 
PLUGIN_CONTINUE;
    }
    
    
    
    return 
PLUGIN_HANDLED;
    
}

public 
FW_PlayerPreThink_Post iIndex ){ 
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
        
    
    if ( 
g_iTiendaShop iIndex ] [ ] ) {
        
        if ( 
bIsJump iIndex ] == true ) {
            
            new 
Float:flVelocity ];
                    
            
pev iIndexpev_velocityflVelocity );
                    
            
flVelocity ] += random_float 265.0285.0 );
                    
            
set_pev iIndexpev_velocityflVelocity );
            
            
bIsJump iIndex ] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
client_putinserver iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
client_disconnect iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
cmdTienda iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) ){
        
ColorChat iIndexGREEN"%s No puedes usar la tienda estando muerto o no siendo admin."szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    if ( ! ( 
cs_get_user_team iIndex ) == CS_TEAM_CT ) ) {
        
ColorChat iIndexGREEN"%s Probablemente no eres ^3CT"szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMenu menu_create "\y[TIENDA SHOP] \wCompras!""HandlerComprasMenu" );
    
    static 
iLen 256 ]; //256=MAX BUFFER.
    
    
new iMoney cs_get_user_money iIndex );
    
    for ( new 
0sizeof szTienda ); i++ ){            
        if ( 
cs_get_user_money iIndex ) < szTienda ] [ PRECIO ] )
            
formatex iLensizeof iLen ), "%s \y[$%d] \d(TIENES $%d, restante \y%d\d)"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ], iMoneyszTienda ] [ PRECIO ] - iMoney );
        else
            
formatex iLensizeof iLen ), "%s \y[$%d]"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ] );
        
        
        
menu_additem iMenuiLen );
    }
    
    
menu_setprop iMenuMPROP_EXITNAME"Salir" );
    
menu_setprop iMenuMPROP_NEXTNAME"Siguiente" );
    
menu_setprop iMenuMPROP_BACKNAME"Atras" );
    
menu_setprop iMenu,  MPROP_NUMBER_COLOR"\y" );
    
    
menu_display iIndexiMenu );
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
            
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
            
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 15.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
        
    
}

public 
RemoverVelocidad iIndex ) {
    
    
fm_set_user_maxspeed iIndex250.0 );
    
ColorChat iIndexGREEN"%s La velocidad se te termino"szPrefix );
    

Responder
#5
(18/07/2018, 12:03 AM)Saber escribió: Las quieres por ronda? osea que dure toda la ronda. los items?

Sii quiero que los items duren una sola ronda y que la velocidad sea por 20 segundos y el doble salto hasta que se termine la ronda y que la pasar los 20 segundos de la velocidad le diga un mensaje en el chat se te ha acabado la super velocidad y que cada item se pueda comprar una vez por ronda porfavor men me equivoque en el titulo la tienda era para el equipo cT no para los admins sorry
[Imagen: b_560_95_1.png]
Responder
#6
(18/07/2018, 02:12 PM)Killers-. escribió:
(18/07/2018, 12:03 AM)Saber escribió: Las quieres por ronda? osea que dure toda la ronda. los items?

Sii quiero que los items duren una sola ronda y que la velocidad sea por 20 segundos y el doble salto hasta que se termine la ronda y que la pasar los 20 segundos de la velocidad le diga un mensaje en el chat se te ha acabado la super velocidad y que cada item se pueda comprar una vez por ronda porfavor men me equivoque en el titulo la tienda era para el equipo cT no para los admins sorry

Cuando haces perder el tiempo a todos... Whatdone

Lo que tu pides puedes buscarlo en tutoriales, esta bien que la gente te ayude y todo pero tu también deberias decir algo en ves de hacer C&P? pero bueno no puedo culparte todos cometemos errores
Responder
#7
(18/07/2018, 08:00 PM)Nazy.- escribió:
(18/07/2018, 02:12 PM)Killers-. escribió:
(18/07/2018, 12:03 AM)Saber escribió: Las quieres por ronda? osea que dure toda la ronda. los items?

Sii quiero que los items duren una sola ronda y que la velocidad sea por 20 segundos y el doble salto hasta que se termine la ronda y que la pasar los 20 segundos de la velocidad le diga un mensaje en el chat se te ha acabado la super velocidad y que cada item se pueda comprar una vez por ronda porfavor men me equivoque en el titulo la tienda era para el equipo cT no para los admins sorry

Cuando haces perder el tiempo a todos... Whatdone

Lo que tu pides puedes buscarlo en tutoriales, esta bien que la gente te ayude y todo pero tu también deberias decir algo en ves de hacer C&P? pero bueno no puedo culparte todos cometemos errores

Está en la sección de Pedidos de Plugin, no es necesario responder de esa manera al usuario del Thread.
Responder
#8
Toma..
Código PHP:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < ColorChat >
#include < fakemeta_util >

new const PLUGIN [ ] = "[AMXX] Tienda";
new const 
VERSION [ ] = "1.1";
new const 
AUTHOR [ ] = "heNK'";



enum _:Tienda{
    
NOMBRE 40 ],
    
PRECIO
}

new const 
szTienda [ ] [ Tienda ] = {
    { 
"Glow"1500 }, //0
    
"130HP"5000 }, //1
    
"2 Smoke 1 He"7000 }, //2
    
"Super Velocidad"9500 }, //3
    
"Doble Salto"16000 //4
};

new const 
szPrefix [ ] = "^4[TIENDA]^1";

new 
g_iTiendaShop 33 ] [ ];

new 
bool:bIsJump 33 ] = false;
new 
g_iSaltosMax 33 ];

public 
plugin_init ( ) {
    
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_clcmd "say /tienda""cmdTienda" );
    
register_clcmd "say_team /tienda""cmdTienda" );
    
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink");
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink_Post");
    
    
register_event "HLTV""eventRoundStart""a""1=0""2=0" );
}

public 
eventRoundStart ( ){
    
    for ( new 
1<= get_maxplayers ( ); i++ ){
        
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
    }
}
        

public 
FW_PlayerPreThink iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    new 
iButton pev iIndexpev_button );
    new 
iOldButton pev iIndexpev_oldbuttons );
    new 
iFlags pev iIndexpev_flags );
    
    
    if ( ( 
iButton IN_JUMP ) && !( iFlags FL_ONGROUND ) && !( iOldButton IN_JUMP ) ) {
        if ( 
g_iSaltosMax iIndex ] < ){
            
bIsJump iIndex ] = true;
            
g_iSaltosMax iIndex ]++;
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( ( 
iButton IN_JUMP ) && ( iFlags FL_ONGROUND ) ){
        
g_iSaltosMax iIndex ] = 0;
        return 
PLUGIN_CONTINUE;
    }
    
    
    
    return 
PLUGIN_HANDLED;
    
}

public 
FW_PlayerPreThink_Post iIndex ){ 
    
    if ( !
is_user_alive iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    if ( 
g_iTiendaShop iIndex ] [ ] ) {
        
        if ( 
bIsJump iIndex ] == true ) {
            
            new 
Float:flVelocity ];
            
            
pev iIndexpev_velocityflVelocity );
            
            
flVelocity ] += random_float 265.0285.0 );
            
            
set_pev iIndexpev_velocityflVelocity );
            
            
bIsJump iIndex ] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
client_putinserver iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
client_disconnect iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
cmdTienda iIndex ) {
    
    if ( !
is_user_alive iIndex ) ){
        
ColorChat iIndexGREEN"%s No puedes usar la tienda estando muerto."szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    if ( ! ( 
cs_get_user_team iIndex ) == CS_TEAM_CT ) ) {
        
ColorChat iIndexGREEN"%s Probablemente no eres ^3CT"szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMenu menu_create "\y[TIENDA SHOP] \wCompras!""HandlerComprasMenu" );
    
    static 
iLen 256 ]; //256=MAX BUFFER.
    
    
new iMoney cs_get_user_money iIndex );
    
    for ( new 
0sizeof szTienda ); i++ ){            
        if ( 
cs_get_user_money iIndex ) < szTienda ] [ PRECIO ] )
            
formatex iLensizeof iLen ), "%s \y[$%d] \d(TIENES $%d, restante \y%d\d)"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ], iMoneyszTienda ] [ PRECIO ] - iMoney );
        else
            
formatex iLensizeof iLen ), "%s \y[$%d]"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ] );
        
        
        
menu_additem iMenuiLen );
    }
    
    
menu_setprop iMenuMPROP_EXITNAME"Salir" );
    
menu_setprop iMenuMPROP_NEXTNAME"Siguiente" );
    
menu_setprop iMenuMPROP_BACKNAME"Atras" );
    
menu_setprop iMenu,  MPROP_NUMBER_COLOR"\y" );
    
    
menu_display iIndexiMenu );
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    
}

public 
RemoverVelocidad iIndex ) {
    
    
fm_set_user_maxspeed iIndex250.0 );
    
ColorChat iIndexGREEN"%s La velocidad se te termino"szPrefix );
    

Responder
#9
(18/07/2018, 08:50 PM)Cristian escribió:
(18/07/2018, 08:00 PM)Nazy.- escribió:
(18/07/2018, 02:12 PM)Killers-. escribió:
(18/07/2018, 12:03 AM)Saber escribió: Las quieres por ronda? osea que dure toda la ronda. los items?

Sii quiero que los items duren una sola ronda y que la velocidad sea por 20 segundos y el doble salto hasta que se termine la ronda y que la pasar los 20 segundos de la velocidad le diga un mensaje en el chat se te ha acabado la super velocidad y que cada item se pueda comprar una vez por ronda porfavor men me equivoque en el titulo la tienda era para el equipo cT no para los admins sorry

Cuando haces perder el tiempo a todos... Whatdone

Lo que tu pides puedes buscarlo en tutoriales, esta bien que la gente te ayude y todo pero tu también deberias decir algo en ves de hacer C&P? pero bueno no puedo culparte todos cometemos errores

Está en la sección de Pedidos de Plugin, no es necesario responder de esa manera al usuario del Thread.
Responder
#10
(18/07/2018, 09:31 PM)Niper.-. escribió: Toma..
Código PHP:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < ColorChat >
#include < fakemeta_util >

new const PLUGIN [ ] = "[AMXX] Tienda";
new const 
VERSION [ ] = "1.1";
new const 
AUTHOR [ ] = "heNK'";



enum _:Tienda{
    
NOMBRE 40 ],
    
PRECIO
}

new const 
szTienda [ ] [ Tienda ] = {
    { 
"Glow"1500 }, //0
    
"130HP"5000 }, //1
    
"2 Smoke 1 He"7000 }, //2
    
"Super Velocidad"9500 }, //3
    
"Doble Salto"16000 //4
};

new const 
szPrefix [ ] = "^4[TIENDA]^1";

new 
g_iTiendaShop 33 ] [ ];

new 
bool:bIsJump 33 ] = false;
new 
g_iSaltosMax 33 ];

public 
plugin_init ( ) {
    
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_clcmd "say /tienda""cmdTienda" );
    
register_clcmd "say_team /tienda""cmdTienda" );
    
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink");
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink_Post");
    
    
register_event "HLTV""eventRoundStart""a""1=0""2=0" );
}

public 
eventRoundStart ( ){
    
    for ( new 
1<= get_maxplayers ( ); i++ ){
        
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
    }
}
        

public 
FW_PlayerPreThink iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    new 
iButton pev iIndexpev_button );
    new 
iOldButton pev iIndexpev_oldbuttons );
    new 
iFlags pev iIndexpev_flags );
    
    
    if ( ( 
iButton IN_JUMP ) && !( iFlags FL_ONGROUND ) && !( iOldButton IN_JUMP ) ) {
        if ( 
g_iSaltosMax iIndex ] < ){
            
bIsJump iIndex ] = true;
            
g_iSaltosMax iIndex ]++;
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( ( 
iButton IN_JUMP ) && ( iFlags FL_ONGROUND ) ){
        
g_iSaltosMax iIndex ] = 0;
        return 
PLUGIN_CONTINUE;
    }
    
    
    
    return 
PLUGIN_HANDLED;
    
}

public 
FW_PlayerPreThink_Post iIndex ){ 
    
    if ( !
is_user_alive iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    if ( 
g_iTiendaShop iIndex ] [ ] ) {
        
        if ( 
bIsJump iIndex ] == true ) {
            
            new 
Float:flVelocity ];
            
            
pev iIndexpev_velocityflVelocity );
            
            
flVelocity ] += random_float 265.0285.0 );
            
            
set_pev iIndexpev_velocityflVelocity );
            
            
bIsJump iIndex ] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
client_putinserver iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
client_disconnect iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
cmdTienda iIndex ) {
    
    if ( !
is_user_alive iIndex ) ){
        
ColorChat iIndexGREEN"%s No puedes usar la tienda estando muerto."szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    if ( ! ( 
cs_get_user_team iIndex ) == CS_TEAM_CT ) ) {
        
ColorChat iIndexGREEN"%s Probablemente no eres ^3CT"szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMenu menu_create "\y[TIENDA SHOP] \wCompras!""HandlerComprasMenu" );
    
    static 
iLen 256 ]; //256=MAX BUFFER.
    
    
new iMoney cs_get_user_money iIndex );
    
    for ( new 
0sizeof szTienda ); i++ ){            
        if ( 
cs_get_user_money iIndex ) < szTienda ] [ PRECIO ] )
            
formatex iLensizeof iLen ), "%s \y[$%d] \d(TIENES $%d, restante \y%d\d)"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ], iMoneyszTienda ] [ PRECIO ] - iMoney );
        else
            
formatex iLensizeof iLen ), "%s \y[$%d]"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ] );
        
        
        
menu_additem iMenuiLen );
    }
    
    
menu_setprop iMenuMPROP_EXITNAME"Salir" );
    
menu_setprop iMenuMPROP_NEXTNAME"Siguiente" );
    
menu_setprop iMenuMPROP_BACKNAME"Atras" );
    
menu_setprop iMenu,  MPROP_NUMBER_COLOR"\y" );
    
    
menu_display iIndexiMenu );
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    
}

public 
RemoverVelocidad iIndex ) {
    
    
fm_set_user_maxspeed iIndex250.0 );
    
ColorChat iIndexGREEN"%s La velocidad se te termino"szPrefix );
    


Gracias men me funciono pero podrias ponerle que al comprar un item diga en el chat por ejemplo esto Has comprado el item y salga el nombre del item que compro, y lo otro igual esque deja comprar un mismo item 2 veces y le quita el dinero podrias poner que solo los items se puedan comprar una vez por ronda porfavor parece que esta pero no funciona porfavor men gracias.
[Imagen: b_560_95_1.png]
Responder
#11
(19/07/2018, 01:50 PM)Killers-. escribió:
(18/07/2018, 09:31 PM)Niper.-. escribió: Toma..
Código PHP:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < ColorChat >
#include < fakemeta_util >

new const PLUGIN [ ] = "[AMXX] Tienda";
new const 
VERSION [ ] = "1.1";
new const 
AUTHOR [ ] = "heNK'";



enum _:Tienda{
    
NOMBRE 40 ],
    
PRECIO
}

new const 
szTienda [ ] [ Tienda ] = {
    { 
"Glow"1500 }, //0
    
"130HP"5000 }, //1
    
"2 Smoke 1 He"7000 }, //2
    
"Super Velocidad"9500 }, //3
    
"Doble Salto"16000 //4
};

new const 
szPrefix [ ] = "^4[TIENDA]^1";

new 
g_iTiendaShop 33 ] [ ];

new 
bool:bIsJump 33 ] = false;
new 
g_iSaltosMax 33 ];

public 
plugin_init ( ) {
    
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_clcmd "say /tienda""cmdTienda" );
    
register_clcmd "say_team /tienda""cmdTienda" );
    
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink");
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink_Post");
    
    
register_event "HLTV""eventRoundStart""a""1=0""2=0" );
}

public 
eventRoundStart ( ){
    
    for ( new 
1<= get_maxplayers ( ); i++ ){
        
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
    }
}
        

public 
FW_PlayerPreThink iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    new 
iButton pev iIndexpev_button );
    new 
iOldButton pev iIndexpev_oldbuttons );
    new 
iFlags pev iIndexpev_flags );
    
    
    if ( ( 
iButton IN_JUMP ) && !( iFlags FL_ONGROUND ) && !( iOldButton IN_JUMP ) ) {
        if ( 
g_iSaltosMax iIndex ] < ){
            
bIsJump iIndex ] = true;
            
g_iSaltosMax iIndex ]++;
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( ( 
iButton IN_JUMP ) && ( iFlags FL_ONGROUND ) ){
        
g_iSaltosMax iIndex ] = 0;
        return 
PLUGIN_CONTINUE;
    }
    
    
    
    return 
PLUGIN_HANDLED;
    
}

public 
FW_PlayerPreThink_Post iIndex ){ 
    
    if ( !
is_user_alive iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    if ( 
g_iTiendaShop iIndex ] [ ] ) {
        
        if ( 
bIsJump iIndex ] == true ) {
            
            new 
Float:flVelocity ];
            
            
pev iIndexpev_velocityflVelocity );
            
            
flVelocity ] += random_float 265.0285.0 );
            
            
set_pev iIndexpev_velocityflVelocity );
            
            
bIsJump iIndex ] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
client_putinserver iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
client_disconnect iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
cmdTienda iIndex ) {
    
    if ( !
is_user_alive iIndex ) ){
        
ColorChat iIndexGREEN"%s No puedes usar la tienda estando muerto."szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    if ( ! ( 
cs_get_user_team iIndex ) == CS_TEAM_CT ) ) {
        
ColorChat iIndexGREEN"%s Probablemente no eres ^3CT"szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMenu menu_create "\y[TIENDA SHOP] \wCompras!""HandlerComprasMenu" );
    
    static 
iLen 256 ]; //256=MAX BUFFER.
    
    
new iMoney cs_get_user_money iIndex );
    
    for ( new 
0sizeof szTienda ); i++ ){            
        if ( 
cs_get_user_money iIndex ) < szTienda ] [ PRECIO ] )
            
formatex iLensizeof iLen ), "%s \y[$%d] \d(TIENES $%d, restante \y%d\d)"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ], iMoneyszTienda ] [ PRECIO ] - iMoney );
        else
            
formatex iLensizeof iLen ), "%s \y[$%d]"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ] );
        
        
        
menu_additem iMenuiLen );
    }
    
    
menu_setprop iMenuMPROP_EXITNAME"Salir" );
    
menu_setprop iMenuMPROP_NEXTNAME"Siguiente" );
    
menu_setprop iMenuMPROP_BACKNAME"Atras" );
    
menu_setprop iMenu,  MPROP_NUMBER_COLOR"\y" );
    
    
menu_display iIndexiMenu );
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    
}

public 
RemoverVelocidad iIndex ) {
    
    
fm_set_user_maxspeed iIndex250.0 );
    
ColorChat iIndexGREEN"%s La velocidad se te termino"szPrefix );
    


Gracias men me funciono pero podrias ponerle que al comprar un item diga en el chat por ejemplo esto Has comprado el item y salga el nombre del item que compro, y lo otro igual esque deja comprar un mismo item 2 veces y le quita el dinero podrias poner que solo los items se puedan comprar una vez por ronda porfavor parece que esta pero no funciona porfavor men gracias.

Para el nombre del item.

Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 
Responder
#12
(19/07/2018, 02:15 PM)Chema escribió:
(19/07/2018, 01:50 PM)Killers-. escribió:
(18/07/2018, 09:31 PM)Niper.-. escribió: Toma..
Código PHP:
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < ColorChat >
#include < fakemeta_util >

new const PLUGIN [ ] = "[AMXX] Tienda";
new const 
VERSION [ ] = "1.1";
new const 
AUTHOR [ ] = "heNK'";



enum _:Tienda{
    
NOMBRE 40 ],
    
PRECIO
}

new const 
szTienda [ ] [ Tienda ] = {
    { 
"Glow"1500 }, //0
    
"130HP"5000 }, //1
    
"2 Smoke 1 He"7000 }, //2
    
"Super Velocidad"9500 }, //3
    
"Doble Salto"16000 //4
};

new const 
szPrefix [ ] = "^4[TIENDA]^1";

new 
g_iTiendaShop 33 ] [ ];

new 
bool:bIsJump 33 ] = false;
new 
g_iSaltosMax 33 ];

public 
plugin_init ( ) {
    
    
    
register_plugin PLUGINVERSIONAUTHOR );
    
    
register_clcmd "say /tienda""cmdTienda" );
    
register_clcmd "say_team /tienda""cmdTienda" );
    
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink");
    
register_forward FM_PlayerPreThink"FW_PlayerPreThink_Post");
    
    
register_event "HLTV""eventRoundStart""a""1=0""2=0" );
}

public 
eventRoundStart ( ){
    
    for ( new 
1<= get_maxplayers ( ); i++ ){
        
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
        
g_iTiendaShop ] [ ] = false;
    }
}
        

public 
FW_PlayerPreThink iIndex ) {
    
    if ( !
is_user_alive iIndex ) || !is_user_admin iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    new 
iButton pev iIndexpev_button );
    new 
iOldButton pev iIndexpev_oldbuttons );
    new 
iFlags pev iIndexpev_flags );
    
    
    if ( ( 
iButton IN_JUMP ) && !( iFlags FL_ONGROUND ) && !( iOldButton IN_JUMP ) ) {
        if ( 
g_iSaltosMax iIndex ] < ){
            
bIsJump iIndex ] = true;
            
g_iSaltosMax iIndex ]++;
            return 
PLUGIN_HANDLED;
        }
    }
    
    if ( ( 
iButton IN_JUMP ) && ( iFlags FL_ONGROUND ) ){
        
g_iSaltosMax iIndex ] = 0;
        return 
PLUGIN_CONTINUE;
    }
    
    
    
    return 
PLUGIN_HANDLED;
    
}

public 
FW_PlayerPreThink_Post iIndex ){ 
    
    if ( !
is_user_alive iIndex ) )
        return 
PLUGIN_HANDLED;
    
    
    if ( 
g_iTiendaShop iIndex ] [ ] ) {
        
        if ( 
bIsJump iIndex ] == true ) {
            
            new 
Float:flVelocity ];
            
            
pev iIndexpev_velocityflVelocity );
            
            
flVelocity ] += random_float 265.0285.0 );
            
            
set_pev iIndexpev_velocityflVelocity );
            
            
bIsJump iIndex ] = false;
            return 
PLUGIN_CONTINUE;
        }
    }
    
    return 
PLUGIN_CONTINUE;
    
}

public 
client_putinserver iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
client_disconnect iIndex ){
    
g_iSaltosMax iIndex ] = 0;
    
bIsJump iIndex ] = false;
}

public 
cmdTienda iIndex ) {
    
    if ( !
is_user_alive iIndex ) ){
        
ColorChat iIndexGREEN"%s No puedes usar la tienda estando muerto."szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    if ( ! ( 
cs_get_user_team iIndex ) == CS_TEAM_CT ) ) {
        
ColorChat iIndexGREEN"%s Probablemente no eres ^3CT"szPrefix );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMenu menu_create "\y[TIENDA SHOP] \wCompras!""HandlerComprasMenu" );
    
    static 
iLen 256 ]; //256=MAX BUFFER.
    
    
new iMoney cs_get_user_money iIndex );
    
    for ( new 
0sizeof szTienda ); i++ ){            
        if ( 
cs_get_user_money iIndex ) < szTienda ] [ PRECIO ] )
            
formatex iLensizeof iLen ), "%s \y[$%d] \d(TIENES $%d, restante \y%d\d)"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ], iMoneyszTienda ] [ PRECIO ] - iMoney );
        else
            
formatex iLensizeof iLen ), "%s \y[$%d]"szTienda ] [ NOMBRE ], szTienda ] [ PRECIO ] );
        
        
        
menu_additem iMenuiLen );
    }
    
    
menu_setprop iMenuMPROP_EXITNAME"Salir" );
    
menu_setprop iMenuMPROP_NEXTNAME"Siguiente" );
    
menu_setprop iMenuMPROP_BACKNAME"Atras" );
    
menu_setprop iMenu,  MPROP_NUMBER_COLOR"\y" );
    
    
menu_display iIndexiMenu );
    
    return 
PLUGIN_HANDLED;
}

public 
HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    
}

public 
RemoverVelocidad iIndex ) {
    
    
fm_set_user_maxspeed iIndex250.0 );
    
ColorChat iIndexGREEN"%s La velocidad se te termino"szPrefix );
    


Gracias men me funciono pero podrias ponerle que al comprar un item diga en el chat por ejemplo esto Has comprado el item y salga el nombre del item que compro, y lo otro igual esque deja comprar un mismo item 2 veces y le quita el dinero podrias poner que solo los items se puedan comprar una vez por ronda porfavor parece que esta pero no funciona porfavor men gracias.

Para el nombre del item.

Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 

Donde va eso men y como hago para que solo se puedan comprar los items una vez por ronda
[Imagen: b_560_95_1.png]
Responder
#13
Acá va, ese plugin ya tiene para que solo puedas comprar los items una vez por ronda.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 
    return 
PLUGIN_HANDLED;
    
    
    

Responder
#14
(19/07/2018, 04:49 PM)Chema escribió: Acá va, ese plugin ya tiene para que solo puedas comprar los items una vez por ronda.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 
    return 
PLUGIN_HANDLED;
    
    
    


Amigo dice el mensaje ya has comprado este item y te quita el dinero puedes arreglar eso y puedes poner de que el glow sea de color eleatorio porfavor pls gracias
[Imagen: b_560_95_1.png]
Responder
#15
Edita esta línea.
Código PHP:
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 ); 
por esta:
Código PHP:
fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 

Y esta.
Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 
por esta
Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 
Responder
#16
(19/07/2018, 08:00 PM)Niper.-. escribió: Edita esta línea.
Código PHP:
fm_set_rendering iIndexkRenderFxGlowShell255125127kRenderNormal35 ); 
por esta:
Código PHP:
fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 

Y esta.
Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item !g%s!y."szPrefixszTienda iItem ] [ NOMBRE ] ); 
por esta
Código PHP:
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 

Amigo si no fuera mucha molesta me lo podrias pasar el codigo listo y modificado esque no encuentro las lineas y no me compila porfavor
[Imagen: b_560_95_1.png]
Responder
#17
Código PHP:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

enum tienda_caracteristicas
{
    
NOMBRE[75],
    
ITEM_LIMIT,
    
ITEM_COST,
}
enum _:ITEMS
{
    
GLOW,
    
HP,
    
GRANADAS,
    
SUPERVELOCIDAD,
    
DOBLESALTO
};
new const 
SHOP_ITEMS[][tienda_caracteristicas] = 

    { 
"Glow color random"11500},
    { 
"+130 HP Extra"15000}, 
    { 
"2 SmokeGrenade & 1 HeGrenade"17000},
    { 
"Super Velocidad"19500},
    { 
"Doble Salto"116000}
}

new 
Limite[33][ITEMS];
new 
g_maxplayers

new g_maxJumps 2

new jumpnum[33] = 0
new bool:dojump[33] = false
new g_multijumps[33] = 0
new bool:g_speed[33]

new const 
szPrefijo[] = "^4[AMXX-ES]^1"

public plugin_init()
{
    
register_plugin("Shop Items""1.0""Cristian");
    
register_clcmd("say /tienda""OpenTienda")
    
register_clcmd("say_team /tienda""OpenTienda")

    
register_forward(FM_PlayerPreThink"FW_PlayerPreThink")
    
register_forward(FM_PlayerPostThink"FW_PlayerPostThink")

    
register_event("HLTV""event_round_start""a""1=0""2=0")

    
g_maxplayers get_maxplayers();
}
public 
event_round_start()
{    
    for (new 
1g_maxplayersi++)
    {
        if(
is_user_alive(i))
        {
            for (new 
ite 0ite ITEMSite++)
            {
                
Limite[i][ite] = 0
                dojump
[i] = false
                jumpnum
[i] = false
                g_multijumps
[i] = false
                g_speed
[i] = false
                set_rendering
(i)
            }
        }
    }
}
public 
OpenTienda(id)
{
    if(!(
cs_get_user_team(id) == CS_TEAM_CT))
    {
        
ChatColor(id"%s Tienda disponible solo para el equipo Counter-Terrorista."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
is_user_alive(id))
    {
        
ChatColor(id"%s Debes estar vivo para poder utilizar la tienda."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    static 
Menusztext[60], i;
    
Menu menu_create("\r[AMXX-ES] \yMercado de Compras:""OpenTienda_Handler");

    for(
0sizeof(SHOP_ITEMS); i++)
    {
        if(
Limite[id][i] == 1)
        
format(sztextcharsmax(sztext), "\d%s \d[COMPRADO]"SHOP_ITEMS[i][NOMBRE]);

        else
        
format(sztextcharsmax(sztext), "\w%s \r[$%d]"SHOP_ITEMS[i][NOMBRE], SHOP_ITEMS[i][ITEM_COST]);

        
menu_additem(Menusztext);
    }
    
menu_setprop(MenuMPROP_EXITNAME"Cerrar");
    
menu_display(idMenu);
    return 
PLUGIN_HANDLED;
}
public 
OpenTienda_Handler(idMenuItem)
{
    if(
Item == MENU_EXIT || !is_user_alive(id))
    {
        
menu_destroy(Menu);
        return;
    }
    static 
cost;
    
cost SHOP_ITEMS[Item][ITEM_COST];

    if(
Limite[id][Item] == SHOP_ITEMS[Item][ITEM_LIMIT])
    {
        
ChatColor(id"%s Solo puedes comprar un item de cada uno por ronda."szPrefijo)
        
OpenTienda(id)
        return;
    }
    if(
cs_get_user_money(id) < cost)
    {
        
ChatColor(id"%s No tienes suficiente dinero para comprar este item."szPrefijo)
        return;
    }   
        
    
Comprar_Items(idItemcost);
    
menu_destroy(Menu)
    return;
}
Comprar_Items(idItemcost)
{
    switch(
Item)
    {
        case 
GLOW set_rendering(idkRenderFxGlowShellrandom(255), random(255), random(255), kRenderNormal15)
        case 
HP set_user_health(idget_user_health(id) + 130)
        case 
GRANADAS :
        {
            
give_item(id"weapon_smokegrenade");
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_SMOKEGRENADE2)
        }
        case 
SUPERVELOCIDAD :
        {
            
g_speed[id] = true
            set_user_maxspeed
(idFloat500.0)
            
set_task(20.0"Remover_Velocidad"id)
        }
        case 
DOBLESALTO DobleSalto(id)
    }
    
Limite[id][Item]++
    
cs_set_user_money(idcs_get_user_money(id) - cost);
    
ChatColor(id"%s Has comprado el item ^4%s^1."szPrefijoSHOP_ITEMS[Item][NOMBRE])
    return 
PLUGIN_HANDLED
}
public 
FW_PlayerPreThink(id)
{
    if(!
is_user_alive(id) && g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
new nbut pev(id,pev_button);
    new 
obut pev(id,pev_oldbuttons);

    if((
nbut IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < g_multijumps[id])
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}
public 
FW_PlayerPostThink(id)
{
    if(!
is_user_alive(id) || !g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
if(dojump[id] == true)
    {
        new 
Float:velocity[3];
        
pev(id,pev_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
set_pev(id,pev_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}    
public 
DobleSalto(id)
{
    if (
g_multijumps[id] < g_maxJumps || !g_maxJumps)
    {
        
g_multijumps[id]++;    
    
        
set_hudmessage(0255255, -1.00.310.15.00.1)
        
show_hudmessage(id"El maximo de saltos consecutivos es de 2 Veces")
    }
}
public 
Remover_Velocidad(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
    return;
    
    
set_user_maxspeed(idFloat320.0)
    
ChatColor(id"%s Se te acabo la ^4Super Velocidad^1."szPrefijo)
    
g_speed[id] = false
}
stock ChatColorid, const input[ ], any:... ) 
{
    static 
szMsg191 ], msgSayText;
    
    if( !
msgSayText msgSayText get_user_msgid"SayText" );
    
    
vformatszMsg190input);
    
    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!team""^3" );
    
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id );
    
write_byteid id 33 );
    
write_stringszMsg );
    
message_end( );

Steam
Responder
#18
(20/07/2018, 08:38 AM)Pablo_1998 escribió:
Código PHP:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

enum tienda_caracteristicas
{
    
NOMBRE[75],
    
ITEM_LIMIT,
    
ITEM_COST,
}
enum _:ITEMS
{
    
GLOW,
    
HP,
    
GRANADAS,
    
SUPERVELOCIDAD,
    
DOBLESALTO
};
new const 
SHOP_ITEMS[][tienda_caracteristicas] = 

    { 
"Glow color random"11500},
    { 
"+130 HP Extra"15000}, 
    { 
"2 SmokeGrenade & 1 HeGrenade"17000},
    { 
"Super Velocidad"19500},
    { 
"Doble Salto"116000}
}

new 
Limite[33][ITEMS];
new 
g_maxplayers

new g_maxJumps 2

new jumpnum[33] = 0
new bool:dojump[33] = false
new g_multijumps[33] = 0
new bool:g_speed[33]

new const 
szPrefijo[] = "^4[AMXX-ES]^1"

public plugin_init()
{
    
register_plugin("Shop Items""1.0""Cristian");
    
register_clcmd("say /tienda""OpenTienda")
    
register_clcmd("say_team /tienda""OpenTienda")

    
register_forward(FM_PlayerPreThink"FW_PlayerPreThink")
    
register_forward(FM_PlayerPostThink"FW_PlayerPostThink")

    
register_event("HLTV""event_round_start""a""1=0""2=0")

    
g_maxplayers get_maxplayers();
}
public 
event_round_start()
{    
    for (new 
1g_maxplayersi++)
    {
        if(
is_user_alive(i))
        {
            for (new 
ite 0ite ITEMSite++)
            {
                
Limite[i][ite] = 0
                dojump
[i] = false
                jumpnum
[i] = false
                g_multijumps
[i] = false
                g_speed
[i] = false
                set_rendering
(i)
            }
        }
    }
}
public 
OpenTienda(id)
{
    if(!(
cs_get_user_team(id) == CS_TEAM_CT))
    {
        
ChatColor(id"%s Tienda disponible solo para el equipo Counter-Terrorista."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
is_user_alive(id))
    {
        
ChatColor(id"%s Debes estar vivo para poder utilizar la tienda."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    static 
Menusztext[60], i;
    
Menu menu_create("\r[AMXX-ES] \yMercado de Compras:""OpenTienda_Handler");

    for(
0sizeof(SHOP_ITEMS); i++)
    {
        if(
Limite[id][i] == 1)
        
format(sztextcharsmax(sztext), "\d%s \d[COMPRADO]"SHOP_ITEMS[i][NOMBRE]);

        else
        
format(sztextcharsmax(sztext), "\w%s \r[$%d]"SHOP_ITEMS[i][NOMBRE], SHOP_ITEMS[i][ITEM_COST]);

        
menu_additem(Menusztext);
    }
    
menu_setprop(MenuMPROP_EXITNAME"Cerrar");
    
menu_display(idMenu);
    return 
PLUGIN_HANDLED;
}
public 
OpenTienda_Handler(idMenuItem)
{
    if(
Item == MENU_EXIT || !is_user_alive(id))
    {
        
menu_destroy(Menu);
        return;
    }
    static 
cost;
    
cost SHOP_ITEMS[Item][ITEM_COST];

    if(
Limite[id][Item] == SHOP_ITEMS[Item][ITEM_LIMIT])
    {
        
ChatColor(id"%s Solo puedes comprar un item de cada uno por ronda."szPrefijo)
        
OpenTienda(id)
        return;
    }
    if(
cs_get_user_money(id) < cost)
    {
        
ChatColor(id"%s No tienes suficiente dinero para comprar este item."szPrefijo)
        return;
    }   
        
    
Comprar_Items(idItemcost);
    
menu_destroy(Menu)
    return;
}
Comprar_Items(idItemcost)
{
    switch(
Item)
    {
        case 
GLOW set_rendering(idkRenderFxGlowShellrandom(255), random(255), random(255), kRenderNormal15)
        case 
HP set_user_health(idget_user_health(id) + 130)
        case 
GRANADAS :
        {
            
give_item(id"weapon_smokegrenade");
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_SMOKEGRENADE2)
        }
        case 
SUPERVELOCIDAD :
        {
            
g_speed[id] = true
            set_user_maxspeed
(idFloat500.0)
            
set_task(20.0"Remover_Velocidad"id)
        }
        case 
DOBLESALTO DobleSalto(id)
    }
    
Limite[id][Item]++
    
cs_set_user_money(idcs_get_user_money(id) - cost);
    
ChatColor(id"%s Has comprado el item ^4%s^1."szPrefijoSHOP_ITEMS[Item][NOMBRE])
    return 
PLUGIN_HANDLED
}
public 
FW_PlayerPreThink(id)
{
    if(!
is_user_alive(id) && g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
new nbut pev(id,pev_button);
    new 
obut pev(id,pev_oldbuttons);

    if((
nbut IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < g_multijumps[id])
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}
public 
FW_PlayerPostThink(id)
{
    if(!
is_user_alive(id) || !g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
if(dojump[id] == true)
    {
        new 
Float:velocity[3];
        
pev(id,pev_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
set_pev(id,pev_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}    
public 
DobleSalto(id)
{
    if (
g_multijumps[id] < g_maxJumps || !g_maxJumps)
    {
        
g_multijumps[id]++;    
    
        
set_hudmessage(0255255, -1.00.310.15.00.1)
        
show_hudmessage(id"El maximo de saltos consecutivos es de 2 Veces")
    }
}
public 
Remover_Velocidad(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
    return;
    
    
set_user_maxspeed(idFloat320.0)
    
ChatColor(id"%s Se te acabo la ^4Super Velocidad^1."szPrefijo)
    
g_speed[id] = false
}
stock ChatColorid, const input[ ], any:... ) 
{
    static 
szMsg191 ], msgSayText;
    
    if( !
msgSayText msgSayText get_user_msgid"SayText" );
    
    
vformatszMsg190input);
    
    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!team""^3" );
    
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id );
    
write_byteid id 33 );
    
write_stringszMsg );
    
message_end( );

Gracias amigo funciona pero tiene algunos problemas como por ejemplo que si estas de CT y compras y despues te matas y empieza una nueva ronda de CT y entras a la tienda a comprar salen todos los items comprados y no te dejan comprarlos, tambien el doble salto cuando pasa una ronda sigue y deberia ser por una ronda el doble salto solo por una ronda, y tambien te queria pedir si podias poner que la tienda se abra en cierto tiempo porque es para un base builder y primero empieza el tiempo de construccion y que son dos minutos y 30 seg y me gustaria que al terminar ese tiempo pueda comprar el jugador porque si compra en ese tiempo como que despues viene la fase de probar las bases y se borra todo lo que compro entonces si puedes poner que para comprar en la tienda tenga que esperar primero a que termine la fase de construccion te lo agradeceria mucho gracias.
[Imagen: b_560_95_1.png]
Responder
#19
(20/07/2018, 08:38 AM)Pablo_1998 escribió:
Código PHP:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

enum tienda_caracteristicas
{
    
NOMBRE[75],
    
ITEM_LIMIT,
    
ITEM_COST,
}
enum _:ITEMS
{
    
GLOW,
    
HP,
    
GRANADAS,
    
SUPERVELOCIDAD,
    
DOBLESALTO
};
new const 
SHOP_ITEMS[][tienda_caracteristicas] = 

    { 
"Glow color random"11500},
    { 
"+130 HP Extra"15000}, 
    { 
"2 SmokeGrenade & 1 HeGrenade"17000},
    { 
"Super Velocidad"19500},
    { 
"Doble Salto"116000}
}

new 
Limite[33][ITEMS];
new 
g_maxplayers

new g_maxJumps 2

new jumpnum[33] = 0
new bool:dojump[33] = false
new g_multijumps[33] = 0
new bool:g_speed[33]

new const 
szPrefijo[] = "^4[AMXX-ES]^1"

public plugin_init()
{
    
register_plugin("Shop Items""1.0""Cristian");
    
register_clcmd("say /tienda""OpenTienda")
    
register_clcmd("say_team /tienda""OpenTienda")

    
register_forward(FM_PlayerPreThink"FW_PlayerPreThink")
    
register_forward(FM_PlayerPostThink"FW_PlayerPostThink")

    
register_event("HLTV""event_round_start""a""1=0""2=0")

    
g_maxplayers get_maxplayers();
}
public 
event_round_start()
{    
    for (new 
1g_maxplayersi++)
    {
        if(
is_user_alive(i))
        {
            for (new 
ite 0ite ITEMSite++)
            {
                
Limite[i][ite] = 0
                dojump
[i] = false
                jumpnum
[i] = false
                g_multijumps
[i] = false
                g_speed
[i] = false
                set_rendering
(i)
            }
        }
    }
}
public 
OpenTienda(id)
{
    if(!(
cs_get_user_team(id) == CS_TEAM_CT))
    {
        
ChatColor(id"%s Tienda disponible solo para el equipo Counter-Terrorista."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
is_user_alive(id))
    {
        
ChatColor(id"%s Debes estar vivo para poder utilizar la tienda."szPrefijo)
        return 
PLUGIN_HANDLED
    
}
    
    static 
Menusztext[60], i;
    
Menu menu_create("\r[AMXX-ES] \yMercado de Compras:""OpenTienda_Handler");

    for(
0sizeof(SHOP_ITEMS); i++)
    {
        if(
Limite[id][i] == 1)
        
format(sztextcharsmax(sztext), "\d%s \d[COMPRADO]"SHOP_ITEMS[i][NOMBRE]);

        else
        
format(sztextcharsmax(sztext), "\w%s \r[$%d]"SHOP_ITEMS[i][NOMBRE], SHOP_ITEMS[i][ITEM_COST]);

        
menu_additem(Menusztext);
    }
    
menu_setprop(MenuMPROP_EXITNAME"Cerrar");
    
menu_display(idMenu);
    return 
PLUGIN_HANDLED;
}
public 
OpenTienda_Handler(idMenuItem)
{
    if(
Item == MENU_EXIT || !is_user_alive(id))
    {
        
menu_destroy(Menu);
        return;
    }
    static 
cost;
    
cost SHOP_ITEMS[Item][ITEM_COST];

    if(
Limite[id][Item] == SHOP_ITEMS[Item][ITEM_LIMIT])
    {
        
ChatColor(id"%s Solo puedes comprar un item de cada uno por ronda."szPrefijo)
        
OpenTienda(id)
        return;
    }
    if(
cs_get_user_money(id) < cost)
    {
        
ChatColor(id"%s No tienes suficiente dinero para comprar este item."szPrefijo)
        return;
    }   
        
    
Comprar_Items(idItemcost);
    
menu_destroy(Menu)
    return;
}
Comprar_Items(idItemcost)
{
    switch(
Item)
    {
        case 
GLOW set_rendering(idkRenderFxGlowShellrandom(255), random(255), random(255), kRenderNormal15)
        case 
HP set_user_health(idget_user_health(id) + 130)
        case 
GRANADAS :
        {
            
give_item(id"weapon_smokegrenade");
            
give_item(id"weapon_hegrenade");
            
cs_set_user_bpammo(idCSW_SMOKEGRENADE2)
        }
        case 
SUPERVELOCIDAD :
        {
            
g_speed[id] = true
            set_user_maxspeed
(idFloat500.0)
            
set_task(20.0"Remover_Velocidad"id)
        }
        case 
DOBLESALTO DobleSalto(id)
    }
    
Limite[id][Item]++
    
cs_set_user_money(idcs_get_user_money(id) - cost);
    
ChatColor(id"%s Has comprado el item ^4%s^1."szPrefijoSHOP_ITEMS[Item][NOMBRE])
    return 
PLUGIN_HANDLED
}
public 
FW_PlayerPreThink(id)
{
    if(!
is_user_alive(id) && g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
new nbut pev(id,pev_button);
    new 
obut pev(id,pev_oldbuttons);

    if((
nbut IN_JUMP) && !(pev(id,pev_flags) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < g_multijumps[id])
        {
            
dojump[id] = true;
            
jumpnum[id]++;
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (pev(id,pev_flags) & FL_ONGROUND))
    {
        
jumpnum[id] = 0;
        return 
PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}
public 
FW_PlayerPostThink(id)
{
    if(!
is_user_alive(id) || !g_multijumps[id]) 
    return 
PLUGIN_CONTINUE

    
if(dojump[id] == true)
    {
        new 
Float:velocity[3];
        
pev(id,pev_velocity,velocity);
        
velocity[2] = random_float(265.0,285.0);
        
set_pev(id,pev_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}    
public 
DobleSalto(id)
{
    if (
g_multijumps[id] < g_maxJumps || !g_maxJumps)
    {
        
g_multijumps[id]++;    
    
        
set_hudmessage(0255255, -1.00.310.15.00.1)
        
show_hudmessage(id"El maximo de saltos consecutivos es de 2 Veces")
    }
}
public 
Remover_Velocidad(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
    return;
    
    
set_user_maxspeed(idFloat320.0)
    
ChatColor(id"%s Se te acabo la ^4Super Velocidad^1."szPrefijo)
    
g_speed[id] = false
}
stock ChatColorid, const input[ ], any:... ) 
{
    static 
szMsg191 ], msgSayText;
    
    if( !
msgSayText msgSayText get_user_msgid"SayText" );
    
    
vformatszMsg190input);
    
    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!team""^3" );
    
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id );
    
write_byteid id 33 );
    
write_stringszMsg );
    
message_end( );


Tanto costaba modificar el mío ? :S

Y toma.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
        
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    

Responder
#20
(21/07/2018, 01:18 PM)Niper.-. escribió: Tanto costaba modificar el mío ? :S
No me iba costar nada, simplemente el plugin ese de cristian lo utilizo para todo capaz a él también le servía.
Whatever
Steam
Responder
#21
(21/07/2018, 01:18 PM)Niper.-. escribió: Tanto costaba modificar el mío ? :S

Y toma.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
        
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    


Sigue teniendo el mismo problema que comento antes.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    if ( 
iMoney szTienda iItem ] [ PRECIO ] ){
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_iTiendaShop[iIndex][iItem] ) {
        
ColorChat iIndexGREEN"%s Ya compraste el item ^4%s"szPrefixszTienda[iItem][NOMBRE]);
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }

    switch ( 
iItem ) {
        case 
0fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 
        case 
1fm_set_user_health iIndex130 );
        case 
2: {
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
        }
        case 
3: {            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); // 20 Segundos.
        
}
    }

    
g_iTiendaShop [iIndex][iItem] = true;
    
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 

    return 
PLUGIN_HANDLED;

Responder
#22
(21/07/2018, 02:43 PM)Exertency escribió:
(21/07/2018, 01:18 PM)Niper.-. escribió: Tanto costaba modificar el mío ? :S

Y toma.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    
    if ( 
iMoney >= szTienda iItem ] [ PRECIO ] ){
        
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
        
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 
    }
    else{
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    
    switch ( 
iItem ) {
        case 
0:{
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
//item = 0. 
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
1: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_health iIndex130 );
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
2: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
3: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); //15 Segundos.
            
g_iTiendaShop iIndex ] [ ] = true;
        }
        case 
4: {
            if ( 
g_iTiendaShop iIndex ] [ ] ) {
                
                
ColorChat iIndexGREEN"%s Ya compraste este Item"szPrefix );
                return 
PLUGIN_HANDLED;
            }
            
            
g_iTiendaShop iIndex ] [ ] = true;
        }
    }
    
    return 
PLUGIN_HANDLED;
    
    
    


Sigue teniendo el mismo problema que comento antes.

Código PHP:
public HandlerComprasMenu iIndexiMenuiItem ){
    
    if ( 
iItem == MENU_EXIT ) {
        
menu_destroy iMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money iIndex );
    
    if ( 
iMoney szTienda iItem ] [ PRECIO ] ){
        
ColorChat iIndexGREEN"%s Te falta ^3($%d) ^1para comprar el item ^4%s"szPrefixszTienda iItem ] [ PRECIO ] - iMoneyszTienda iItem ] [ NOMBRE ] );
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }
    else if( 
g_iTiendaShop[iIndex][iItem] ) {
        
ColorChat iIndexGREEN"%s Ya compraste el item ^4%s"szPrefixszTienda[iItem][NOMBRE]);
        
cmdTienda iIndex );
        return 
PLUGIN_HANDLED;
    }

    switch ( 
iItem ) {
        case 
0fm_set_rendering iIndexkRenderFxGlowShellrandom_num 0255 ), random_num 0255 ), random_num 0255 ), kRenderNormal35 ); 
        case 
1fm_set_user_health iIndex130 );
        case 
2: {
            
fm_give_item iIndex"weapon_hegrenade" );
            
fm_give_item iIndex"weapon_smokegrenade" );
            
cs_set_user_bpammo iIndexCSW_SMOKEGRENADE);
        }
        case 
3: {            
            
fm_set_user_maxspeed iIndex350.0 );
            
set_task 20.0"RemoverVelocidad"iIndex ); // 20 Segundos.
        
}
    }

    
g_iTiendaShop [iIndex][iItem] = true;
    
cs_set_user_money iIndexiMoney szTienda iItem ] [ PRECIO ] )
    
ColorChat iIndexGREEN"%s Has comprado el item ^4%s^1."szPrefixszTienda iItem ] [ NOMBRE ] ); 

    return 
PLUGIN_HANDLED;


Ayudaaaa
[Imagen: b_560_95_1.png]
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)