Quote:
Originally Posted by baneado
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <cstrike>
#define PLUGIN "no pongas tu maldita publicidad, te deberian dar ban" #define VERSION "1.0" #define AUTHOR "pontunombreaqui'"
new g_desbloq[33][2]
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) }
public client_putinserver(id) { for (new i = 0; i < 2; i++) g_desbloq[id][i] = false }
public menu_publicidad(id) { new menu = menu_create("yPublicidad Shop (? ^n", "maspublicidad") new money = cs_get_user_money(id) if(money >= 1000 || g_desbloq[id][0]) menu_additem(menu, "\yComprar Chaleco 200", "1", 0) else menu_additem(menu, "\dComprar Chaleco 200", "1", 0) if(money >= 5000 || g_desbloq[id][1]) menu_additem(menu, "\yComprar Chaleco 400", "2", 0) else menu_additem(menu, "\dComprar Chaleco 400", "2", 0) menu_setprop(menu, MPROP_EXITNAME, "Salir") menu_display(id, menu, 0) }
public maspublicidad(id, menu, item) { if (item == MENU_EXIT) return PLUGIN_HANDLED; new money = cs_get_user_money(id) switch (item) { case 0: { if(money >= 1000 || g_desbloq[id][0]) { g_desbloq[id][0] = true money -= 1000 cs_set_user_money(id, money) cs_set_user_armor(id, 200, CS_ARMOR_VESTHELM) } } case 1: { if(money >= 5000 || g_desbloq[id][1]) { g_desbloq[id][1] = true money -= 5000 cs_set_user_money(id, money) cs_set_user_armor(id, 400, CS_ARMOR_VESTHELM) } } } return PLUGIN_HANDLED; }
aquí lo tienes sin los bugs del scripter pro lukks.
|
PHP Code:
public client_putinserver(id)
{
for (new i = 0; i < 2; i++) g_desbloq[id][i] = false
}
-->
PHP Code:
public client_putinserver(id)
g_desbloq[id] = 0
----
PHP Code:
new g_desbloq[33][2]
-->
PHP Code:
new g_desbloq[33]
----
PHP Code:
if(money >= 1000 || g_desbloq[id][0])
-->
PHP Code:
if(money >= 1000 || g_desbloq[id] == 1)
----
PHP Code:
if(money >= 1000 || g_desbloq[id][0])
{
g_desbloq[id][0] = true
money -= 1000
cs_set_user_money(id, money)
cs_set_user_armor(id, 200, CS_ARMOR_VESTHELM)
}
-->
PHP Code:
if(money >= 1000 || g_desbloq[id] == 1)
{
g_desbloq[id] = 1
money -= 1000
cs_set_user_money(id, money)
cs_set_user_armor(id, 200, CS_ARMOR_VESTHELM)
}
Lo mismo haces con la opcion 2 del menu en vez de chequear con 1 y setear con 1 lo seteas con 2.
Mas fácil, eficiente y cómodo.
__________________