Ok, heres the npc in the level:
HTML Code:
this.join("shops");
//#CLIENTSIDE
this.shopname = "John's Shop";
this.itemname = "Tommy Gun";
this.price = "15000";
this.image1 = "dh_tommygun-icon.gif";
this.item = "Guns/Tommy Gun";
The shops class:
HTML Code:
//#CLIENTSIDE
function onCreated(){
setTimer(.05);
}
function onActionLeftMouse(){
new GuiWindowCtrl("shopwin") {
profile = GuiBlueWindowProfile;
x = 10;
y = 100;
destroyonhide=true;
canresize=false;
canminimize=false;
canmaximize=false;
canclose=false;
canmove=true;
width = 160;
height = 140;
text = "";
new GuiMLTextCtrl("shopitem") {
profile = GuiBlueMLTextProfile;
x = 0;
y = 25;
width = 160;
height = 1;
text = "<center>"@thiso.itemname@"</center>";
}
new GuiMLTextCtrl(shoppri) {
profile = GuiBlueMLTextProfile;
x = 0;
y = 45;
width = 160;
height = 1;
text = "<center>Price:</center>";
}
new GuiMLTextCtrl(shopprice) {
profile = GuiBlueMLTextProfile;
x = 0;
y = 65;
width = 160;
height = 1;
text = "<center>"@thiso.price@" $</center>";
}
new GuiFrameSetCtrl("Test_Frames") {
x = 10;
y = 65;
width = 140;
height = 15;
rowcount = 1;
columncount = 1;
setColumnOffset(1,80);
setRowOffset(1,80);
bordercolor = {128,128,255,128};
new GuiScrollCtrl("Test_Frame1") {
profile = GuiBlueScrollProfile;
hScrollBar = "dynamic";
vScrollBar = "dynamic";
}
}
new GuiButtonCtrl("cancelb") {
profile = GuiBlueButtonProfile;
x = 10;
y = 90;
width = 50;
height = 20;
text = "Cancel";
}
new GuiButtonCtrl("buyb") {
profile = GuiBlueButtonProfile;
x = 100;
y = 90;
width = 50;
height = 20;
text = "Buy";
}
}
Test_Frames.PushtoBack();
}
function cancelb.onAction(){
shopwin.destroy();
}
function buyb.onAction(){
if (client.money >[email protected]){
client.money -=this.price;
triggeraction(0,0,"serverside","-Shop","addw",this.item);
}
}
The -shop npc:
HTML Code:
function onActionServerside(){
if (params[0] == "addw") {
addweapon(params[1]);
}
}
But I cant get the weapon to add to the player.
