[CTF] Tienda por natives.
#1
TIENDA POR NATIVES

Lo que trato de aportar es algo que e notado que mucha gente esta buscando.
es esto de tienda de natives por adrenalina y money, bueno aqui les ayudare...

Paso 1:
En tu mod jctf, vamos a la parte de
Código PHP:
public plugin_natives() 
y Registramos una nueva native:
Código PHP:
register_native("jctf_edit_adrenaline""native_edit_adrenaline"

Paso 2:
Nos vamos al final de el jctf, y Ponemos la función de la native
Código PHP:
public native_edit_adrenaline(iPluginiParams)
{
#if FEATURE_ADRENALINE == true
    
new id get_param(1)
    new 
Adrenaline
    
g_iAdrenaline[id] = Adrenaline
    player_hudAdrenaline
(id)
#else // FEATURE_ADRENALINE
    
log_error(AMX_ERR_NATIVE"jctf_get_adrenaline() does not work ! main jCTF plugin has FEATURE_ADRENALINE = false"
    return 
0
#endif // FEATURE_ADRENALINE

Bueno la función que nos dará esta native que hemos creado, sera editarle la adrenalina al jugador.

Paso 3:
Luego de tener nuestra native creada, procedemos a crear la tienda.

Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <jctf>

native Native1(id)        // 1
native Native2(id)        // 2
native Native3(id)         // 3

new const iPlugininfo[][]={"Tienda x Natives""3.0""Alejandro-."}
    
enum _:ARMAS {
    
aName[32],
    
aPrecio,
    
mPrecio,
}

new const 
ArmasNat[][ARMAS]=
{
//     [NAME]                        [AD]     [$] 
    
{"Barlog",                     70,     120},
    {
"Rock Guitar",             75,     120},
    {
"Thanatos III",             90,     140},
      {
"New Comen",                 70,     70},
      {
"Plasma Gun",                 90,     90},
      {
"Thanatos V",                 90,     100},
      {
"Gatling",                 90,     100},
    {
"Thunder Bolt",             100,     120},
    {
"Ak-47 Paladins",             100,     160},
      {
"Thanatos VII",             100,     1000},
    {
"Blaster",                 100,     1200}
}

public 
plugin_init()
{
    
register_plugin(iPlugininfo[0], iPlugininfo[1], iPlugininfo[2]);
    
register_clcmd("say /armas""fw_armas_nat");
}


public 
fw_armas_nat(id)
{
    if(!
is_user_alive(id)) 
    {
        
client_print_color(idprint_team_red"^4[^3AMXMOD^4]^1 Debes estar vivo para abrir este menu" )
        return 
PLUGIN_HANDLED;
    }

    new 
menu menu_create("\
        \r===================^n\
        \wTIENDA X NATIVES^n\
        \r===================\w"
"Hand_Menu")

    for(new 
0<sizeof ArmasNati++)
    {
        
menu_additem(menuArmasNat[i][aName], __menu_makecallback("item_callback"))
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\y<-\r Volver");
    
menu_setprop(menuMPROP_NEXTNAME"\y-> \rSiguiente");
    
menu_setprop(menuMPROP_EXITNAME"\y<\rX\y>\r Salir");
    
menu_display(idmenu0)

    return 
PLUGIN_HANDLED;
}

public 
item_callback(idmenuitem)
{
    if(
cs_get_user_money(id) < ArmasNat[item][mPrecio] || jctf_get_adrenaline(id) < ArmasNat[item][aPrecio])
        return 
ITEM_DISABLED;    
    return 
ITEM_ENABLED;
}

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

    switch(
item)
    {
        case 
0Native1(id)                // 1
        
case 1Native2(id)                // 2
        
case 2Native3(id)             // 3
    
}


    
jctf_edit_adrenaline(id, - ArmasNat[item][aPrecio]) //Editamos su adrenalina de esta forma, con la native ya creada
    
cs_set_user_money(idcs_get_user_money(id) - ArmasNat[item][mPrecio])
    
client_print_coloridprint_team_red"^4[^3OLG^4]^1 Compraste un:^4 %s ^1por: ^3%d ^1AD, ^3%d ^1$"ArmasNat[item][aName], ArmasNat[item][aPrecio], ArmasNat[item][mPrecio])
    return 
PLUGIN_HANDLED;

Y con esto tendriamos nuestra tienda por money y adrenalina.
Responder
#2
[Imagen: tenor.gif]

Responder
#3
(18/02/2019, 01:46 PM)Skylar escribió: [Imagen: tenor.gif]

Como lo harias tu por adrenalina xd?
Responder
#4
(18/02/2019, 01:24 AM)Alejandro escribió: TIENDA POR NATIVES

Lo que trato de aportar es algo que e notado que mucha gente esta buscando.
es esto de tienda de natives por adrenalina y money, bueno aqui les ayudare...

Paso 1:
En tu mod jctf, vamos a la parte de
Código PHP:
public plugin_natives() 
y Registramos una nueva native:
Código PHP:
register_native("jctf_edit_adrenaline""native_edit_adrenaline"

Paso 2:
Nos vamos al final de el jctf, y Ponemos la función de la native
Código PHP:
public native_edit_adrenaline(iPluginiParams)
{
#if FEATURE_ADRENALINE == true
    
new id get_param(1)
    new 
Adrenaline
    
g_iAdrenaline[id] = Adrenaline
    player_hudAdrenaline
(id)
#else // FEATURE_ADRENALINE
    
log_error(AMX_ERR_NATIVE"jctf_get_adrenaline() does not work ! main jCTF plugin has FEATURE_ADRENALINE = false"
    return 
0
#endif // FEATURE_ADRENALINE

Bueno la función que nos dará esta native que hemos creado, sera editarle la adrenalina al jugador.

Paso 3:
Luego de tener nuestra native creada, procedemos a crear la tienda.

Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <jctf>

native Native1(id)        // 1
native Native2(id)        // 2
native Native3(id)         // 3

new const iPlugininfo[][]={"Tienda x Natives""3.0""Alejandro-."}
    
enum _:ARMAS {
    
aName[32],
    
aPrecio,
    
mPrecio,
}

new const 
ArmasNat[][ARMAS]=
{
//     [NAME]                        [AD]     [$] 
    
{"Barlog",                     70,     120},
    {
"Rock Guitar",             75,     120},
    {
"Thanatos III",             90,     140},
      {
"New Comen",                 70,     70},
      {
"Plasma Gun",                 90,     90},
      {
"Thanatos V",                 90,     100},
      {
"Gatling",                 90,     100},
    {
"Thunder Bolt",             100,     120},
    {
"Ak-47 Paladins",             100,     160},
      {
"Thanatos VII",             100,     1000},
    {
"Blaster",                 100,     1200}
}

public 
plugin_init()
{
    
register_plugin(iPlugininfo[0], iPlugininfo[1], iPlugininfo[2]);
    
register_clcmd("say /armas""fw_armas_nat");
}


public 
fw_armas_nat(id)
{
    if(!
is_user_alive(id)) 
    {
        
client_print_color(idprint_team_red"^4[^3AMXMOD^4]^1 Debes estar vivo para abrir este menu" )
        return 
PLUGIN_HANDLED;
    }

    new 
menu menu_create("\
        \r===================^n\
        \wTIENDA X NATIVES^n\
        \r===================\w"
"Hand_Menu")

    for(new 
0<sizeof ArmasNati++)
    {
        
menu_additem(menuArmasNat[i][aName], __menu_makecallback("item_callback"))
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\y<-\r Volver");
    
menu_setprop(menuMPROP_NEXTNAME"\y-> \rSiguiente");
    
menu_setprop(menuMPROP_EXITNAME"\y<\rX\y>\r Salir");
    
menu_display(idmenu0)

    return 
PLUGIN_HANDLED;
}

public 
item_callback(idmenuitem)
{
    if(
cs_get_user_money(id) < ArmasNat[item][mPrecio] || jctf_get_adrenaline(id) < ArmasNat[item][aPrecio])
        return 
ITEM_DISABLED;    
    return 
ITEM_ENABLED;
}

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

    switch(
item)
    {
        case 
0Native1(id)                // 1
        
case 1Native2(id)                // 2
        
case 2Native3(id)             // 3
    
}


    
jctf_edit_adrenaline(id, - ArmasNat[item][aPrecio]) //Editamos su adrenalina de esta forma, con la native ya creada
    
cs_set_user_money(idcs_get_user_money(id) - ArmasNat[item][mPrecio])
    
client_print_coloridprint_team_red"^4[^3OLG^4]^1 Compraste un:^4 %s ^1por: ^3%d ^1AD, ^3%d ^1$"ArmasNat[item][aName], ArmasNat[item][aPrecio], ArmasNat[item][mPrecio])
    return 
PLUGIN_HANDLED;

Y con esto tendriamos nuestra tienda por money y adrenalina.


Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "client_print_color" on line 45
Warning: Expression has no effect on line 45
Error: Expected token: ";", but found ")" on line 45
Error: Invalid expression, assumed zero on line 45
Error: Too many error messages on one line on line 45

Compilation aborted.
4 Errors.
Could not locate output file

Ninguna de tu tienda compila xd alguna solución ?
Responder
#5
Tenes que usar una versión más reciente, usa AMXX 1.8.3
Responder
#6
(18/02/2019, 01:46 PM)Skylar escribió: [Imagen: tenor.gif]
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#7
(05/02/2020, 02:12 PM)Chema escribió: Tenes que usar una versión más reciente, usa AMXX 1.8.3

Gracias por eso me puse en la version 1.9.0 pero ahora me sale esto
AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Cannot read from file: "jctf" on line 4

Compilation aborted.
1 Error.
Could not locate output file

y tengo el include de jctf xd
Responder
#8
(05/02/2020, 02:53 PM)Manuelito1208 escribió:
(05/02/2020, 02:12 PM)Chema escribió: Tenes que usar una versión más reciente, usa AMXX 1.8.3

Gracias por eso me puse en la version 1.9.0 pero ahora me sale esto
AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Cannot read from file: "jctf" on line 4

Compilation aborted.
1 Error.
Could not locate output file

y tengo el include de jctf xd

https://forums.alliedmods.net/showthread.php?t=132115

Descargar jctf_api.zip y move jctf.inc a tu carpeta includes del compilador.
Responder
#9
(05/02/2020, 02:54 PM)Chema escribió:
(05/02/2020, 02:53 PM)Manuelito1208 escribió:
(05/02/2020, 02:12 PM)Chema escribió: Tenes que usar una versión más reciente, usa AMXX 1.8.3

Gracias por eso me puse en la version 1.9.0 pero ahora me sale esto
AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Cannot read from file: "jctf" on line 4

Compilation aborted.
1 Error.
Could not locate output file

y tengo el include de jctf xd

https://forums.alliedmods.net/showthread.php?t=132115

Descargar jctf_api.zip y move jctf.inc a tu carpeta includes del compilador.

me sale esto pacman : AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Invalid expression, assumed zero on line 69
Warning: Expression has no effect on line 69
Error: Expected token: ";", but found ")" on line 69
Error: Invalid expression, assumed zero on line 69
Error: Too many error messages on one line on line 69

Compilation aborted.
4 Errors.
Could not locate output file
Responder
#10
(05/02/2020, 02:58 PM)Manuelito1208 escribió: me sale esto pacman : AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Invalid expression, assumed zero on line 69
Warning: Expression has no effect on line 69
Error: Expected token: ";", but found ")" on line 69
Error: Invalid expression, assumed zero on line 69
Error: Too many error messages on one line on line 69

Compilation aborted.
4 Errors.
Could not locate output file

Pasa el código que intentas compilar
Responder
#11

.sma   Descargar AMXX / Tiendaa.sma (Tamaño: 2.91 KB / Descargas: 12)
Responder
#12
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <jctf>

native Native1(id)        // 1
native Native2(id)        // 2
native Native3(id)         // 3

new const iPlugininfo[][]={"Tienda x Natives""3.0""Alejandro-."}
    
enum _:ARMAS {
    
aName[32],
    
aPrecio,
    
mPrecio,
}

new const 
ArmasNat[][ARMAS]=
{
//     [NAME]                        [AD]     [$] 
    
{"Barlog",                     70,     120},
    {
"Rock Guitar",             75,     120},
    {
"Thanatos III",             90,     140},
      {
"New Comen",                 70,     70},
      {
"Plasma Gun",                 90,     90},
      {
"Thanatos V",                 90,     100},
      {
"Gatling",                 90,     100},
    {
"Thunder Bolt",             100,     120},
    {
"Ak-47 Paladins",             100,     160},
      {
"Thanatos VII",             100,     1000},
    {
"Blaster",                 100,     1200}
}

public 
plugin_init()
{
    
register_plugin(iPlugininfo[0], iPlugininfo[1], iPlugininfo[2]);
    
register_clcmd("say /armas""fw_armas_nat");
}


public 
fw_armas_nat(id)
{
    if(!
is_user_alive(id)) 
    {
        
client_print_color(idprint_team_red"^4[^3AMXMOD^4]^1 Debes estar vivo para abrir este menu" )
        return 
PLUGIN_HANDLED;
    }

    new 
menu menu_create("\
        \r===================^n\
        \wTIENDA CTF^n\
        \r===================\w"
"Hand_Menu")

    for(new 
0<sizeof ArmasNati++)
    {
        
menu_additem(menuArmasNat[i][aName], __menu_makecallback("item_callback"))
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\y<-\r Volver");
    
menu_setprop(menuMPROP_NEXTNAME"\y-> \rSiguiente");
    
menu_setprop(menuMPROP_EXITNAME"\y<\rX\y>\r Salir");
    
menu_display(idmenu0)

    return 
PLUGIN_HANDLED;
}

public 
item_callback(idmenuitem)
{
    if(
cs_get_user_money(id) < ArmasNat[item][mPrecio] || jctf_get_adrenaline(id) < ArmasNat[item][aPrecio])
        return 
ITEM_DISABLED;    
    return 
ITEM_ENABLED;
}

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

    switch(
item)
    {
        case 
0Native1(id)                // 1
        
case 1Native2(id)                // 2
        
case 2Native3(id)             // 3
    
}


    
jctf_add_adrenaline(id, - ArmasNat[item][aPrecio]) //Editamos su adrenalina de esta forma, con la native ya creada
    
cs_set_user_money(idcs_get_user_money(id) - ArmasNat[item][mPrecio])
    
client_print_coloridprint_team_red"^4[^3OLG^4]^1 Compraste un:^4 %s ^1por: ^3%d ^1AD, ^3%d ^1$"ArmasNat[item][aName], ArmasNat[item][aPrecio], ArmasNat[item][mPrecio])
    return 
PLUGIN_HANDLED;

Responder
#13
(05/02/2020, 03:11 PM)Chema escribió:
Código PHP:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <jctf>

native Native1(id)        // 1
native Native2(id)        // 2
native Native3(id)         // 3

new const iPlugininfo[][]={"Tienda x Natives""3.0""Alejandro-."}
    
enum _:ARMAS {
    
aName[32],
    
aPrecio,
    
mPrecio,
}

new const 
ArmasNat[][ARMAS]=
{
//     [NAME]                        [AD]     [$] 
    
{"Barlog",                     70,     120},
    {
"Rock Guitar",             75,     120},
    {
"Thanatos III",             90,     140},
      {
"New Comen",                 70,     70},
      {
"Plasma Gun",                 90,     90},
      {
"Thanatos V",                 90,     100},
      {
"Gatling",                 90,     100},
    {
"Thunder Bolt",             100,     120},
    {
"Ak-47 Paladins",             100,     160},
      {
"Thanatos VII",             100,     1000},
    {
"Blaster",                 100,     1200}
}

public 
plugin_init()
{
    
register_plugin(iPlugininfo[0], iPlugininfo[1], iPlugininfo[2]);
    
register_clcmd("say /armas""fw_armas_nat");
}


public 
fw_armas_nat(id)
{
    if(!
is_user_alive(id)) 
    {
        
client_print_color(idprint_team_red"^4[^3AMXMOD^4]^1 Debes estar vivo para abrir este menu" )
        return 
PLUGIN_HANDLED;
    }

    new 
menu menu_create("\
        \r===================^n\
        \wTIENDA CTF^n\
        \r===================\w"
"Hand_Menu")

    for(new 
0<sizeof ArmasNati++)
    {
        
menu_additem(menuArmasNat[i][aName], __menu_makecallback("item_callback"))
    }
    
    
menu_setprop(menuMPROP_BACKNAME"\y<-\r Volver");
    
menu_setprop(menuMPROP_NEXTNAME"\y-> \rSiguiente");
    
menu_setprop(menuMPROP_EXITNAME"\y<\rX\y>\r Salir");
    
menu_display(idmenu0)

    return 
PLUGIN_HANDLED;
}

public 
item_callback(idmenuitem)
{
    if(
cs_get_user_money(id) < ArmasNat[item][mPrecio] || jctf_get_adrenaline(id) < ArmasNat[item][aPrecio])
        return 
ITEM_DISABLED;    
    return 
ITEM_ENABLED;
}

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

    switch(
item)
    {
        case 
0Native1(id)                // 1
        
case 1Native2(id)                // 2
        
case 2Native3(id)             // 3
    
}


    
jctf_add_adrenaline(id, - ArmasNat[item][aPrecio]) //Editamos su adrenalina de esta forma, con la native ya creada
    
cs_set_user_money(idcs_get_user_money(id) - ArmasNat[item][mPrecio])
    
client_print_coloridprint_team_red"^4[^3OLG^4]^1 Compraste un:^4 %s ^1por: ^3%d ^1AD, ^3%d ^1$"ArmasNat[item][aName], ArmasNat[item][aPrecio], ArmasNat[item][mPrecio])
    return 
PLUGIN_HANDLED;


No funciona: AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Undefined symbol "client_print_color" on line 45
Warning: Expression has no effect on line 45
Error: Expected token: ";", but found ")" on line 45
Error: Invalid expression, assumed zero on line 45
Error: Too many error messages on one line on line 45

Compilation aborted.
4 Errors.
Could not locate output file

vere si puedo conseguir otra Tienda xd
Responder
#14
Algo estás tocando, a mi me compila a la perfección..

EDIT: Dejemos de comentar aquí, enviame un mensaje privado y te ayudo por allí..
Responder
#15
(05/02/2020, 03:20 PM)Manuelito1208 escribió: No funciona: AMX Mod X Compiler 1.9.0.5247
Copyright © 1997-2006 ITB CompuPhase
Copyright © 2004-2013 AMX Mod X Team

Error: Undefined symbol "client_print_color" on line 45
Warning: Expression has no effect on line 45
Error: Expected token: ";", but found ")" on line 45
Error: Invalid expression, assumed zero on line 45
Error: Too many error messages on one line on line 45

Compilation aborted.
4 Errors.
Could not locate output file

vere si puedo conseguir otra Tienda xd
necesitas amxmod 1.8.3
[Imagen: 76561198204267641.png]
Responder
#16
yo te voy a pasar un dato: NO entendi eso Confundido, dejare 2 cositas para que te guies

esto y Esto
Competitive/Face it Pick Up Game (PUG) servidor de prueba: 45.77.94.109:27016 Click para Entrar
[Imagen: b_350_20_5A6C3E_383F2D_D2E1B5_2E3226.png]

(14/08/2015, 10:15 PM)Sugisaki escribió: "El mundo es caotico, irracional e injusto. No tiene ningun significado"
Palabras que desde hace mucho tiempo he buscado para describir, ¿Que es el mundo?
Crab

Código PHP:
if(ayuda && free)
{
    exit();

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)