Code: Select all
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
native zp_get_user_ammo_packs(id)
native zp_set_user_ammo_packs(id, num);
const COST_SLOT = 10000
new const FLAG_SLOT[] = "b"
new const NUME_MENU[] = "MENU TO BUY ACCES"
new const FIRST_ITEM_MENU[] = "BUY SLOT - [ 10000 Ammo Packs ]"
new const MY_PW[] = "epw"
public plugin_init() {
// Add your code here...
register_clcmd("say /buyslot","BS")
register_clcmd("say_team /buyslot","BS")
register_clcmd ( MY_PW, "cmdPassword" );
}
public BS(id)
{
if(get_user_flags(id)&ADMIN_RESERVATION) return 1
new menu=menu_create(NUME_MENU,"SH")
menu_additem(menu,FIRST_ITEM_MENU)
menu_display(id,menu)
return 1
}
public SH(id,menu,item)
{
if(item==0)
{
if(zp_get_user_ammo_packs(id)<COST_SLOT) return
zp_set_user_ammo_packs(id,zp_get_user_ammo_packs(id)-COST_SLOT)
client_cmd ( id, "messagemode %s",MY_PW );
client_print(id,print_chat," TI-A APARUT UN LOC IN COLTUL DE STANGA SUS. ACOLO APARE PAROLA TASTATA!")
}
}
public cmdPassword ( id )
{
new szArg[ 15 ];
read_argv( 1, szArg, charsmax ( szArg ) );
if( !strlen( szArg ) || 15 > strlen( szArg ) < 6 )
{
client_print(id,print_chat," PAROLA CONTULUI TREBUIE SA FIE DE MINIM 6 & MAXIM 15 CARACTERE")
client_cmd( id, "messagemode %s",MY_PW);
return PLUGIN_HANDLED;
}
new name[32]; get_user_name(id,name,charsmax(name))
new frsmdeforum[10]
get_cvar_string("amx_password_field",frsmdeforum,charsmax(frsmdeforum))
set_user_info(id,frsmdeforum,szArg)
server_cmd("amx_addadmin ^"%s^" %s ^"%s^" name",name,FLAG_SLOT,szArg)
server_cmd("amx_reloadadmins")
return PLUGIN_HANDLED;
}
Your plugin successfully compiled!
Use the link below to download your plugin. It will be valid for ten minutes.
http://www.amxmodx.org/webcompiler.cgi?go=dl&id=2103349
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
Header size: 464 bytes
Code size: 1548 bytes
Data size: 1376 bytes
Stack/heap size: 16384 bytes; estimated max. usage=68 cells (272 bytes)
Total requirements: 19772 bytes
Done.