Tu zamieszczam kod:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "skelp"
#define VERSION "2.0"
#define AUTHOR "Criss"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /sklep", "menu", )
register_cvar("amx_sklep","6000")
// Add your code here...
}
public menu(id)
{
public plugin_init()
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /sklep", "menu", )
register_cvar("amx_sklep","6000")
new menu = menu_create("\wSklepik By Criss:", "wybieranie")
menu_additem(menu, "\wGranat Zamrazajacy" "1", 0);
menu_additem(menu, "\wGranat Podpalajacy" "2", 0);
menu_additem(menu, "\wPompa" "3", 0);
menu_additem(menu, "\wKAMPA CT" "4", 0);
menu_additem(menu, "\wKAMPA TT" "5", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu, 0)
}
public wybieranie(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)
new key = str_to_num(data)
switch(key)
{
case 1:{
give_item(id, "weapon_flashbang") ;
if(!is_user_alive(id)){
client_print(id,print_chat,"[Sklepi] Nie mozesz skorzystac z tej uslugi ziom, bo jestes niezywy ;-(")
return PLUGIN_HANDLED
}
case 2:{
give_item(id, "weapon_hegrenade");
if(!is_user_alive(id)){
client_print(id,print_chat,"[Sklepik] Nie mozesz skorzystac z tej uslugi ziom, bo jestes niezywy ;-(")
return PLUGIN_CONTINUE
}
case 3:{
give_item(id, "weapon_m249");
give_item(id,"ammo_556nato")
if(!is_user_alive(id)){
client_print(id,print_chat,"[Sklepik] Nie mozesz skorzystac z tej uslugi ziom, bo jestes niezywy ;-(")
}
case 4:{
give_item(id, "weapon_sg550");
give_item(id,"ammo_556nato")
if(!is_user_alive(id)){
client_print(id,print_chat,"[Sklepik] Nie mozesz skorzystac z tej uslugi ziom, bo jestes niezywy ;-(")
}
case 5:{
give_item(id, "weapon_g3sg1");
give_item(id,"ammo_762nato")
if(!is_user_alive(id))
client_print(id,print_chat,"[Sklepik] Nie mozesz skorzystac z tej uslugi ziom, bo jestes niezywy ;-(")
menu_destroy(menu)
menu_destroy(menu)
return PLUGIN_HANDLED
}
Użytkownik Criss edytował ten post 19.03.2011 15:17


Dodatki SourceMod



Temat jest zamknięty










