Clonk-Center Titelbild

Inserate / Ein Geschäfts-Script verändern




SchreiberThe_Clonk-King
Datum19.10.2008 17:46:37
KategorieClonkscript:Allgemein
StatusAbgeschlossen
Interessiertekeine


Ich möchte, dass mir jemand diesen Geschäfts-Script so verändert, dass das Menü nach einem Kauf noch offen bleibt! So dass man ein Objekt mehrfach kaufen kann ohne das Menü immer wieder neu öffnen zu müssen!

Der Lohn: 25 Clunker

Der Script:

/*-- Geschäft --*/

#strict

#include BAS7

protected func Destruction()
{
  if (Local(9)) RemoveObject(Local(9));
  return(1);
}

/* Eingangssteuerung */

protected func ActivateEntrance()
{
  if (ActIdle()) SetAction("OpenDoor");
  return(1);
}

private func OpenEntrance()
{
  SetEntrance(1);
  return(1);
}

private func CloseEntrance()
{
  SetEntrance(0);
  return(1);
}

private func SoundOpenDoor()
{
  return(Sound("DoorOpen"));
}

private func SoundCloseDoor()
{
  return(Sound("DoorClose"));
}


/* Einkaufen */
public func ContainedUp(pClonk)
  {
  [Recruit item|Image=_WPI]
  //Create the menu
  CreateMenu(_VKS, pClonk);
  AddMenuItem("Bausatz (15 Gold)", "CreateMember", CNKT, pClonk, 0, pClonk);
  AddMenuItem("Brandbombe (25 Gold)", "CreateMember", FBMP, pClonk, 0, pClonk);
  AddMenuItem("Leitungsbausatz (10 Gold)", "CreateMember", LNKT, pClonk, 0, pClonk);
  AddMenuItem("Metall (8 Gold)", "CreateMember", METL, pClonk, 0, pClonk);
  AddMenuItem("Stein (1 Gold)", "CreateMember", ROCK, pClonk, 0, pClonk);
  AddMenuItem("Holz (2 Gold)", "CreateMember", WOOD, pClonk, 0, pClonk);
  AddMenuItem("Wipf (15 Gold)", "CreateMember", WIPF, pClonk, 0, pClonk);
  AddMenuItem("Vogel (5 Gold)", "CreateMember", BIRD, pClonk, 0, pClonk);
  AddMenuItem("Toten Vogel (1 Gold)", "CreateMember", DBRD, pClonk, 0, pClonk);
  AddMenuItem("Vogelei (10 Gold)", "CreateMember", BEGG, pClonk, 0, pClonk);
  AddMenuItem("Feuermonsterei (20 Gold)", "CreateMember", FMEG, pClonk, 0, pClonk);
  AddMenuItem("Fisch (10 Gold)", "CreateMember", FISH, pClonk, 0, pClonk);
  AddMenuItem("Monsterei (10 Gold)", "CreateMember", MEGG, pClonk, 0, pClonk);
  AddMenuItem("Schlange (7 Gold)", "CreateMember", SNKE, pClonk, 0, pClonk);
  AddMenuItem("Hai (20 Gold)", "CreateMember", SHRK, pClonk, 0, pClonk);
  AddMenuItem("Zapnest (5 Gold)", "CreateMember", ZAPN, pClonk, 0, pClonk);
  AddMenuItem("Säurefass (10 Gold)", "CreateMember", ABRL, pClonk, 0, pClonk);
  AddMenuItem("Lavafass (10 Gold)", "CreateMember", LBRL, pClonk, 0, pClonk);
  AddMenuItem("Ölfass (25 Gold)", "CreateMember", OBRL, pClonk, 0, pClonk);
  AddMenuItem("Wasserfass (7 Gold)", "CreateMember", WBRL, pClonk, 0, pClonk);
  AddMenuItem("Asche", "CreateMember", ASHS, pClonk, 0, pClonk);
  AddMenuItem("Erde", "CreateMember", ERTH, pClonk, 0, pClonk);
  AddMenuItem("Eis", "CreateMember", ICE1, pClonk, 0, pClonk);
  AddMenuItem("Sand", "CreateMember", SAND, pClonk, 0, pClonk);
  return(1);
}

