collapse

Author [EN] [PL] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: question about cash on a player  (Read 1816 times)

Offline Apocalypse

  • Fledgling
  • *
  • Posts: 21
  • Reputation: +201/-0
question about cash on a player
« on: June 24, 2013, 09:36:12 pm »
is there any way to use the cash on a player as a variable so you can subtract or add to the value they have.. when you do a spell or click on a object like a prop??

Offline Javokis

  • Horse's Dick
  • Administratrix
  • Antediluvian
  • *****
  • Posts: 45914
  • Reputation: +297/-1
Re: question about cash on a player
« Reply #1 on: June 25, 2013, 12:46:27 am »
There is a way to add cash to the player by dropping it as an item, but there's no practical way to call up the player's cash in the Java API. Best thing to do is to bring up a shop interface for all transactions involving taking cash from the player - it's the only way to be sure the right person is giving the right amount of cash. Club Abla actually has an example of giving cash to the players through a conversation, but that's the most practical way of doing it.
"There's nothing wrong with horses dicks, there's nothing wrong with sucking horses dicks." Signo

Offline Apocalypse

  • Fledgling
  • *
  • Posts: 21
  • Reputation: +201/-0
Re: question about cash on a player
« Reply #2 on: June 26, 2013, 03:51:10 am »
awe ok thats cool so much for my vending machine idea unless you have free machines lol

Offline Signothorn

  • Administratrix
  • Antediluvian
  • *****
  • Posts: 15192
  • Reputation: +1149/-3
Re: question about cash on a player
« Reply #3 on: June 26, 2013, 04:33:07 am »
Would there be a way to edit the not file to make a vendor take the form of an object with no voice?

Offline Javokis

  • Horse's Dick
  • Administratrix
  • Antediluvian
  • *****
  • Posts: 45914
  • Reputation: +297/-1
Re: question about cash on a player
« Reply #4 on: June 26, 2013, 04:53:24 pm »
No. The voice is controlled by the java script that initiates the vendor interface. You would have to edit the script, or make a slightly altered new script that doesn't have voice calls.
"There's nothing wrong with horses dicks, there's nothing wrong with sucking horses dicks." Signo

Offline Apocalypse

  • Fledgling
  • *
  • Posts: 21
  • Reputation: +201/-0
Re: question about cash on a player
« Reply #5 on: June 30, 2013, 05:11:17 am »
you could set a variable couldnt you likefor a prop when its clicked it adds +1 to a variable and when it reaches a certain number it does something.. cause if you did do like a free machine or something that give something you could set the props value to a certan number and if it was clicked past that many times it would say that the machine was out? or heck you could even take a machine that exchanged blood or health when you clicked it for a item so it would tech be free lol just throwing that out there

Offline Apocalypse

  • Fledgling
  • *
  • Posts: 21
  • Reputation: +201/-0
Re: question about cash on a player
« Reply #6 on: June 30, 2013, 05:17:59 am »
meant wouldnt be free lol

Offline Javokis

  • Horse's Dick
  • Administratrix
  • Antediluvian
  • *****
  • Posts: 45914
  • Reputation: +297/-1
Re: question about cash on a player
« Reply #7 on: June 30, 2013, 05:31:00 am »
Yes... that would actually be quite a simple script to make.
"There's nothing wrong with horses dicks, there's nothing wrong with sucking horses dicks." Signo

Offline Javokis

  • Horse's Dick
  • Administratrix
  • Antediluvian
  • *****
  • Posts: 45914
  • Reputation: +297/-1
Re: question about cash on a player
« Reply #8 on: June 30, 2013, 05:44:50 am »
here, I'll throw you a bone

Code: [Select]

public class PopMachine extends Codex
{

     private int numItems = 10;

     public void clicked(int guid, int clickerGuid, int captureID){

          CodexActor clicker = new CodexActor(clickerGuid);

          if(numItems > 0 && clicker.GetActorStat(ACTOR_STAT_BLOOD) >= 10)
          {
                  numItems--;

                  //give player something
                  clicker.SpawnThing("item");
             
                   //take blood
                  clicker.AddActorEffectByValue("ef_decreaseblood", 0, -10, 0, 0);

                new CodexSound("bigBox_pickup.wav", 300, 600, 100, 0, 0, GetClassThing());
          } else {
                //do nothing.... or print fail... or make a sound... oh for crying out loud...

                new CodexSound("digitalBleep_05.wav", 300, 600, 100, 0, 0, GetClassThing());
          }
    }
}
"There's nothing wrong with horses dicks, there's nothing wrong with sucking horses dicks." Signo

Offline Apocalypse

  • Fledgling
  • *
  • Posts: 21
  • Reputation: +201/-0
Re: question about cash on a player
« Reply #9 on: July 01, 2013, 03:01:45 am »
good deal  thanks i might look into this and see hat i can do  with it... maybe  design some graphics if you or anyone wanted to impliment them in md maps

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal