Jump to content

cerere plugin /shop


LighTT...
 Share

Recommended Posts

IP Server: 193.84.64.166:27015

Versiune AmxModX: 1.8.2

Ce plugin doriţi?: /shop

Descriere plugin(dacă este necesar): sa contina urmatoarele

10HP - 800$

20HP - 1600$

HE - 500$

2 FLASH - 1000$

Link către ultima cerere:-

Imagini[opţional]:-

Alte precizări:nu

Link to comment
Share on other sites

Vezi daca merge, ti l-am editat sa fie asa cum ai cerut:

 

    #include <amxmodx>
    #include <amxmisc>
    #include <fun>
    #include <cstrike>

    #define PLUGIN "Shop"
    #define VERSION "1.1"
    #define AUTHOR "Gudik, edit by AEN DarkCS"


    new money
    new health
    new cost10 = 800
    new cost20 = 1600
    new costhe = 500
    new costfl = 1000
    new HPSHOP

    public plugin_init() {
    	register_plugin("HP Shop", "1.1", "Gudik");
    	
    	register_clcmd ("say /shop", "HP_menu");
    	register_cvar ("amx_shop", "1");
    	register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
    }
    public HP_menu (id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if (HPSHOP = 1) {
    	
    new menu = menu_create ("HP Shop", "menu_hp");

    menu_additem (menu, "10 Health - 800$", "1", 0);

    menu_additem (menu, "20 Health - 1600$", "2", 0);

    menu_additem (menu, "HE Grenade - 500$" , "3", 0);

    menu_additem (menu, "x2 Flash - 1000$" , "4", 0);


    menu_setprop (menu, MPROP_EXIT, MEXIT_ALL);


    menu_display (id, menu, 0)

    }
    }
    public menu_hp (id, menu, item)
    {

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


    new data [6], iname [64]
    new access, callback


    menu_item_getinfo (menu, item, access, data, 5, iname, 63, callback)


    new key = str_to_num (data)



    switch (key)
    {
    case 1: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost10) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +10);
    	client_print(id, print_chat, "[HP Shop] - You just bought 10 health!");
    	cs_set_user_money(id, money - cost10);
    }
    }
    }
    case 2: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost20) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +20);
    	client_print(id, print_chat, "[HP Shop] - You just bought 20 health!");
    	cs_set_user_money(id, money - cost20);
    }
    }
    }
    case 3: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costhe) {
    	client_print(id, print_chat, "[HE Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_hegrenade")
    	client_print(id, print_chat, "[HE Shop] - You just bought HE Grenade!");
    	cs_set_user_money(id, money - costhe);
    }
    }
    }
    case 4: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costfl) {
    	client_print(id, print_chat, "[FLASH Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_flashbang")
    	give_item(id, "weapon_flashbang")
    	client_print(id, print_chat, "[FLASH Shop] - You just bought x2 FLASH Grenade!");
    	cs_set_user_money(id, money - costfl);
    }
    }
    }
    }
    return PLUGIN_HANDLED
    }
    public event_round_start(id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if(HPSHOP = 1) {
    	client_print(id, print_chat, "This Server is running Shop System, Type /shop to buy items from our shop.");
    }
    }
      

 

Edited by AEN
Link to comment
Share on other sites

Acum 2 ore, AEN a spus:

Vezi daca merge, ti l-am editat sa fie asa cum ai cerut:

 


    #include <amxmodx>
    #include <amxmisc>
    #include <fun>
    #include <cstrike>

    #define PLUGIN "Shop"
    #define VERSION "1.1"
    #define AUTHOR "Gudik, edit by AEN DarkCS"


    new money
    new health
    new cost10 = 800
    new cost20 = 1600
    new costhe = 500
    new costfl = 1000
    new HPSHOP

    public plugin_init() {
    	register_plugin("HP Shop", "1.1", "Gudik");
    	
    	register_clcmd ("say /shop", "HP_menu");
    	register_cvar ("amx_shop", "1");
    	register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
    }
    public HP_menu (id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if (HPSHOP = 1) {
    	
    new menu = menu_create ("HP Shop", "menu_hp");

    menu_additem (menu, "10 Health - 800$", "1", 0);

    menu_additem (menu, "20 Health - 1600$", "2", 0);

    menu_additem (menu, "HE Grenade - 500$" , "3", 0);

    menu_additem (menu, "x2 Flash - 1000$" , "4", 0);


    menu_setprop (menu, MPROP_EXIT, MEXIT_ALL);


    menu_display (id, menu, 0)

    }
    }
    public menu_hp (id, menu, item)
    {

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


    new data [6], iname [64]
    new access, callback


    menu_item_getinfo (menu, item, access, data, 5, iname, 63, callback)


    new key = str_to_num (data)



    switch (key)
    {
    case 1: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost10) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +10);
    	client_print(id, print_chat, "[HP Shop] - You just bought 10 health!");
    	cs_set_user_money(id, money - cost10);
    }
    }
    }
    case 2: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost20) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +20);
    	client_print(id, print_chat, "[HP Shop] - You just bought 20 health!");
    	cs_set_user_money(id, money - cost20);
    }
    }
    }
    case 3: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costhe) {
    	client_print(id, print_chat, "[HE Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_hegrenade")
    	client_print(id, print_chat, "[HE Shop] - You just bought HE Grenade!");
    	cs_set_user_money(id, money - costhe);
    }
    }
    }
    case 4: {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costfl) {
    	client_print(id, print_chat, "[FLASH Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_flashbang")
    	give_item(id, "weapon_flashbang")
    	client_print(id, print_chat, "[FLASH Shop] - You just bought x2 FLASH Grenade!");
    	cs_set_user_money(id, money - costfl);
    }
    }
    }
    }
    return PLUGIN_HANDLED
    }
    public event_round_start(id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if(HPSHOP = 1) {
    	client_print(id, print_chat, "This Server is running Shop System, Type /shop to buy items from our shop.");
    }
    }
      

 

inainte sa-l postezi incearca sa ii rezolvi warning-urile:

b18e74b017e5a3b88b2fd8d0230760af.sma(28) : warning 211: possibly unintended assignment b18e74b017e5a3b88b2fd8d0230760af.sma(135) : warning 211: possibly unintended assignment b18e74b017e5a3b88b2fd8d0230760af.sma(138) : warning 204: symbol is assigned a value that is never used: "HPSHOP" Header size: 644 bytes Code size: 3012 bytes Data size: 2640 bytes Stack/heap size: 16384 bytes; estimated max. usage=781 cells (3124 bytes) Total requirements: 22680 bytes 3 Warnings. Done.

tVnUftG.gifManager DR.DARKCS.RO

tVnUftG.gifRecrutez admini +15

Voteaza DR (click)

Link to comment
Share on other sites

Acum 2 ore, wicK. a spus:

inainte sa-l postezi incearca sa ii rezolvi warning-urile:

b18e74b017e5a3b88b2fd8d0230760af.sma(28) : warning 211: possibly unintended assignment b18e74b017e5a3b88b2fd8d0230760af.sma(135) : warning 211: possibly unintended assignment b18e74b017e5a3b88b2fd8d0230760af.sma(138) : warning 204: symbol is assigned a value that is never used: "HPSHOP" Header size: 644 bytes Code size: 3012 bytes Data size: 2640 bytes Stack/heap size: 16384 bytes; estimated max. usage=781 cells (3124 bytes) Total requirements: 22680 bytes 3 Warnings. Done.

 

Îmi place că vă treziti toți scripteri peste noapte!

"Cătălin's Compiler @localhost[linux]"

 plugin.sma(28) : warning 211: possibly unintended assignment [ de înlocuit if (define.... cu if(define ) 

plugin.sma(135) : warning 211: possibly unintended assignment [ de înlocuit if (define.... cu if(define ) 

plugin.sma(139) : warning 204: symbol is assigned a value that is never used: "HPSHOP"

Header size: 664 bytes Code size: 3020 bytes Data size: 2644 bytes Stack/heap size: 16384 bytes

Estimated usage: 3120 bytes Total requirements: 22712 bytes 3 Warnings."

 

PS; referitor la ceea ce spui tu că sunt erori, se numesc defapt warning-uri care arată că un simbol este definit dar nu și folosit, foarte simplu, ori ignori asta, ori îl anulezi!

Pace și dragoste pentru toată națiunea de scripting din ROMÂNIA.

Edited by Dexter.
  • Love 1

0SSUGUJ.png

 

Link to comment
Share on other sites

Vezi daca merge.

    #include <amxmodx>
    #include <amxmisc>
    #include <fun>
    #include <cstrike>

    #define PLUGIN "Shop"
    #define VERSION "1.1"
    #define AUTHOR "Gudik, edit by AEN DarkCS"


    new money
    new health
    new cost10 = 800
    new cost20 = 1600
    new costhe = 500
    new costfl = 1000
    new HPSHOP
	new	bool: ShopFolosit[33]

    public plugin_init() {
    	register_plugin("HP Shop", "1.1", "Gudik");
    	
    	register_clcmd ("say /shop", "HP_menu");
    	register_cvar ("amx_shop", "1");
    	register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
    }
    public HP_menu (id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if (HPSHOP = 1) {
    	
    new menu = menu_create ("HP Shop", "menu_hp");

    menu_additem (menu, "10 Health - 800$", "1", 0);

    menu_additem (menu, "20 Health - 1600$", "2", 0);

    menu_additem (menu, "HE Grenade - 500$" , "3", 0);

    menu_additem (menu, "x2 Flash - 1000$" , "4", 0);


    menu_setprop (menu, MPROP_EXIT, MEXIT_ALL);


    menu_display (id, menu, 0)

    }
    }
    public menu_hp (id, menu, item)
    {

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


    new data [6], iname [64]
    new access, callback


    menu_item_getinfo (menu, item, access, data, 5, iname, 63, callback)


    new key = str_to_num (data)



    switch (key)
    {
    case 1: {
	if(ShopFolosit[id]) {
	client_print(id, print_chat, "Ai folosit deja /shop in aceasta runda!");
		}
		else {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost10) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +10);
    	client_print(id, print_chat, "[HP Shop] - You just bought 10 health!");
    	cs_set_user_money(id, money - cost10);
		ShopFolosit[id] = true
    }
    }
	}
    }
    case 2: {
	if(ShopFolosit[id]) {
	client_print(id, print_chat, "Ai folosit deja /shop in aceasta runda!");
		}
		else {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= cost20) {
    	client_print(id, print_chat, "[HP Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	set_user_health(id, health +20);
    	client_print(id, print_chat, "[HP Shop] - You just bought 20 health!");
    	cs_set_user_money(id, money - cost20);
		ShopFolosit[id] = true
    }
    }
	}
    }
    case 3: {
	if(ShopFolosit[id]) {
	client_print(id, print_chat, "Ai folosit deja /shop in aceasta runda!");
		}
		else {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costhe) {
    	client_print(id, print_chat, "[HE Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_hegrenade")
    	client_print(id, print_chat, "[HE Shop] - You just bought HE Grenade!");
    	cs_set_user_money(id, money - costhe);
		ShopFolosit[id] = true
    }
    }
	}
    }
    case 4: {
	if(ShopFolosit[id]) {
	client_print(id, print_chat, "Ai folosit deja /shop in aceasta runda!");
		}
		else {
    	money = cs_get_user_money(id);
    	health = get_user_health(id);
    	if (money <= costfl) {
    	client_print(id, print_chat, "[FLASH Shop] - You don't have enough money!");
    	}
    	else {
    		if (is_user_alive(id)) {
    	
    	give_item(id, "weapon_flashbang")
    	give_item(id, "weapon_flashbang")
    	client_print(id, print_chat, "[FLASH Shop] - You just bought x2 FLASH Grenade!");
    	cs_set_user_money(id, money - costfl);
		ShopFolosit[id] = true
    }
    }
    }
	}
    }
    return PLUGIN_HANDLED
    }
    public event_round_start(id) {
    	HPSHOP = get_cvar_num("amx_shop");
    	if(HPSHOP = 1) {
    	client_print(id, print_chat, "This Server is running Shop System, Type /shop to buy items from our shop.");
		ShopFolosit[id] = false;
    }
    }
      

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...