public func CreateMember(id idObj, object pClonk)
  {
  var iPlr = GetOwner(pClonk);
  //Not enough gold?
  if(GetWealth(iPlr) < Value(idObj))
    {
    //Message
    PlayerMessage(iPlr, "Du bist Pleite!", pClonk);
    //"Error" sound
    Sound("Error", true, 0, 0, iPlr);
    return(0);
    }
  //Create item
  var object = CreateContents(idObj, this());
  Collect(object, pClonk);
  //Real owner
  SetOwner(GetOwner(pClonk), object);
  //Siphon money
  DoWealth(GetOwner(pClonk), -Value(idObj));
  Sound("UnCash", true, 0, 0, iPlr);
  }


2 Kommentare


19.10.2008 18:17 von The_Clonk-King:
Danke, ich sende dir jetzt die 25 Clunker!

19.10.2008 18:02 von Kevda:
public func ContainedUp(pClonk)
  {
  [Recruit item|Image=_WPI]
  //Create the menu
  CreateMenu (_VKS, pClonk, 0, 0, 0, 0, 0, 1);
  AddMenuItem("Bausatz (15 Gold)", "CreateMember", CNKT, pClonk, 0, pClonk);
  AddMenuItem("Brandbombe (25 Gold)", "CreateMember", FBMP, pClonk, 0, pClonk);
  AddMenuItem("Leitungsbausatz (10 Gold)", "CreateMember", LNKT, pClonk, 0, pClonk);
  AddMenuItem("Metall (8 Gold)", "CreateMember", METL, pClonk, 0, pClonk);
  AddMenuItem("Stein (1 Gold)", "CreateMember", ROCK, pClonk, 0, pClonk);
  AddMenuItem("Holz (2 Gold)", "CreateMember", WOOD, pClonk, 0, pClonk);
  AddMenuItem("Wipf (15 Gold)", "CreateMember", WIPF, pClonk, 0, pClonk);
  AddMenuItem("Vogel (5 Gold)", "CreateMember", BIRD, pClonk, 0, pClonk);
  AddMenuItem("Toten Vogel (1 Gold)", "CreateMember", DBRD, pClonk, 0, pClonk);
  AddMenuItem("Vogelei (10 Gold)", "CreateMember", BEGG, pClonk, 0, pClonk);
  AddMenuItem("Feuermonsterei (20 Gold)", "CreateMember", FMEG, pClonk, 0, pClonk);
  AddMenuItem("Fisch (10 Gold)", "CreateMember", FISH, pClonk, 0, pClonk);
  AddMenuItem("Monsterei (10 Gold)", "CreateMember", MEGG, pClonk, 0, pClonk);
  AddMenuItem("Schlange (7 Gold)", "CreateMember", SNKE, pClonk, 0, pClonk);
  AddMenuItem("Hai (20 Gold)", "CreateMember", SHRK, pClonk, 0, pClonk);
  AddMenuItem("Zapnest (5 Gold)", "CreateMember", ZAPN, pClonk, 0, pClonk);
  AddMenuItem("Säurefass (10 Gold)", "CreateMember", ABRL, pClonk, 0, pClonk);
  AddMenuItem("Lavafass (10 Gold)", "CreateMember", LBRL, pClonk, 0, pClonk);
  AddMenuItem("Ölfass (25 Gold)", "CreateMember", OBRL, pClonk, 0, pClonk);
  AddMenuItem("Wasserfass (7 Gold)", "CreateMember", WBRL, pClonk, 0, pClonk);
  AddMenuItem("Asche", "CreateMember", ASHS, pClonk, 0, pClonk);
  AddMenuItem("Erde", "CreateMember", ERTH, pClonk, 0, pClonk);
  AddMenuItem("Eis", "CreateMember", ICE1, pClonk, 0, pClonk);
  AddMenuItem("Sand", "CreateMember", SAND, pClonk, 0, pClonk);
  return(1);
}