View Full Version : Shop don't Work
EnergY
23rd May 2013, 17:29
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?
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 }
#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.
if(menu == game["menu_quickcommands"])
maps\mp\gametypes\_quickmessages::quickcommands(re sponse);
else if(menu == game["menu_quickstatements"])
maps\mp\gametypes\_quickmessages::quickstatements( response);
else if(menu == game["menu_quickresponses"])
maps\mp\gametypes\_quickmessages::quickresponses(r esponse);
else if(menu == game["menu_shoph"])
maps\mp\gametypes\_quickmessages::shoph(response);
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(
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 :)
kung foo man
23rd May 2013, 17:38
What actually doesn't work? What worked till it didn't?
Ni3ls
23rd May 2013, 17:39
How is this saved?
#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?
Ni3ls
23rd May 2013, 17:40
Wait i see it
execKey "1" { scriptMenuResponse "1"; close shoph; }
delete the ; after close shoph in every line
EnergY
23rd May 2013, 17:46
I use 1 or 2 and i don't have nade ^^ And no i can use menu .
Earliboy
23rd May 2013, 17:57
Your script is a little mess :S i just sorted it a littlebit
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;
}
}
randall
23rd May 2013, 17:58
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.
EnergY
23rd May 2013, 18:06
:D Thank You Earlilboy i use it XD
And Randall i see thx :)
thOuMta
23rd May 2013, 18:24
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 !
Ni3ls
23rd May 2013, 18:29
I already gave u the anwer...
EnergY
23rd May 2013, 18:32
Yes Thank You thOuMta :D
Thank you too Ni3l ;)
EnergY
23rd May 2013, 19:06
Fuck don't work again !! but Why O_o all menu work :/ and script :/
Ni3ls
23rd May 2013, 19:08
Show your script now and say whats not working
EnergY
23rd May 2013, 19:14
ok ,
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.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.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;
}
}
And again i use 1 or 2 and i don't get nades :/
Ni3ls
23rd May 2013, 19:31
Show menu file
IzNoGoD
23rd May 2013, 19:34
Show the actual error.
Also show what you traced so far.
EnergY
23rd May 2013, 19:43
File in zom.gsc
thread zom_energy\_menus::init();
And
level.xenon = (getcvar("xenonGame") == "true");
if(level.xenon) // Xenon only
thread maps\mp\gametypes\_richpresence::init();
else // PC only
thread zom_energy\_quickmessages::init();
And now in _menus.gsc
if(menu == game["menu_quickcommands"])
maps\mp\gametypes\_quickmessages::quickcommands(re sponse);
else if(menu == game["menu_quickstatements"])
maps\mp\gametypes\_quickmessages::quickstatements( response);
else if(menu == game["menu_quickresponses"])
maps\mp\gametypes\_quickmessages::quickresponses(r esponse);
else if(menu == game["menu_shoph"])
zom_energy\_quickmessages::shoph(response);
shop script are in _quickmessages.gsc
Ni3ls
23rd May 2013, 19:58
OMG cant you read? Show your menu file! shoph.menu
And wtf is this?
else if(menu == game["menu_shoph"])
zom_energy\_quickmessages::shoph(response);
You say your script is in quickmessages...
else if(menu == game["menu_shoph"])
maps\mp\gametypes\_quickmessages::shoph(response);
EnergY
23rd May 2013, 20:07
I change places for test
#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 ^2[^7Money^2]"
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 40 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "2. 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
}
}
}
randall
23rd May 2013, 20:21
You wrote wrong the name of the nades: "frag_grenade_amercican_mp" amerCican xD
In the next step preCache the american nades in _weapons.gsc, or else you wont get grenades on maps where the allies are british or russians.
EnergY
24th May 2013, 16:14
Yea i have see thank you randall ^^
And no work again i don't have nade and iprintlnbold no work too :/
thOuMta
24th May 2013, 18:08
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.argent-=400;
wait(0.2);
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(self.argent >= 1000)
{
self.argent-=1000;
wait(0.2);
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;
}
}
Try this !
Must use wait function and else if(self.argent < ...) .
Ni3ls
24th May 2013, 18:15
self setWeaponClipAmmo("frag_grenade_amercican_mp", 1);
amerCican!
EnergY
24th May 2013, 19:00
Yes thx but randall have say and i have change it
randall
24th May 2013, 20:19
thOuMta, sorry but it's all bullshit :D
If iPrintlnBold doesnt work, there are many reasons:
1. player's team isn't allies (maybe this statement is false)
2. money is 0, or little to buy
3. response isn't 1 or 2
4. grenades aren't precached
5. the menu isn't in ui_mp/scriptmenus/ folder
But the detect the mistake would be easier if you would switch on the developer mode (developer 1, developer_script 1).
Edit: sometimes the cod shouts if 'switch' hasn't got default branch. (Therefore you should develop in developer mode)
EnergY
25th May 2013, 09:55
I test only in allies/ i test with 0 and 5000
response are energy_1 and energy_2 in the menu too
for 4 idk ^^
and the menu are in V menu and sure in ui_mp/scriptmenus/ folder
i can open shop menu but just i use 1 and 2 and no response :/
IzNoGoD
25th May 2013, 10:12
After the first buy in your shop, quickmessages wont work anymore.
Remove self.spamdelay.
EnergY
25th May 2013, 10:23
ok Thx but i have again never buy in the shop ^^
randall
25th May 2013, 13:59
response are energy_1 and energy_2 in the menu too
i can open shop menu but just i use 1 and 2 and no response :/
But omg... If the response is "energy_1" and "energy_2" then why you wrote "1" and "2" in the script?????????????????????? The CoD isn't so clever to recognize these mistakes.
EnergY
25th May 2013, 15:06
Lol no look
shoph(response)
{
if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;
if(self.pers["team"] != "allies")
return;
switch(response)
{
case "energy1":
if(self.argent >= 400)
{
self.argent-=400;
wait(0.2);
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 1);
self iprintlnbold("^2Y^7ou ^2G^7et 1 ^2N^7ades ^2[^4-400^2]");
}
else if(self.argent < 400)
{
wait(0.2);
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 400 ^2M^7oney");
}
break;
case "energy2":
if(self.argent >= 1000)
{
self.argent-=1000;
wait(0.2);
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 3);
self iprintlnbold("^2Y^7ou ^2G^7et 3 ^2N^7ades ^2[^4-1000^2]");
}
else if(self.argent < 1000)
{
wait(0.2);
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 1000 ^2M^7oney");
}
break;
default:
assert(response == "2");
break;
}
}
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 "energy1"; close shoph }
itemDef
{
name "window"
visible 1
rect 16 40 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "2. 3 ^2G^7renade ^2[^71000^2]"
decoration
}
execKey "2" { scriptMenuResponse "energy2"; close shoph }
EnergY
25th May 2013, 15:07
Lol no look
shoph(response)
{
if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;
if(self.pers["team"] != "allies")
return;
switch(response)
{
case "energy1":
if(self.argent >= 400)
{
self.argent-=400;
wait(0.2);
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 1);
self iprintlnbold("^2Y^7ou ^2G^7et 1 ^2N^7ades ^2[^4-400^2]");
}
else if(self.argent < 400)
{
wait(0.2);
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 400 ^2M^7oney");
}
break;
case "energy2":
if(self.argent >= 1000)
{
self.argent-=1000;
wait(0.2);
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 3);
self iprintlnbold("^2Y^7ou ^2G^7et 3 ^2N^7ades ^2[^4-1000^2]");
}
else if(self.argent < 1000)
{
wait(0.2);
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave 1000 ^2M^7oney");
}
break;
default:
assert(response == "2");
break;
}
}
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 "energy1"; close shoph }
itemDef
{
name "window"
visible 1
rect 16 40 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textscale .24
textaligny 8
text "2. 3 ^2G^7renade ^2[^71000^2]"
decoration
}
execKey "2" { scriptMenuResponse "energy2"; close shoph }
randall
25th May 2013, 16:14
Use this, it looks better:
shoph( response )
{
self iPrintln("Loool the script has reached this point: 1"); // delete this row if the script works!!!
if (! isDefined(self.pers["team"]) || self.pers["team"] == "spectator")
return;
self iPrintln("Loool the script has reached this point: 2"); // delete this row if the script works!!!
if (self.pers["team"] != "allies" || ! isDefined(self.argent))
return;
self iPrintln("Loool the script has reached this point: 3"); // delete this row if the script works!!!
switch (response)
{
case "energy1":
price = 400; // set the price of the product
if (self.argent < price)
{
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave " + price + " ^2M^7oney");
}
else
{
self.argent -= price;
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 1);
self iprintlnbold("^2Y^7ou ^2G^7ot 1 ^2N^7ade ^2[^4-" + price + "^2]");
}
break;
case "energy2":
price = 1000; // set the price of the product
if (self.argent < price)
{
self iprintlnbold("^2Y^7ou ^2M^7ust ^2H^7ave " + price + " ^2M^7oney");
}
else
{
self.argent -= price;
self takeWeapon("frag_grenade_american_mp");
self giveWeapon("frag_grenade_american_mp");
self setWeaponClipAmmo("frag_grenade_american_mp", 3);
self iprintlnbold("^2Y^7ou ^2G^7ot 3 ^2N^7ades ^2[^4-" + price + "^2]");
}
break;
default:
break;
}
}
EnergY
25th May 2013, 17:40
Thank You for your working but i think my pc has a problem, i have no response :/
EnergY
8th June 2013, 13:48
Yeeahh My Shop Working Now , i have never add zommenus.gsc --' But Thanks All !!!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.