Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34

Thread: Shop don't Work

  1. #1
    Private EnergY's Avatar
    Join Date
    Jul 2012
    Posts
    34
    Thanks
    32
    Thanked 2 Times in 2 Posts

    Shop don't Work

    Hi all,

    For my mod i need Zom shop, I have made ​​shop but do not work.
    I need help as often ^ ^
    Who can tell me please its not working?


    Code:
    itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 68 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"4. ^2H^7unter ^2S^7hop"
    			decoration
    		}
    		execKey "4" { close quickmessage; open shoph }
    Code:
    #include "ui_mp/menudef.h"
    #define ORIGIN_QUICKMESSAGETAB			32 224
    
    #define ORIGIN_QUICKMESSAGEWINDOW		32 256
    
    
    {
    	menuDef
    	{
    		name			"shoph"
    		visible			0
    		fullscreen		0
    		rect			0 0 640 480
    		focuscolor		1 1 1 1
    		disablecolor		0 0 0 0
     		style			WINDOW_STYLE_EMPTY
    
    		onOpen
    		{
    			setDvar cl_bypassMouseInput "1"
    		}
    		onClose
    		{
    			setDvar cl_bypassMouseInput "0"
    		}
    
    // WINDOW BACKGROUND
    		itemDef
    		{
    			name			"window_background"
    			visible			1
    			rect			0 0 224 192
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			forecolor		1 1 1 1
    			backcolor		0 0 0 0.7975
    			decoration
    		}
    	
    // WINDOW LINES
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			3 0 2 187
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			219 0 2 187
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			5 0 214 2
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			3 187 218 2
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    
    // TITLE
    		itemDef
    		{
    			name			"title"
    			visible			1
    			rect			0 0 224 32
    			origin			ORIGIN_QUICKMESSAGETAB
    			style			WINDOW_STYLE_FILLED
    			forecolor		1 1 1 1
    			backcolor		0 0 0 0.7975
    			type			ITEM_TYPE_TEXT
    			text			"^2H^7unter ^2S^7hop"
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textalignx		112
    			textaligny		24
    			textalign		ITEM_ALIGN_CENTER
    			decoration
    		}
    		itemDef
    		{
    			name			"title_quickmessage_gray"
    			visible			1
    			rect			3 3 218 29
    			origin			ORIGIN_QUICKMESSAGETAB
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 20 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"1. 1 ^2G^7renade   ^2[^7400^2]"
    			decoration
    		}
    		execKey "1" { scriptMenuResponse "1"; close shoph; }
    		
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 20 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"1. 3 ^2G^7renade   ^2[^71000^2]"
    			decoration
    		}
    		execKey "2" { scriptMenuResponse "2"; close shoph; }
    	
    
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 148 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"@QUICKMESSAGE_ESC_EXIT"
    			decoration
    		}
    	}
    }
    in _menus.

    Code:
    if(menu == game["menu_quickcommands"])
    				maps\mp\gametypes\_quickmessages::quickcommands(response);
    			else if(menu == game["menu_quickstatements"])
    				maps\mp\gametypes\_quickmessages::quickstatements(response);
    			else if(menu == game["menu_quickresponses"])
    				maps\mp\gametypes\_quickmessages::quickresponses(response);
    			else if(menu == game["menu_shoph"])
    				maps\mp\gametypes\_quickmessages::shoph(response);


    Code:
    init()
    {
    	game["menu_quickcommands"] = "quickcommands";
    	game["menu_quickstatements"] = "quickstatements";
    	game["menu_quickresponses"] = "quickresponses";
    	game["menu_shoph"] = "shoph";
    
    	precacheMenu(game["menu_quickcommands"]);
    	precacheMenu(game["menu_quickstatements"]);
    	precacheMenu(game["menu_quickresponses"]);
    	precacheMenu(game["menu_shoph"]);
    	precacheHeadIcon("talkingicon");
    }
    Now the script For Hunter (argent =money(

    Code:
    shoph(response)
    {
    	if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
    		return;
    
    	self.spamdelay = true;
    
    	if(self.pers["team"] == "allies")
    	{
    		switch(game["allies"])		
    		{
    		case "american":
    			switch(response)		
    			{
    			case "1":
    			 if(argent >= 400)
    			{
    			 
    						self takeWeapon("frag_grenade_american_mp");
    						self giveWeapon("frag_grenade_american_mp");
    				self setWeaponClipAmmo("frag_grenade_amercican_mp", 1);
           self iprintlnbold("^2Y^7ou ^2G^7et 1 ^2N^7ades  ^2[^4-400^2]");
    			}
    	   else if(self.argent < 400)
    		{
    			self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 400 ^2M^7oney");
    		}
    			break;
    		
    		case "2":
    			 if(argent >= 1000)
    			{
    			 
    						self takeWeapon("frag_grenade_american_mp");
    						self giveWeapon("frag_grenade_american_mp");
    				self setWeaponClipAmmo("frag_grenade_amercican_mp", 3);
           self iprintlnbold("^2Y^7ou ^2G^7et 3 ^2N^7ades  ^2[^4-1000^2]");
    			}
    	   else if(self.argent < 1000)
    		{
    			self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 1000 ^2M^7oney");
    		}
    		break;
    		
    			}
    		}
    	}
    
    }
    Thx
    Xfire: romain88120 and energyfun !!

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    What actually doesn't work? What worked till it didn't?
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    EnergY (23rd May 2013)

  4. #3
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    How is this saved?
    Code:
    #include "ui_mp/menudef.h"
    #define ORIGIN_QUICKMESSAGETAB			32 224
    
    #define ORIGIN_QUICKMESSAGEWINDOW		32 256
    
    
    {
    	menuDef
    	{
    		name			"shoph"
    		visible			0
    		fullscreen		0
    		rect			0 0 640 480
    		focuscolor		1 1 1 1
    		disablecolor		0 0 0 0
     		style			WINDOW_STYLE_EMPTY
    
    		onOpen
    		{
    			setDvar cl_bypassMouseInput "1"
    		}
    		onClose
    		{
    			setDvar cl_bypassMouseInput "0"
    		}
    
    // WINDOW BACKGROUND
    		itemDef
    		{
    			name			"window_background"
    			visible			1
    			rect			0 0 224 192
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			forecolor		1 1 1 1
    			backcolor		0 0 0 0.7975
    			decoration
    		}
    	
    // WINDOW LINES
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			3 0 2 187
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			219 0 2 187
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			5 0 214 2
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    		itemDef
    		{
    			name			"window_lines"
    			visible			1
    			rect			3 187 218 2
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    
    // TITLE
    		itemDef
    		{
    			name			"title"
    			visible			1
    			rect			0 0 224 32
    			origin			ORIGIN_QUICKMESSAGETAB
    			style			WINDOW_STYLE_FILLED
    			forecolor		1 1 1 1
    			backcolor		0 0 0 0.7975
    			type			ITEM_TYPE_TEXT
    			text			"^2H^7unter ^2S^7hop"
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textalignx		112
    			textaligny		24
    			textalign		ITEM_ALIGN_CENTER
    			decoration
    		}
    		itemDef
    		{
    			name			"title_quickmessage_gray"
    			visible			1
    			rect			3 3 218 29
    			origin			ORIGIN_QUICKMESSAGETAB
    			style			WINDOW_STYLE_FILLED
    			backcolor		1 1 1 .125
    			decoration
    		}
    
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 20 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"1. 1 ^2G^7renade   ^2[^7400^2]"
    			decoration
    		}
    		execKey "1" { scriptMenuResponse "1"; close shoph; }
    		
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 20 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"1. 3 ^2G^7renade   ^2[^71000^2]"
    			decoration
    		}
    		execKey "2" { scriptMenuResponse "2"; close shoph; }
    	
    
    		itemDef
    		{
    			name			"window"
    			visible			1
    			rect			16 148 0 0
    			origin			ORIGIN_QUICKMESSAGEWINDOW
    			forecolor		1 1 1 1
    			textfont		UI_FONT_NORMAL
    			textscale		.24
    			textaligny		8
    			text			"@QUICKMESSAGE_ESC_EXIT"
    			decoration
    		}
    	}
    }
    And test with developer 1, maybe there is an error. What isn't working exactly? Does it open the menu?

  5. The Following User Says Thank You to Ni3ls For This Useful Post:

    EnergY (23rd May 2013)

  6. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Wait i see it
    Code:
    execKey "1" { scriptMenuResponse "1"; close shoph; }
    delete the ; after close shoph in every line

  7. The Following 2 Users Say Thank You to Ni3ls For This Useful Post:

    EnergY (23rd May 2013),kung foo man (23rd May 2013)

  8. #5
    Private EnergY's Avatar
    Join Date
    Jul 2012
    Posts
    34
    Thanks
    32
    Thanked 2 Times in 2 Posts
    I use 1 or 2 and i don't have nade ^^ And no i can use menu .
    Xfire: romain88120 and energyfun !!

  9. #6
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Your script is a little mess :S i just sorted it a littlebit

    PHP Code:
    shoph(response)
    {
        if(!
    isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
            return;

        
    self.spamdelay true;

        if(
    self.pers["team"] != "allies")
            return;
        
        switch(
    response)        
        {
            case 
    "1":
                if(
    argent >= 400)
                {
                    
    self takeWeapon("frag_grenade_american_mp");
                    
    self giveWeapon("frag_grenade_american_mp");
                    
    self setWeaponClipAmmo("frag_grenade_amercican_mp"1);
                    
    self iprintlnbold("^2Y^7ou ^2G^7et 1 ^2N^7ades  ^2[^4-400^2]");
                }
                
                else
                    
    self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 400 ^2M^7oney");
                break;

            case 
    "2":
                if(
    argent >= 1000)
                {
                    
    self takeWeapon("frag_grenade_american_mp");
                    
    self giveWeapon("frag_grenade_american_mp");
                    
    self setWeaponClipAmmo("frag_grenade_amercican_mp"3);
                    
    self iprintlnbold("^2Y^7ou ^2G^7et 3 ^2N^7ades  ^2[^4-1000^2]");
                }
                
                else
                    
    self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 1000 ^2M^7oney");
                break;
        }

    No ... No ... this is not possible .......

  10. The Following 2 Users Say Thank You to Earliboy For This Useful Post:

    EnergY (23rd May 2013),kung foo man (23rd May 2013)

  11. #7
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    Use iprintln() in different places to see where the script stops.

    Oh, i think i have the error. argent is undefined, use 'self' prefix, so: self.argent. And do not forget to set a big number for money to test.

  12. The Following 2 Users Say Thank You to randall For This Useful Post:

    EnergY (23rd May 2013),kung foo man (23rd May 2013)

  13. #8
    Private EnergY's Avatar
    Join Date
    Jul 2012
    Posts
    34
    Thanks
    32
    Thanked 2 Times in 2 Posts
    Thank You Earlilboy i use it XD

    And Randall i see thx
    Xfire: romain88120 and energyfun !!

  14. #9
    Private First Class thOuMta's Avatar
    Join Date
    Oct 2012
    Location
    France
    Posts
    191
    Thanks
    139
    Thanked 35 Times in 28 Posts
    PHP Code:
    shoph(response)
    {
        if(!
    isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
            return;

        
    self.spamdelay true;

        if(
    self.pers["team"] != "allies")
            return;
        
        switch(
    response)        
        {
            case 
    "1":
                if(
    self.argent >= 400)
                {
                    
    self takeWeapon("frag_grenade_american_mp");
                    
    self giveWeapon("frag_grenade_american_mp");
                    
    self setWeaponClipAmmo("frag_grenade_amercican_mp"1);
                    
    self iprintlnbold("^2Y^7ou ^2G^7et 1 ^2N^7ades  ^2[^4-400^2]");
                }
           
                else
                {
                    
    self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 400 ^2M^7oney");
                }
                break;

            case 
    "2":
                if(
    self.argent >= 1000)
                {
                    
    self takeWeapon("frag_grenade_american_mp");
                    
    self giveWeapon("frag_grenade_american_mp");
                    
    self setWeaponClipAmmo("frag_grenade_amercican_mp"3);
                    
    self iprintlnbold("^2Y^7ou ^2G^7et 3 ^2N^7ades  ^2[^4-1000^2]");
                }
                
                else
                {
                    
    self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 1000 ^2M^7oney");
                }
                break;
        }

    Use self.argent >= .. and
    else
    {
    //
    }

    Maybe its that !
    Last edited by thOuMta; 23rd May 2013 at 18:26.

  15. The Following User Says Thank You to thOuMta For This Useful Post:

    EnergY (23rd May 2013)

  16. #10
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    I already gave u the anwer...

  17. The Following User Says Thank You to Ni3ls For This Useful Post:

    EnergY (24th May 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •