May 31, 2020, 07:31 pm

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Bouchiekins

Pages: [1] 2 3 ... 10
1
Suggestions and Questions / Rule suggestions/revisions
« on: March 26, 2017, 11:21 am »
I had a read through of all the rules to catch up on what's changed and I've come up with a list of things I would change.
These are just suggestions and are topics I think should be looked at.
Here we go:


ByB rule suggestions:
      
The Basics

      Rule 9 random "?"

Base
      Add: Raiders should not be forced to crouch anywhere in or right after the raiding entrance.
      5. Your keypad MUST be open for at least 8 seconds. --> keypad = keypadded door
      11 You may not run in and our of Automated Fading Doors... --> in and out of*
   
Criminals
   Kidnapper
         9. Do not use this job to just knock out and RDM people. --> I suggest removing it, RDM is already in rule 3
         Rule 12 is the same as rule 7
         Under rule 14 "certain jobs" should be specified (criminals maybe?)
      
   Meth cook
         Take the (last) gang part out of rule 3 and expand rule 6 to cover it
      
   Mercenary
         Rule 3 should be broken up into two rules
         Rule 6 kind of goes against being a body guard. Can mercenaries not protect a store for 5 minutes when a Gun Dealer is anxious?
      
   Gun Dealer
         Rule 3 has some errors in it
         Change rule 5 from "base" to owning a shop
         Change rule 2 to just state a Gun Dealer has to be in his shop almost all the time
      
   Landlord
         Rule 7 seems very conflicting with earlier rules, he can't have a keypadded home right?
      
   Mayor
         Rule 1: Put the lockdown part in a new rule; Same with the politician, corrupt, construction and assistant parts
         Rule 3 is the same as in the corrupt part ^
         Rule 6 and 8 are in rule 1 already
         Rule 11 is the corruption rule (and rule 8)
         Rule 13 necessary?
      
   Police Officer
         Rule 2: roleplay home, lethal force and search warrants in a new rule
         Rule 3: Corrupt, wanted NLR and weapon checker in a new rule
         Rule 8 is also about being corrupt
      
   Bounty Hunter
         Rule 1 is long and has two "a?""-errors in it
      
   Traffic Cop
         Rule 3 "... propery raids..."
   
Gangs and groups
      Put the jobs in an un-numbered list (an extra tab in)
   
Admin Rules
      Maybe start with the fact that there's a guide?
      State Warn > Slay > Kick > Ban
      Remove the "Please" from rule 4
      Rule 5 should have a more serious example
      Put rule 6 as the first rule possible? Or the second one after common sense?
      Rule 8 covers rule 7, right? If not, slightly change rule 8 to incorporate it instead?
      Specify about who rule 13 is (is the Mayor or the police officer the subject here?)
      In rule 15: "This also includes disobeying a superadmins or root admins." Should have "orders" at the end?

   
Last thing I wanted to say is there should be clearer rule about hidden keypads; these have been a problem for too long. When is a keypad hidden? Is actively putting it around a slight corner hiding it?


That's it, hope it helps.

2
Suggestions and Questions / [RP4 Rebirth] Weed entity limits
« on: August 22, 2016, 03:49 pm »
I was making some weed earlier and the limits on some of the entities really annoyed me.
I suggest the following for a smooth growing experience:

  • 6 "Multiple Pot"s
  • 6 Showers
  • 1 Water tank
  • 3 Radial lamps
  • 4 or 6 Basic lamps
  • 6 of each pots OR 3 of each pot but 6 flower pots.

That should be a sufficient amount of growing items to keep you busy 24/7.

AutoMerge: August 22, 2016, 10:56 pm
Also:

  • 6 rechargable batteries

3
Wire / E2 / [Release] Money Printer Chatter
« on: July 19, 2015, 09:21 pm »
A simple E2 that gathers all the printers in the near vicinity and then gives you some info.

Read the box at the top of the E2 code for a small introduction.

No wiring required.



Code:
Code: [Select]
@name Money Printer Chatter
@persist [Printers ActualPrinters]:array [PrintColor MessageColor]:vector
@persist MoneyInPrinters OldMoney Rate MoneyInterval FireInterval

#############################################################################################################
#                                                                                                           #
#   This E2 gives you some basic info about your printers.                                                  #
#                                                                                                           #
#   Chat commands: showmoney, showprinters, moneyinterval, fireinterval, debug                              #
#                                                                                                           #
#   Examples:                                                                                               #
#   showmoney                                                                                               #
#       Shows the amount of moneyprinters and the amount of money they've made.                             #
#   showprinters                                                                                            #
#       Shows the amount of moneyprinters and their types.                                                  #
#   moneyinterval 20000                                                                                     #
#       Starts a timer to show you the amount of money in the moneyprinters. 0 to turn off.                 #
#   fireinterval 5000                                                                                       #
#       Starts a timer to check for fires. Gives you a message once one has been found. 0 to turn off.      #
#   debug                                                                                                   #
#       Shows some debug info.                                                                              #
#   reset                                                                                                   #
#       Resets the arrays and timers. (not so much helpful after the arrayCheck() function was made)        #
#                                                                                                           #
#   This E2 is made by Bouche Dag.                                                                          #
#                                                                                                           #
#############################################################################################################

runOnChat(1)

function gatherPrinters() {
    # Making array Printers and putting all moneyprinters from that into Actualprinters
    MoneyInPrinters = 0
    findByModel("models/props_lab/reciever01a.mdl")
    findSortByDistance(entity():pos())
    Printers = findToArray()
    for(I = 1, Printers:count()) {
        if((Printers[I,entity]:pos() - entity():pos()):length() < 50) {
            if(Printers[I,entity]:isPrinter()) {
                ActualPrinters[I,entity] = Printers[I,entity]
                MoneyInPrinters += ActualPrinters[I,entity]:printedMoney()
            }
        }
    }
}

function printPrinters() {
    PrintersString = "You have " + ActualPrinters:count() + " printers of these types: "
    for(I = 1, ActualPrinters:count()) {
        if(I == (ActualPrinters:count() - 1)) {
            PrintersString += ActualPrinters[I,entity]:printerType() + " and "
        } elseif(I == ActualPrinters:count()) {
            PrintersString += ActualPrinters[I,entity]:printerType() + "."
        } else {
            PrintersString += ActualPrinters[I,entity]:printerType() + ", "
        }
    }
    printColor(PrintColor,PrintersString)
}

function printMoney() {
    if(ActualPrinters:count() == 1) {
        printColor(PrintColor,"Your " + ActualPrinters:count() + " printer has made $" + MoneyInPrinters + " at a rate of $" + Rate + "/min.")
    } else {
        printColor(PrintColor,"Your " + ActualPrinters:count() + " printers have made $" + MoneyInPrinters + " at a rate of $" + Rate + "/min.")
    }
}

function printDebug() {
    AmountOfPrinters = 0
    AmountOfOtherItems = 0
    for(I = 1, ActualPrinters:count()) {
        if(ActualPrinters[I,entity]:isPrinter()) {
            AmountOfPrinters++
            print("Type of " + I + " is: " + ActualPrinters[I,entity]:type() + ", of type: " + ActualPrinters[I,entity]:printerType() + ", with $" + ActualPrinters[I,entity]:printedMoney() + " in it.")
        } else {
            AmountOfOtherItems++
            print("Type of " + I + " is: " + ActualPrinters[I,entity]:type())
        }
    }
    print("Total amount of items in array: " + ActualPrinters:count() + ", printers: " + AmountOfPrinters + ", other items: " + AmountOfOtherItems + ".")
    print("Money: " + MoneyInPrinters + ", Rate: " + Rate)
}

function checkFires() {
    for(I = 1, ActualPrinters:count()) {
        if(ActualPrinters[I,entity]:isOnFire()) {
            printColor(PrintColor,"Your " + ActualPrinters[I,entity]:printerType() + " printer is on fire!")
        }
    }
}

function gatherAndRate() {
    OldMoney = MoneyInPrinters
    gatherPrinters()
    Rate = (MoneyInPrinters-OldMoney)*(60/(MoneyInterval/1000))
    if(Rate < 0) {
        Rate = 0
    }
}

function resetE2() {
    printColor(MessageColor,"Money Printer Chatter is being reset...")
    while(ActualPrinters:count() > 0) {
        ActualPrinters:pop()
    }
    gatherAndRate()
    stoptimer("moneyInterval")
    stoptimer("fireinterval")
    timer("moneyInterval",MoneyInterval)
    timer("fireInterval",FireInterval)
}

function arrayCheck() {
    for(I = 1, ActualPrinters:count()) {
        if(!ActualPrinters[I,entity]:isPrinter()) {
            ActualPrinters:remove(I)
            I -= I
        }
    }
}

if(first() | dupefinished() | inputClk()) {
    printColor(vec(25,200,50),"Made by Bouche Dag.")
    gatherPrinters()
    MoneyInterval = 60000
    FireInterval = 5000
    PrintColor = vec(250,20,100)
    MessageColor = vec(250,20,20)
    printColor(PrintColor,"Your money interval has been set to: " + MoneyInterval + "ms (" + (MoneyInterval/1000) + "s).")
    timer("moneyInterval",MoneyInterval)
    printColor(PrintColor,"Your fire interval has been set to: " + FireInterval + "ms (" + (FireInterval/1000) + "s).")
    timer("fireInterval",FireInterval)
    timer("arrayCheck",60000)
}

if(chatClk(owner())) {
    Chat = owner():lastSaid():explode(" ")
    if(Chat[1,string]:lower() == "showmoney") {
        hideChat(1)
        printMoney()
    } elseif(Chat[1,string]:lower() == "showprinters") {
        hideChat(1)
        printPrinters()
    } elseif(Chat[1,string]:lower() == "moneyinterval") {
        hideChat(1)
        stoptimer("moneyInterval")
        MoneyInterval = Chat[2,string]:toNumber()
        if(MoneyInterval == 0) {
            printColor(PrintColor,"Your money interval has been turned off.")
        } elseif(MoneyInterval >= 10000) {
            timer("moneyInterval",MoneyInterval)
            printColor(PrintColor,"Your money interval has been set to: " + MoneyInterval + "ms (" + (MoneyInterval/1000) + "s).")
        } else {
            MoneyInterval = 10000
            timer("moneyInterval",MoneyInterval)
            printColor(MessageColor,"The minimum interval is 10000, your money interval has been set to: " + MoneyInterval + "ms (" + (MoneyInterval/1000) + "s).")
        }
    } elseif(Chat[1,string]:lower() == "fireinterval") {
        hideChat(1)
        stoptimer("fireInterval")
        FireInterval = Chat[2,string]:toNumber()
        if(FireInterval == 0) {
            printColor(PrintColor,"Your fire interval has been turned off.")
        } elseif(FireInterval >= 5000) {
            timer("fireInterval",FireInterval)
            printColor(PrintColor,"Your fire interval has been set to: " + FireInterval + "ms (" + (FireInterval/1000) + "s).")
        } else {
            FireInterval = 5000
            timer("fireInterval",FireInterval)
            printColor(MessageColor,"The minimum interval is 5000, your fire interval has been set to: " + FireInterval + "ms (" + (FireInterval/1000) + "s).")
        }
    } elseif(Chat[1,string]:lower() == "debug") {
        hideChat(1)
        printDebug()
    } elseif(Chat[1,string]:lower() == "reset") {
        hideChat(1)
        resetE2()
    }
}

if(clk("moneyInterval")) {
    gatherAndRate()
    printMoney()
    timer("moneyInterval",MoneyInterval)
}

if(clk("fireInterval")) {
    checkFires()
    timer("fireInterval",FireInterval)
}

if(clk("arrayCheck")) {
    arrayCheck()
    timer("arrayCheck",60000)
}

4
Wire / E2 / [Release] Arrow Shop Sign
« on: July 12, 2015, 12:53 pm »
It's been a long time...





Two "simple" E2s.
One that's an arrow right, one that's an arrow left.

It shows some text so that you can advertise your shop.

Colors are set at random when you past the E2 and with a command.


Read the damn box!



Wiring:

Simply place an EGP Emitter and the E2.
Then wire: E2 [A] -> Emitter [Wirelink]



Arrow right:
Code: [Select]
@name Arrow Shop Sign Right
@inputs A:wirelink
@persist [CO CO1 CO2 CI CT]:vector CR CRS [Line1 Line2]:string

runOnChat(1)

#################################################################################
#   Arrow Shop Sign, made by Bouche Dag.                                        #
#                                                                               #
#   Chat commands: co1, co2, cr, ci, line1, line2                               #
#                                                                               #
#   Examples:                                                                   #
#   co1 20 20 20                                                                #
#       Sets the outside color to those RGB values                              #
#   co2 250 250 250                                                             #
#       Sets the second outside color to those RGB values (for 'cr')            #
#   cr                                                                          #
#       Starts outside color rotation                                           #
#   crs 5000                                                                    #
#       Changes the speed of cr to the value (in miliseconds)                   #
#   ci                                                                          #
#       Sets the inside color to those RGB values                               #
#   line1 Hi, I am Bear.                                                        #
#       Sets the text of the first line to that text                            #
#   line2 And this is my crib.                                                  #
#       Sets the text of the second line to that text                           #
#   random                                                                      #
#       Changes all the colors to a random color                                #
#   reset                                                                       #
#       Resets E2 to default values                                             #
#                                                                               #
#################################################################################

function makeEGP() {
    A:egpClear()
    # Outside
    A:egpTriangle(10,vec2(401,239),vec2(401,509),vec2(565,384))
    A:egpColor(10,CO)
    A:egpBox(12,vec2(256,384),vec2(310,160))
    A:egpColor(12,CO)
    # Inside
    A:egpTriangle(14,vec2(406,249),vec2(406,499),vec2(556,384))
    A:egpColor(14,CI)
    A:egpBox(16,vec2(256,384),vec2(300,150))
    A:egpColor(16,CI)
    # Text
    A:egpText(20,Line1,vec2(276,340))
    A:egpColor(20,CT)
    A:egpSize(20,40)
    A:egpAlign(20,1)
    A:egpText(22,Line2,vec2(276,380))
    A:egpColor(22,CT)
    A:egpSize(22,40)
    A:egpAlign(22,1)
}

function randomColors() {
    CO1 = vec(randint(0,255),randint(0,255),randint(0,255))
    CO = CO1
    CI = vec(randint(0,255),randint(0,255),randint(0,255))
    CT = vec(randint(0,255),randint(0,255),randint(0,255))
}

if(first() || inputClk() || duped() || clk("reset")) {
    A:egpClear()
   
    randomColors()
   
    Line1 = owner():name()+ "'s"
    Line2 = "Something"
   
    CRS = 2000
   
    makeEGP()
}

if(chatClk(owner())) {
    Chat = owner():lastSaid():explode(" ")
    Chat2 = owner():lastSaid():explode(Chat[1,string])
    if(Chat[1,string]:lower() == "co1") {
        hideChat(1)
        CO1 = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        CO = CO1
        makeEGP()
    } elseif (Chat[1,string]:lower() == "co2") {
        hideChat(1)
        CO2 = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "cr") {
        hideChat(1)
        CR = 1
        timer("CR",CRS)
    } elseif (Chat[1,string]:lower() == "crs") {
        hideChat(1)
        CRS = Chat2[2,string]:toNumber()
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "ci") {
        hideChat(1)
        CI = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "ct") {
        hideChat(1)
        CT = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "line1") {
        hideChat(1)
        Line1 = Chat2[2,string]
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "line2") {
        hideChat(1)
        Line2 = Chat2[2,string]
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "random") {
        hideChat(1)
        randomColors()
        makeEGP()
    } elseif (Chat[1,string]:lower() == "reset") {
        hideChat(1)
        timer("reset",50)
    }
}

if(clk("CR") && CR == 1) {
    if(CO == CO1) {
        CO = CO2
        makeEGP()
    } else {
        CO = CO1
        makeEGP()
    }
    timer("CR",CRS)
}

Arrow left:
Code: [Select]
@name Arrow Shop Sign Left
@inputs A:wirelink
@persist [CO CO1 CO2 CI CT]:vector CR CRS [Line1 Line2]:string

runOnChat(1)

#################################################################################
#   Arrow Shop Sign, made by Bouche Dag.                                        #
#                                                                               #
#   Chat commands: co1, co2, cr, ci, line1, line2                               #
#                                                                               #
#   Examples:                                                                   #
#   co1 20 20 20                                                                #
#       Sets the outside color to those RGB values                              #
#   co2 250 250 250                                                             #
#       Sets the second outside color to those RGB values (for 'cr')            #
#   cr                                                                          #
#       Starts outside color rotation                                           #
#   crs 5000                                                                    #
#       Changes the speed of cr to the value (in miliseconds)                   #
#   ci                                                                          #
#       Sets the inside color to those RGB values                               #
#   line1 Hi, I am Bear.                                                        #
#       Sets the text of the first line to that text                            #
#   line2 And this is my crib.                                                  #
#       Sets the text of the second line to that text                           #
#   random                                                                      #
#       Changes all the colors to a random color                                #
#   reset                                                                       #
#       Resets E2 to default values                                             #
#                                                                               #
#################################################################################

function makeEGP() {
    A:egpClear()
    # Outside
    A:egpTriangle(10,vec2(111,239),vec2(111,509),vec2(-54,384))
    A:egpColor(10,CO)
    A:egpBox(12,vec2(256,384),vec2(310,160))
    A:egpColor(12,CO)
    # Inside
    A:egpTriangle(14,vec2(106,249),vec2(106,499),vec2(-44,384))
    A:egpColor(14,CI)
    A:egpBox(16,vec2(256,384),vec2(300,150))
    A:egpColor(16,CI)
    # Text
    A:egpText(20,Line1,vec2(236,340))
    A:egpColor(20,CT)
    A:egpSize(20,40)
    A:egpAlign(20,1)
    A:egpText(22,Line2,vec2(236,380))
    A:egpColor(22,CT)
    A:egpSize(22,40)
    A:egpAlign(22,1)
}

function randomColors() {
    CO1 = vec(randint(0,255),randint(0,255),randint(0,255))
    CO = CO1
    CI = vec(randint(0,255),randint(0,255),randint(0,255))
    CT = vec(randint(0,255),randint(0,255),randint(0,255))
}
   
if(first() || inputClk() || duped() || clk("reset")) {
    A:egpClear()
   
    randomColors()
   
    Line1 = owner():name()+ "'s"
    Line2 = "Something"
   
    CRS = 2000
   
    makeEGP()
}

if(chatClk(owner())) {
    Chat = owner():lastSaid():explode(" ")
    Chat2 = owner():lastSaid():explode(Chat[1,string])
    if(Chat[1,string]:lower() == "co1") {
        hideChat(1)
        CO1 = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        CO = CO1
        makeEGP()
    } elseif (Chat[1,string]:lower() == "co2") {
        hideChat(1)
        CO2 = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "cr") {
        hideChat(1)
        CR = 1
        timer("CR",CRS)
    } elseif (Chat[1,string]:lower() == "crs") {
        hideChat(1)
        CRS = Chat2[2,string]:toNumber()
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "ci") {
        hideChat(1)
        CI = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()       
    } elseif (Chat[1,string]:lower() == "ct") {
        hideChat(1)
        CT = vec(Chat[2,string]:toNumber(),Chat[3,string]:toNumber(),Chat[4,string]:toNumber())
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "line1") {
        hideChat(1)
        Line1 = Chat2[2,string]
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "line2") {
        hideChat(1)
        Line2 = Chat2[2,string]
        makeEGP()   
    } elseif (Chat[1,string]:lower() == "random") {
        hideChat(1)
        randomColors()
        makeEGP()
    } elseif (Chat[1,string]:lower() == "reset") {
        hideChat(1)
        timer("reset",50)
    }
}

if(clk("CR") && CR == 1) {
    if(CO == CO1) {
        CO = CO2
        makeEGP()
    } else {
        CO = CO1
        makeEGP()
    }
    timer("CR",CRS)
}

5
Suggestions and Questions / weldall --> unweldall
« on: April 11, 2015, 07:15 pm »
Weldall is fantistic, everyone should know that by now.
But what about a command to undo all your welds?
For server performance reasons.

Shouldn't be too difficult and you could notify users in the "weldall" hint-message that they should undo them as well.

Also, does the lagcheck properly remove welds again?
I know it didn't for a while but I'm not sure if that's fixed now.

6
Wire / E2 / [Release] Keypad access log v1
« on: March 18, 2015, 05:56 pm »
Info:
This one's pretty useless but I made it anyways.
It does what the name says but can also be used for buttons or fading door E2s...

Wire info:
Simply wire the inputs to keypads.
For example wire: E2[K1] -> Keypad[Valid]
Or for a door E2: E2[K3] -> E2[Fade] (this E2 -> door E2)

Extra info:
Comes with two chat commands.
Copy help test from E2:
Quote
------------------------------------------
Welcome Bouche Dag. to Keypad access log v1.
There are two commands; 'showlog' and 'changename'. An example for both:
showlog
changename 1 Test
This last one is always to be used as 'changename x Name',
        where 'x' is the keypad number (1 to 4) and 'Name' is the name.
------------------------------------------


Code:
Code: [Select]
@name Keypad access log v1
@inputs K1 K2 K3 K4
@persist [Log Chat]:array Owner:entity Q
@persist [K1Name K2Name K3Name K4Name Time]:string

runOnChat(1)

function string showTime() {
    Time = ""
    if(time("hour") < 10) {
        Time += "0" + time("hour") + ":"
    } else {
        Time += time("hour") + ":"
    }
    if(time("min") < 10) {
        Time += "0" + time("min") + ":"
    } else {
        Time += time("min") + ":"
    }
    if(time("sec") < 10) {
        Time += "0" + time("sec")
    } else {
        Time += time("sec")
    }
    return Time
}

if(first() | duped()) {
    Owner = owner()
    K1Name = "Keypad 1"
    K2Name = "Keypad 2"
    K3Name = "Keypad 3"
    K4Name = "Keypad 4"
   
    printColor(vec(25,25,200),"------------------------------------------")
    printColor(vec(25,25,200),"Welcome " + Owner:name() + " to Keypad access log v1.")
    printColor(vec(25,25,200),"There are two commands; 'showlog' and 'changename'. An example for both:")
    printColor(vec(250,250,250),"showlog")
    printColor(vec(250,250,250),"changename 1 Test")
    printColor(vec(25,25,200),"This last one is always to be used as 'changename x Name',
        where 'x' is the keypad number (1 to 4) and 'Name' is the name.")
    printColor(vec(25,25,200),"------------------------------------------")
}

if(K1 | K2 | K3 | K4) {
    if(K1) {
        Log:pushString(K1Name + " accessed at: " + showTime())
        printColor(vec(10,10,10),K1Name + " has just been used.")
    } elseif(K2) {
        Log:pushString(K2Name + " accessed at: " + showTime())
        printColor(vec(10,10,10),K2Name + " has just been used.")
    } elseif(K3) {
        Log:pushString(K3Name + " accessed at: " + showTime())
        printColor(vec(10,10,10),K3Name + " has just been used.")
    } elseif(K4) {
        Log:pushString(K4Name + " accessed at: " + showTime())
        printColor(vec(10,10,10),K4Name + " has just been used.")
    }
}

if(chatClk(Owner)) {
    Chat = Owner:lastSaid():explode(" ")
    if(Chat[1,string]:lower() == "showlog") {
        hideChat(1)
        if(Log:count() < 1) {
            printColor(vec(10,10,10),"-- Log is empty.")
        } else {
            printColor(vec(10,10,10),"------------------------------------------")
            for(Q = 1, Log:count()) {
                printColor(vec(10,10,10),"-- " + Log[Q,string])
            }
            printColor(vec(10,10,10),"------------------------------------------")
        }
    } elseif(Chat[1,string]:lower() == "changename") {
        hideChat(1)
        switch(Chat[2,string]:toNumber()) {
            case(1),
                K1Name = Chat[3,string], printColor(vec(10,10,10),"Keypad 1's name changed to " + K1Name)
            case(2),
                K2Name = Chat[3,string], printColor(vec(10,10,10),"Keypad 2's name changed to " + K2Name)
            case(3),
                K3Name = Chat[3,string], printColor(vec(10,10,10),"Keypad 3's name changed to " + K3Name)
            case(4),
                K4Name = Chat[3,string], printColor(vec(10,10,10),"Keypad 4's name changed to " + K4Name)
        }
    }
}

7
DarkRP - MOTD Revisions / Gun Dealer stall rule revision
« on: March 17, 2015, 10:30 pm »
Currently this is a part of the Gun Dealer rules:
Quote
  • You must maintain a shop. You may leave the shop, go to your apartment or food shopping. However extended absence may result in demotion. Anyone abusing this new rule may be shocked and sent away for a while :)
    • You may build a small market stall on the streets if you don't want a full blown shop. This must be a stall rather then a propbase (no raiding entrance of any kind). Much less security is the risk you take in having a market stall.

I would suggest changing this rule in such a way that a Gun Dealer is not allowed to put his stall/auto-gunshop-machine in front of another Gun Dealer's store.
Having atleast a couple PHX in between the corners of a Gun Dealer's store before another Gun Dealer's stall/machine can be built will keep the competition friendly.

8
Wire / E2 / EGP Screen Printer Counter v1.1
« on: March 17, 2015, 07:50 pm »
Info:
Here's a printer counter that stays under 150 Ops that gives you plenty of info.
Hope everyone enjoys it, took me a good couple hours to make this.

Chat command:
In the beginning of the code it says:
Code: [Select]
#This is the text you say that triggers the respond from this E2:
ChatText = "showmoney"
This command shows you the money all your printers have printed, and the rate at which the printers are currently printing.
Change this second line to a command of your liking.

Amount info:
When an amount of printers changes, the difference is shown behind the amount like "5(+1)".
This "+1" is to indicate that a printer has been added in the last 5 seconds.
An example is seen in this image http://i.imgur.com/AJUg7OJ.jpg

EGP info:
This E2 is made for EGP Screens but it does work on EGP Emitters as well; it's just pretty big...


Screenshot:
Spoiler: Code is currently hacked to show all printers on the server for demo purposes only; don't do this yourself, it's against the server rules.
Spoiler


Code:
Spoiler: You can't copy it in one go, copy the first ~130 lines, then try the last bit.
Code: [Select]
@name EGP Screen Printer Counter v1
@inputs A:wirelink
@persist [Printers]:array Q P Distance EGPN EGPBoxY EGPX EGPY Player:entity ChatText:string
@persist Ir Si Go Em Ru Am IrP SiP GoP EmP RuP AmP
@persist IrPrev SiPrev GoPrev EmPrev RuPrev AmPrev
@persist IrPrintedPrev SiPrintedPrev GoPrintedPrev EmPrintedPrev RuPrintedPrev AmPrintedPrev
@persist IrPrintedPrevMinute SiPrintedPrevMinute GoPrintedPrevMinute
@persist EmPrintedPrevMinute RuPrintedPrevMinute AmPrintedPrevMinute
@persist IrChange SiChange GoChange EmChange RuChange AmChange
@persist IrTimeout SiTimeout GoTimeout EmTimeout RuTimeout AmTimeout
@persist TotalPrinters TotalPrintersPrev TotalPrinted MoneyPerMinute PreviousMoneyPerMinute PreviousMoney
@persist [PrintersAmount PrintersAmountPrev PrintersMoney PrintersMoneyPrev]:array
@persist [PrintersMinute PrintersMinutePrev PrintersChange PrintersTimeout]:array

runOnChat(1)

#This is the text you say that triggers the respond from this E2:
ChatText = "showmoney"

#Functions
function void findPrinters() {
    Distance = 120
    findInSphere(entity():pos(),Distance)
    findClipToClass("money_printer")
    Printers=findToArray()
}

function void moneyPerMinute() {
    #Money per minute calculation and text
    PreviousMoneyPerMinute = PreviousMoney
    PreviousMoney = TotalPrinted
    MoneyPerMinute = ((TotalPrinted-PreviousMoneyPerMinute)*12)
    A:egpText(42,"~$" + MoneyPerMinute:toString(),vec2(207,407))
    #
    IrPrintedPrevMinute = IrPrintedPrev, IrPrintedPrev = IrP
    IrPrintedMoney = ((IrP-IrPrintedPrevMinute)*12)
    A:egpText(112,"~$" + IrPrintedMoney,vec2(207,115))
    #
    SiPrintedPrevMinute = SiPrintedPrev, SiPrintedPrev = SiP
    SiPrintedMoney = ((SiP-SiPrintedPrevMinute)*12)
    A:egpText(122,"~$" + SiPrintedMoney,vec2(207,165))
    #
    GoPrintedPrevMinute = GoPrintedPrev, GoPrintedPrev = GoP
    GoPrintedMoney = ((GoP-GoPrintedPrevMinute)*12)
    A:egpText(132,"~$" + GoPrintedMoney,vec2(207,215))
    #
    EmPrintedPrevMinute = EmPrintedPrev, EmPrintedPrev = EmP
    EmPrintedMoney = ((EmP-EmPrintedPrevMinute)*12)
    A:egpText(142,"~$" + EmPrintedMoney,vec2(207,265))
    #
    RuPrintedPrevMinute = RuPrintedPrev, RuPrintedPrev = RuP
    RuPrintedMoney = ((RuP-RuPrintedPrevMinute)*12)
    A:egpText(152,"~$" + RuPrintedMoney,vec2(207,315))
    #
    AmPrintedPrevMinute = AmPrintedPrev, AmPrintedPrev = AmP
    AmPrintedMoney = ((AmP-AmPrintedPrevMinute)*12)
    A:egpText(162,"~$" + AmPrintedMoney,vec2(207,365))
}

function void countPrinters() {
    #Set amount of printers & printed money to 0
    Ir = 0, Si = 0, Go = 0, Em = 0, Ru = 0, Am = 0
    IrP = 0, SiP = 0, GoP = 0, EmP = 0, RuP = 0, AmP = 0
    #For reach printer (in range) recognize what type it is and add to variables
    for(Q = 0, Printers:count()) {
        if(Printers[Q,entity]:printerType() == "Iron") {
            Ir++
            IrP += Printers[Q,entity]:printedMoney()
        } elseif(Printers[Q,entity]:printerType() == "Silver") {
            Si++
            SiP += Printers[Q,entity]:printedMoney()
        } elseif(Printers[Q,entity]:printerType() == "Golden") {
            Go++
            GoP += Printers[Q,entity]:printedMoney()
        } elseif(Printers[Q,entity]:printerType() == "Emerald") {
            Em++
            EmP += Printers[Q,entity]:printedMoney()
        } elseif(Printers[Q,entity]:printerType() == "Ruby") {
            Ru++
            RuP += Printers[Q,entity]:printedMoney()
        } elseif(Printers[Q,entity]:printerType() == "Amethyst") {
            Am++
            AmP += Printers[Q,entity]:printedMoney()
        }
    }
    #Show previously (above) calculated money
    A:egpText(114,"$" + IrP:toString(),vec2(410,115))
    A:egpText(124,"$" + SiP:toString(),vec2(410,165))
    A:egpText(134,"$" + GoP:toString(),vec2(410,215))
    A:egpText(144,"$" + EmP:toString(),vec2(410,265))
    A:egpText(154,"$" + RuP:toString(),vec2(410,315))
    A:egpText(164,"$" + AmP:toString(),vec2(410,365))
   
    #Cramped this up to save some space; calculates the amount of printers that have changed
    if(IrPrev != Ir) { IrChange = Ir - IrPrev, IrTimeout = 0 }
    else { IrTimeout++ }
    if(IrTimeout >= 5) { A:egpText(113,Ir:toString(),vec2(325,115)) }
    else { if(IrChange < 0) { A:egpText(113,Ir:toString() + "(" + IrChange + ")",vec2(325,115)) }
        else { A:egpText(113,Ir:toString() + "(+" + IrChange + ")",vec2(325,115)) }
    } IrPrev = Ir
    #
    if(SiPrev != Si) { SiChange = Si - SiPrev, SiTimeout = 0 }
    else { SiTimeout++ }
    if(SiTimeout >= 5) { A:egpText(123,Si:toString(),vec2(325,165)) }
    else { if(SiChange < 0) { A:egpText(123,Si:toString() + "(" + SiChange + ")",vec2(325,165)) }
        else { A:egpText(123,Si:toString() + "(+" + SiChange + ")",vec2(325,165)) }
    } SiPrev = Si
    #
    if(GoPrev != Go) { GoChange = Go - GoPrev, GoTimeout = 0 }
    else { GoTimeout++ }
    if(GoTimeout >= 5) { A:egpText(133,Go:toString(),vec2(325,215)) }
    else { if(GoChange < 0) { A:egpText(133,Go:toString() + "(" + GoChange + ")",vec2(325,215)) }
        else { A:egpText(133,Go:toString() + "(+" + GoChange + ")",vec2(325,215)) }
    } GoPrev = Go
    #
    if(EmPrev != Em) { EmChange = Em - EmPrev, EmTimeout = 0 }
    else { EmTimeout++ }
    if(EmTimeout >= 5) { A:egpText(143,Em:toString(),vec2(325,265)) }
    else { if(EmChange < 0) { A:egpText(143,Em:toString() + "(" + EmChange + ")",vec2(325,265)) }
        else { A:egpText(143,Em:toString() + "(+" + EmChange + ")",vec2(325,265)) }
    } EmPrev = Em
    #
    if(RuPrev != Ru) { RuChange = Ru - RuPrev, RuTimeout = 0 }
    else { RuTimeout++ }
    if(RuTimeout >= 5) { A:egpText(153,Ru:toString(),vec2(325,315)) }
    else { if(RuChange < 0) { A:egpText(153,Ru:toString() + "(" + RuChange + ")",vec2(325,315)) }
        else { A:egpText(153,Ru:toString() + "(+" + RuChange + ")",vec2(325,315)) }
    } RuPrev = Ru
    #
    if(AmPrev != Am) { AmChange = Am - AmPrev, AmTimeout = 0 }
    else { AmTimeout++ }
    if(AmTimeout >= 5) { A:egpText(163,Am:toString(),vec2(325,365)) }
    else { if(AmChange < 0) { A:egpText(163,Am:toString() + "(" + AmChange + ")",vec2(325,365)) }
        else { A:egpText(163,Am:toString() + "(+" + AmChange + ")",vec2(325,365)) }
    } AmPrev = Am
   
    #Total amount of printers calculation and text
    TotalPrinters = Printers:count()
    A:egpText(31,TotalPrinters:toString(),vec2(325,407))
    #Total amount of printed money calculation and text
    TotalPrinted = IrP + SiP + EmP + RuP + AmP
    A:egpText(32,"$" + TotalPrinted:toString(),vec2(410,407))
}

if(first() | duped() | inputClk()) {
    #First time setup things
    Player = owner()
    findPrinters()
    timer("countPrinters",1000)
    timer("findPrinters",5000)
    IrPrev = 0,  SiPrev = 0,  GoPrev = 0,  EmPrev = 0,  RuPrev = 0,  AmPrev = 0
    IrChange = 0,  SiChange = 0,  GoChange = 0,  EmChange = 0,  RuChange = 0,  AmChange = 0
    IrTimeout = 0,  SiTimeout = 0,  GoTimeout = 0,  EmTimeout = 0,  RuTimeout = 0,  AmTimeout = 0
    A:egpClear()
   
    #Infomercials
    printColor(vec(200,200,200),"--------------------")
    printColor(vec(25,200,50),"-- Made by Bouche Dag.")
    printColor(vec(100,75,250),"-- It's free @ ")
    printColor(vec(200,25,50),"-- Works best with an EGP Screen.")
    printColor(vec(200,200,200),"--------------------")
   
    #Checkdistance
    if(Distance > 300) {
        printColor(vec(200,25,50),"-- Distance is too big! Please make it small to abide to ByB server rules.")
    }
   
    #Title box and text
    A:egpRoundedBox(1,vec2(256,50),vec2(330,60))
    A:egpColor(1,vec(50,50,50))
    A:egpText(2,"EGP Screen Printer Counter v1",vec2(98,30))
    A:egpSize(2,25)
    A:egpColor(2,vec(220,220,220))
   
    #First lighter round box
    A:egpRoundedBox(10,vec2(256,90),vec2(512,50))
    A:egpColor(10,vec(150,150,150))
    #Titles
    A:egpText(20,"Printer type:",vec2(10,70))
    A:egpSize(20,22)
    A:egpColor(20,vec(20,20,20))
    #
    A:egpText(21,"Amount:",vec2(300,70))
    A:egpSize(21,22)
    A:egpColor(21,vec(20,20,20))
    #
    A:egpText(22,"~$/min:",vec2(200,70))
    A:egpSize(22,22)
    A:egpColor(22,vec(20,20,20))
    #
    A:egpText(23,"Money:",vec2(410,70))
    A:egpSize(23,22)
    A:egpColor(23,vec(20,20,20))
    #Last lighter round box
    A:egpRoundedBox(90,vec2(256,410),vec2(512,50))
    A:egpColor(90,vec(150,150,150))
    #Bottom Title
    A:egpText(30,"Total:",vec2(10,407))
    A:egpSize(30,22)
    A:egpColor(30,vec(20,20,20))
    #Money/minute things
    A:egpText(42,"N/A",vec2(215,407))
   
    #Printer text
    A:egpBox(100,vec2(256,125),vec2(512,50))
    A:egpColor(100,vec(50,50,50))
    A:egpText(111,"Iron printers:",vec2(10,115))
    A:egpSize(111,22)
    A:egpColor(111,vec(140,70,20))
    A:egpText(112,"N/A",vec2(215,115))
    #
    A:egpBox(120,vec2(256,175),vec2(512,50))
    A:egpColor(120,vec(25,25,25))
    A:egpText(121,"Silver printers:",vec2(10,165))
    A:egpSize(121,22)
    A:egpColor(121,vec(150,150,150))
    A:egpText(122,"N/A",vec2(215,165))
    #
    A:egpBox(130,vec2(256,225),vec2(512,50))
    A:egpColor(130,vec(50,50,50))
    A:egpText(131,"Golden printers:",vec2(10,215))
    A:egpSize(131,22)
    A:egpColor(131,vec(255,215,0))
    A:egpText(132,"N/A",vec2(215,215))
    #
    A:egpBox(140,vec2(256,275),vec2(512,50))
    A:egpColor(140,vec(25,25,25))
    A:egpText(141,"Emerald printers:",vec2(10,265))
    A:egpSize(141,22)
    A:egpColor(141,vec(150,20,30))
    A:egpText(142,"N/A",vec2(215,265))
    #
    A:egpBox(150,vec2(256,325),vec2(512,50))
    A:egpColor(150,vec(50,50,50))
    A:egpText(151,"Ruby printers:",vec2(10,315))
    A:egpSize(151,22)
    A:egpColor(151,vec(50,175,50))
    A:egpText(152,"N/A",vec2(215,315))
    #
    A:egpBox(160,vec2(256,375),vec2(512,50))
    A:egpColor(160,vec(25,25,25))
    A:egpText(161,"Amethyst printers:",vec2(10,365))
    A:egpSize(161,22)
    A:egpColor(161,vec(150,50,200))
    A:egpText(162,"N/A",vec2(215,365))
}

if(clk("countPrinters")) {
    countPrinters()
    timer("countPrinters",1000)
}

if(clk("findPrinters")) {
    findPrinters()
    moneyPerMinute()
    timer("findPrinters",5000)
}

if(chatClk(Player)) {
    Chat = Player:lastSaid():explode(" ")
    if(Chat[1,string]:lower() == ChatText) {
        hideChat(1)
        printColor(vec(200,25,50),"-- Total money currently in printers: $"+ TotalPrinted:toString() + ", at a rate of: ~$" + MoneyPerMinute:toString() + "/min")
    }
}

AutoMerge: March 17, 2015, 08:10 pm
There is a version 2.1 which uses a bunch of arrays instead of stacks on top of stacks of variables, but it uses more Ops...
So, please uses v1.1 (as in OP) instead of v2.1!

Here's v2.1 just for the people that are interested (which most likely don't exist): http://pastebin.com/HJ7hAPqs

9
Wire / E2 / Simple EGP (Emitter) Money Printer info
« on: March 16, 2015, 08:45 pm »
(Fairly) lightweight and small Money Printer EGP.

Code:
Code: [Select]
@name Simple Money Printer EGP v2
@inputs A:wirelink
@persist [Printers ActualPrinters]:array Money B C Distance Cost Rate

interval(1000)

#Range wherein printers should be (from the E2)
Distance = 150

function gatherPrinters() {
    Cost = 0
    findInSphere(entity():pos(),Distance)
    findClipToClass("money_printer")
    Printers = findToArray()
    for(I = 1, Printers:count()) {
        if(Printers[I,entity]:printerType() == "Iron") {
            Cost += 1099
        } elseif(Printers[I,entity]:printerType() == "Silver") {
            Cost += 2099
        } elseif(Printers[I,entity]:printerType() == "Golden") {
            Cost += 4099
        } elseif(Printers[I,entity]:printerType() == "Emerald" | Printers[I,entity]:printerType() == "Ruby") {
            Cost += 5099
        } elseif(Printers[I,entity]:printerType() == "Amethyst") {
            Cost += 6099
        }
    }
}

function updateMoney() {
    Money = 0
    for(I = 1, Printers:count()) {
        Money += Printers[I,entity]:printedMoney()
    }
    A:egpText(3,"$"+Money,vec2(270,410))
}

if(first() | dupefinished() | inputClk()) {
    A:egpClear()
    printColor(vec(200,200,200),"--------------------")
    printColor(vec(25,200,50),"-- Made by Bouche Dag.")
    printColor(vec(100,75,250),"-- It's free @ http://www.bybservers.co.uk/index.php?topic=15389.0.")
    printColor(vec(200,25,50),"-- Works best with an EGP Emitter.")
    printColor(vec(200,200,200),"--------------------")
   
    gatherPrinters()
    A:egpRoundedBox(1,vec2(255,460),vec2(210,120))
    A:egpColor(1,vec(25,25,25))
    A:egpText(2,"Money:",vec2(160,410))
    A:egpSize(2,30)
    A:egpFont(2,"Coolvetica")
    A:egpColor(2,vec(30,20,150))
    A:egpText(3,"$"+Money,vec2(270,410))
    A:egpSize(3,30)
    A:egpFont(3,"Coolvetica")
    A:egpColor(3,vec(150,20,30))
    updateMoney()
    A:egpText(4,"Printers:",vec2(160,435))
    A:egpSize(4,30)
    A:egpFont(4,"Coolvetica")
    A:egpColor(4,vec(30,20,150))
    A:egpText(5,""+Printers:count(),vec2(270,435))
    A:egpSize(5,30)
    A:egpFont(5,"Coolvetica")
    A:egpColor(5,vec(150,20,30))
    A:egpText(6,"$/min:",vec2(160,460))
    A:egpSize(6,30)
    A:egpFont(6,"Coolvetica")
    A:egpColor(6,vec(30,20,150))
    A:egpText(7,"~$"+Rate,vec2(270,460))
    A:egpSize(7,30)
    A:egpFont(7,"Coolvetica")
    A:egpColor(7,vec(150,20,30))
    A:egpText(8,"Cost:",vec2(160,485))
    A:egpSize(8,30)
    A:egpFont(8,"Coolvetica")
    A:egpColor(8,vec(30,20,150))
    A:egpText(9,"$"+Cost,vec2(270,485))
    A:egpSize(9,30)
    A:egpFont(9,"Coolvetica")
    A:egpColor(9,vec(150,20,30))
    timer("updatePrinters",5000)
    timer("updateMoney",1000)
}

if(clk("updateMoney")) {
    updateMoney()
    timer("updateMoney",1000)
}

if(clk("updatePrinters")) {
    gatherPrinters()
    C = B
    B = Money
    Rate = clamp((B-C)*12,0,10000)
    A:egpText(7,"~$"+Rate,vec2(270,460))
    A:egpText(5,""+Printers:count(),vec2(270,435))
    timer("updatePrinters",5000)
}

If you want to share it, feel free and give free.
This E2 should not be sold at all.

10
Wire / E2 / [Release] Bouches E2 EGP Shop weapon list
« on: November 18, 2014, 08:13 pm »
After making the Interface Shop I thought just having a plain list of the weapons the Gun Dealer, Heavy Gun Dealer and BMD can sell would come handy for everyone; even the people that don't want an auto gunshop.

This time there's no I/O apart from the EGP Emitter (and chat) and there's a built in sales% so you can decide how much profit you want to make.
The sales% does not work on shipments (since that would give real high prices and I'm too lazy to implement it differently)

Both the Gun Dealer and the BMD have 2 lists of weapons.
The list automatically switches every 5 seconds.



Chat commands:

- show offline
    Shows the offline text (see picture)
- show gundealer
    Shows the Gun Dealer's weapons list
- show heavygundealer
    Shows the Heavy Gun Dealer's weapons list
- show bmd
    Shows the BMD's weapons list
- profit
    Change the sales%.
    It's the price you pay for the gun * the sales percentage.
    So setting it to 1.25 (default) will set the price for the Deagle (250 default) to 375.
    Usage: profit 1.25



Pictures:

Offline/default:
Spoiler

Heavy Gun Dealer list:
Spoiler

BMD list #1:
Spoiler

BMD list #2:
Spoiler



Code:

Code: [Select]
@name Bouches E2 EGP Shop weapon list
@inputs A:wirelink
@outputs
@persist Player:entity
@persist [Chat ItemNames ItemPrices ItemTypes]:array
@persist Limit ItemPlace EGPPlace EGPX EGPY ItemAmount
@persist [Colour ItemColour1 ItemColour2]:vector
@persist WhosTurn BMDListBoolean GDListBoolean I SalesPercentage

interval(500)
runOnChat(1)

### Functions

# Show debug text in grey
function void debugText(Text:string) {
    printColor(vec(100,100,100),Text)
}

# Sets the shopname and name/type/price bar and resets some variables
function void resetText() {
    # Show default text
    A:egpText(1,"Welcome to Bouche's E2 EGP Shop weapon list",vec2(30,10))
    A:egpSize(1,25)
    A:egpColor(1,Colour)
    A:egpLine(2,vec2(0,45),vec2(550,45))
    A:egpSize(2,2)
    A:egpColor(2,Colour)
   
    A:egpBox(3,vec2(275,62),vec2(550,34))
    A:egpColor(3,100,100,100,255)
    A:egpText(4,"Name",vec2(10,46))
    A:egpSize(4,30)
    A:egpColor(4,20,20,250,255)
    A:egpText(5,"Type",vec2(160,46))
    A:egpSize(5,30)
    A:egpColor(5,20,20,250,255)
    A:egpText(6,"Price",vec2(440,46))
    A:egpSize(6,30)
    A:egpColor(6,20,20,250,255)
   
    # Reset more variables
    ItemAmount = 15
    Limit = ItemAmount + 1
    EGPPlace = 7
    EGPX = 10
    EGPY = 82
    ItemPlace = 0
    ItemColour1 = vec(50,50,50)
    ItemColour2 = vec(100,100,100)
}

# Makes the item list
function void makeItemList() {
    if(ItemPlace < ItemAmount) {
        ItemPlace++
        EGPX = 10
        # Show item name
        A:egpText(EGPPlace,ItemNames[ItemPlace,string],vec2(EGPX,EGPY))
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPX = EGPX + 150
        # Show item type
        A:egpText(EGPPlace,ItemTypes[ItemPlace,string],vec2(EGPX,EGPY))
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPX = EGPX + 280
        # Show item price
        if(ItemPrices[ItemPlace,normal] == 0) {
            A:egpText(EGPPlace,"",vec2(EGPX,EGPY))
        }
        else {
            A:egpText(EGPPlace,""+ ItemPrices[ItemPlace,normal],vec2(EGPX,EGPY))
        }
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPY = EGPY + 25
        # Show line
        A:egpLine(EGPPlace,vec2(0,EGPY),vec2(550,EGPY))
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPY = EGPY + 2
        makeItemList()
    }
}

# Start interface for Gun Dealers
function void showGunDealer() {
    debugText("Gun Dealer list initializing...")
    timer("SwitchTurn",50)
}

# Show first list for Gun Dealers
function void showGunDealerList1() {
    ItemNames[1,string] = "Glock"
    ItemTypes[1,string] = "Pistol"
    ItemPrices[1,normal] = round(160 * SalesPercentage)
    ItemNames[2,string] = "USP"
    ItemTypes[2,string] = "Pistol"
    ItemPrices[2,normal] = round(160 * SalesPercentage)
    ItemNames[3,string] = "P228"
    ItemTypes[3,string] = "Pistol"
    ItemPrices[3,normal] = round(170 * SalesPercentage)
    ItemNames[4,string] = "Deagle"
    ItemTypes[4,string] = "Pistol"
    ItemPrices[4,normal] = round(250 * SalesPercentage)
    ItemNames[5,string] = "Elites"
    ItemTypes[5,string] = "Dual Pistols"
    ItemPrices[5,normal] = round(240 * SalesPercentage)
    ItemNames[6,string] = "Alyx"
    ItemTypes[6,string] = "Automatic Pistol"
    ItemPrices[6,normal] = round(1100 * SalesPercentage)
    ItemNames[7,string] = "Spas"
    ItemTypes[7,string] = "Shotgun"
    ItemPrices[7,normal] = round(190 * SalesPercentage)
    ItemNames[8,string] = "M3"
    ItemTypes[8,string] = "Shotgun"
    ItemPrices[8,normal] = round(230 * SalesPercentage)
    ItemNames[9,string] = "Mac10"
    ItemTypes[9,string] = "Sub Machine Gun"
    ItemPrices[9,normal] = round(210 * SalesPercentage)
    ItemNames[10,string] = "TMP"
    ItemTypes[10,string] = "Sub Machine Gun"
    ItemPrices[10,normal] = round(230 * SalesPercentage)
    ItemNames[11,string] = "MP5"
    ItemTypes[11,string] = "Sub Machine Gun"
    ItemPrices[11,normal] = round(280 * SalesPercentage)
    ItemNames[12,string] = "P90"
    ItemTypes[12,string] = "Sub Machine Gun"
    ItemPrices[12,normal] = round(290 * SalesPercentage)
    ItemNames[13,string] = "UMP"
    ItemTypes[13,string] = "Sub Machine Gun"
    ItemPrices[13,normal] = round(290 * SalesPercentage)
    ItemNames[14,string] = "Scout"
    ItemTypes[14,string] = "Sniper Rifle"
    ItemPrices[14,normal] = round(500 * SalesPercentage)
    ItemNames[15,string] = ""
    ItemTypes[15,string] = ""
    ItemPrices[15,normal] = 0
   
    resetText()
    makeItemList()
}

# Show second list for Gun Dealers
function void showGunDealerList2() {
    ItemNames[1,string] = "Flashbang (3)"
    ItemTypes[1,string] = "Grenade"
    ItemPrices[1,normal] = round(1000 + 150)
    ItemNames[2,string] = "Armor (5)"
    ItemTypes[2,string] = "Other"
    ItemPrices[2,normal] = round(1600 + 500)
    ItemNames[3,string] = "Ammo (10)"
    ItemTypes[3,string] = "Other"
    ItemPrices[3,normal] = round(1100 + 150)
    ItemNames[4,string] = "Charge (10)"
    ItemTypes[4,string] = "Other"
    ItemPrices[4,normal] = round(1100 + 150)
    for(I = 5, 15) {       
        ItemNames[I,string] = ""
        ItemTypes[I,string] = ""
        ItemPrices[I,normal] = 0
    }
   
    resetText()
    makeItemList()
}

# Set interface for Heavy Gun Dealers
function void showHeavyGunDealer() {
    debugText("Heavy Gun Dealer list initializing...")
    timer("SwitchTurn",50)
    ItemNames[1,string] = "MP5"
    ItemTypes[1,string] = "Sub Machine Gun"
    ItemPrices[1,normal] = round(280 * SalesPercentage)
    ItemNames[2,string] = "UMP"
    ItemTypes[2,string] = "Sub Machine Gun"
    ItemPrices[2,normal] = round(290 * SalesPercentage)
    ItemNames[3,string] = "P90"
    ItemTypes[3,string] = "Sub Machine Gun"
    ItemPrices[3,normal] = round(290 * SalesPercentage)
    ItemNames[4,string] = "Spas"
    ItemTypes[4,string] = "Shotgun"
    ItemPrices[4,normal] = round(190 * SalesPercentage)
    ItemNames[5,string] = "Famas"
    ItemTypes[5,string] = "Automatic Rifle"
    ItemPrices[5,normal] = round(300 * SalesPercentage)
    ItemNames[6,string] = "Galil"
    ItemTypes[6,string] = "Automatic Rifle"
    ItemPrices[6,normal] = round(320 * SalesPercentage)
    ItemNames[7,string] = "AK47"
    ItemTypes[7,string] = "Automatic Rifle"
    ItemPrices[7,normal] = round(350 * SalesPercentage)
    ItemNames[8,string] = "M4"
    ItemTypes[8,string] = "Automatic Rifle"
    ItemPrices[8,normal] = round(370 * SalesPercentage)
    ItemNames[9,string] = "Scout"
    ItemTypes[9,string] = "Sniper Rifle"
    ItemPrices[9,normal] = round(500 * SalesPercentage)
    ItemNames[10,string] = "M249"
    ItemTypes[10,string] = "Light Machine Gun"
    ItemPrices[10,normal] = round(420 * SalesPercentage)
    ItemNames[11,string] = "Ammo"
    ItemTypes[11,string] = "Weapon Ammunition"
    ItemPrices[11,normal] = round(1100 + 150)
    ItemNames[12,string] = "AWP (10)"
    ItemTypes[12,string] = "Sniper Rifle"
    ItemPrices[12,normal] = round(9100 + 500)
    ItemNames[13,string] = "Flashbang (3)"
    ItemTypes[13,string] = "Other"
    ItemPrices[13,normal] = round(1000 + 150)
    ItemNames[14,string] = "Armor (5)"
    ItemTypes[14,string] = "Other"
    ItemPrices[14,normal] = round(1600 + 500)
    ItemNames[15,string] = "Ammo (10)"
    ItemTypes[15,string] = "Other"
    ItemPrices[15,normal] = round(1100 + 150)
   
    resetText()
    makeItemList()
}

# Set interface for Gun Dealers
function void showBMD() {
    debugText("BMD list initializing...")
    timer("SwitchTurn",50)
}

# Show first list for BMDs
function void showBMDList1() {
    #debugText("BMD list 1 initializing...")
    ItemNames[1,string] = "Glock"
    ItemTypes[1,string] = "Pistol"
    ItemPrices[1,normal] = round(160 * SalesPercentage)
    ItemNames[2,string] = "USP"
    ItemTypes[2,string] = "Pistol"
    ItemPrices[2,normal] = round(160 * SalesPercentage)
    ItemNames[3,string] = "P228"
    ItemTypes[3,string] = "Pistol"
    ItemPrices[3,normal] = round(170 * SalesPercentage)
    ItemNames[4,string] = "Deagle"
    ItemTypes[4,string] = "Pistol"
    ItemPrices[4,normal] = round(250 * SalesPercentage)
    ItemNames[5,string] = "Elites"
    ItemTypes[5,string] = "Dual Pistols"
    ItemPrices[5,normal] = round(240 * SalesPercentage)
    ItemNames[6,string] = ".375 Magnum"
    ItemTypes[6,string] = "Revolver"
    ItemPrices[6,normal] = round(800 * SalesPercentage)
    ItemNames[7,string] = "Alyx"
    ItemTypes[7,string] = "Automatic Pistol"
    ItemPrices[7,normal] = round(1100 * SalesPercentage)
   
    ItemNames[8,string] = "Spas"
    ItemTypes[8,string] = "Shotgun"
    ItemPrices[8,normal] = round(190 * SalesPercentage)
    ItemNames[9,string] = "M3"
    ItemTypes[9,string] = "Shotgun"
    ItemPrices[9,normal] = round(230 * SalesPercentage)
   
    ItemNames[10,string] = "Mac10"
    ItemTypes[10,string] = "Sub Machine Gun"
    ItemPrices[10,normal] = round(210 * SalesPercentage)
    ItemNames[11,string] = "TMP"
    ItemTypes[11,string] = "Sub Machine Gun"
    ItemPrices[11,normal] = round(230 * SalesPercentage)
    ItemNames[12,string] = "MP5"
    ItemTypes[12,string] = "Sub Machine Gun"
    ItemPrices[12,normal] = round(280 * SalesPercentage)
    ItemNames[13,string] = "P90"
    ItemTypes[13,string] = "Sub Machine Gun"
    ItemPrices[13,normal] = round(290 * SalesPercentage)
    ItemNames[14,string] = "UMP"
    ItemTypes[14,string] = "Sub Machine Gun"
    ItemPrices[14,normal] = round(290 * SalesPercentage)
   
    ItemNames[15,string] = "Scout"
    ItemTypes[15,string] = "Sniper Rifle"
    ItemPrices[15,normal] = round(500 * SalesPercentage)
   
    resetText()
    makeItemList()   
}

# Show second list for BMDs
function void showBMDList2() {
    #debugText("BMD list 2 initializing...")
    ItemNames[1,string] = "M249"
    ItemTypes[1,string] = "Light Machine Gun"
    ItemPrices[1,normal] = round(420 * SalesPercentage)
   
    ItemNames[2,string] = "Stunstick"
    ItemTypes[2,string] = "Tool"
    ItemPrices[2,normal] = round(1300 * SalesPercentage)
    ItemNames[3,string] = "Cracker"
    ItemTypes[3,string] = "Tool"
    ItemPrices[3,normal] = round(1300 * SalesPercentage)
   
    ItemNames[4,string] = "Nomad (10)"
    ItemTypes[4,string] = "Laser Rifle"
    ItemPrices[4,normal] = round(10100 + 500)
    ItemNames[5,string] = "AWP (10)"
    ItemTypes[5,string] = "Sniper Rifle"
    ItemPrices[5,normal] = round(9100 + 500)
    ItemNames[6,string] = "Flashbang (3)"
    ItemTypes[6,string] = "Grenade"
    ItemPrices[6,normal] = round(1000 + 150)
    ItemNames[7,string] = "Armor (5)"
    ItemTypes[7,string] = "Other"
    ItemPrices[7,normal] = round(1600 + 500)
    ItemNames[8,string] = "Ammo (10)"
    ItemTypes[8,string] = "Other"
    ItemPrices[8,normal] = round(1100 + 150)
    ItemNames[9,string] = "Charge (10)"
    ItemTypes[9,string] = "Other"
    ItemPrices[9,normal] = round(1100 + 150)
    ItemNames[10,string] = "Lockpick (10)"
    ItemTypes[10,string] = "Other"
    ItemPrices[10,normal] = round(6100 + 500)
    for(I = 11, 15) {       
        ItemNames[I,string] = ""
        ItemTypes[I,string] = ""
        ItemPrices[I,normal] = 0
    }
   
    resetText()
    makeItemList() 
}

# Set interface to offline
function void showOffline() {
    printColor(vec(250,20,20),"The weapon list is currently offline.")
    ItemAmount = 0
    Limit = ItemAmount + 1
   
    A:egpText(7,"The weapon list is currently offline.",vec2(15,225))
    A:egpSize(7,35)
    A:egpColor(7,vec(250,20,20))
}

# Handles all chat commands including making the actual basket through 'add'
function void showInterface() {
    #debugText(Chat[1,string])
    #if(Chat[2,string] != "") {debugText(Chat[2,string])}     
    if(Chat[1,string]:lower() == "show") {
        #debugText("showInterface() > 'show'")
        if(Chat[2,string]:lower() == "offline") {
            hideChat(1)
            timer("reset",50)
            WhosTurn = 0
        }
        elseif(Chat[2,string]:lower() == "gundealer") {
            hideChat(1)
            #debugText("showGunDealer() being called...")       
            resetText()
            WhosTurn = 1
            showGunDealer()
        }
        elseif(Chat[2,string]:lower() == "heavygundealer") {
            hideChat(1)
            #debugText("showHeavyGunDealer() being called...")       
            resetText()
            WhosTurn = 2
            showHeavyGunDealer()
        }
        elseif(Chat[2,string]:lower() == "bmd") {
            hideChat(1)
            #debugText("showBMD() being called...")       
            resetText()
            WhosTurn = 3
            showBMD()
        }
    }
    elseif(Chat[1,string]:lower() == "profit") {
        if(Chat[2,string]:toNumber() < 2.001) {
            hideChat(1)
            SalesPercentage = Chat[2,string]:toNumber()
            printColor(vec(20,250,20),"Sales percentage changed to: "+ SalesPercentage)
        }
        elseif(Chat[2,string]:toNumber() > 2) {
            hideChat(1)
            printColor(vec(250,20,20),"Sales percentage can't be higher than 2")
        }
    }
}

### Startup / Reset
if(first() | duped() | inputClk() |  clk("reset")) {
    printColor(vec(20,250,20),"Bouche's E2 EGP Shop initializing")
    # Reset screen and variables
    A:egpClear()
    Colour = vec(20,250,20)
    Delay = 0
    # WhosTurn: 1 = Gun Dealer; 2 = Heavy Gun Dealer; 3 = BMD
    WhosTurn = 0   
    BMDListBoolean = 1
    GDListBoolean = 1
    Player = owner()
    SalesPercentage = 1.25
   
    # Show 'tutorial' text
    printColor(vec(50,50,250),"Show Gun Dealer list:                  show gundealer")
    printColor(vec(50,50,250),"Show Heavy Gun Dealer list:        show heavygundealer")
    printColor(vec(50,50,250),"Show BMD list:                            show bmd")
    printColor(vec(50,50,250),"Show the offline text:                  show offline")
    printColor(vec(50,50,250),"To set a sales percentage type:   profit 1.00")
    printColor(vec(50,50,250),"Where 1.00 is the default price modifier")
   
    # Show offline text
    showOffline()
}

### General code

# If player chats, update Chat array and handle it
if(chatClk(Player)) {
    Chat = Player:lastSaid():explode(" ")
    showInterface()
}

# This if-statement handles the switching of lists
if(clk("SwitchTurn")) {
    #debugText("clk(SwitchTurn)")
    # Restart timer if list should still be going
    if(WhosTurn != 0) {
        timer("SwitchTurn",5000)
    } else {
        #debugText("SwitchTurn is turned off")
    }
   
    # Gun Dealer
    if(WhosTurn == 1) {
        if(GDListBoolean == 1) {
            showGunDealerList1()
            GDListBoolean = 2
        }
        elseif(GDListBoolean == 2) {
            showGunDealerList2()
            GDListBoolean = 1
        }
    }
    # Heavy Gun Dealer
    elseif(WhosTurn == 2) {
        # Only has one list --> No code
    }
    # BMD
    elseif(WhosTurn == 3) {
        if(BMDListBoolean == 1) {
            showBMDList1()
            BMDListBoolean = 2
        }
        elseif(BMDListBoolean == 2) {
            showBMDList2()
            BMDListBoolean = 1
        }
    }
}

11
Wire / E2 / [Release] Gunshop Interface E2
« on: November 17, 2014, 03:46 am »
Took out this old E2 since a friend of mine was creating something similar.
Some code was lost so I remade a portion of the code.
I also added comments so E2 newbies can (hopefully) learn something from it.
My code is not perfect though (probably far from it).



This E2 is simply an interface.
People can use chat commands to interact with the interface.
The weapons list is automatically generated based on what job you are.
Compatible jobs are: Gun Dealer, Heavy Gun Dealer and Citizen.
It's available to Citizens for testing, so please don't use it to sell guns as a Citizen.
Once the customer put the correct amount of money into the moneypot, you'll get a chat message with who purchased what.
It's one customer with a maximum of 3 items at a time.



Chat commands:
- add [gun]
Adds said gun (if available to your job) to the basket.
Example: add spas
- clear
Clears the basket.
Example: clear

These commands are not case sensitive (anymore).



Components you need for this E2:
- This E2
- Target Finder (Recommended range <= 50, only target players and DON'T PAINT PEOPLE)
- EGP Emitter
- Moneypot (make sure you wire "SpawnAmount" in the moneypot, since spawn all still doesn't work)

If you need help wiring this say so in a reply and I'll ad instructions.
It should be relatively easy to wire since there's few input and output.



Here's the code:
Code: [Select]
@name Bouches E2 EGP Shop
@inputs A:wirelink Player:entity MoneyPot
@outputs MoneyPotSpawnAmount
@persist I J Delay Colour:vector Degrees ItemsInBasket ItemNumber [Chat Basket ItemNames ItemPrices ItemTypes]:array TotalPrice Restart Limit ItemPlace EGPPlace EGPX EGPY [ItemColour1 ItemColour2]:vector ItemAmount

interval(500)
runOnChat(1)

### Functions

# Set default Basket & Price text
function resetText() {
    A:egpText(99,"",vec2(140,450))
    A:egpSize(99,30)
    A:egpColor(99,vec(250,20,20))
    A:egpText(100,"Basket ("+ItemsInBasket+"): ",vec2(10,485))
    A:egpColor(100,Colour)
    A:egpSize(100,25)
    A:egpText(101,""+ TotalPrice,vec2(440,485))
    A:egpColor(101,Colour)
    A:egpSize(101,25)
}

# Makes basket
function makeBasket() {
    # If customer's first typed word is 'add'
    if(Chat[1,string]:lower() == "add" & ItemsInBasket < 5) {
        # For all items of your job
        #printColor(vec(200,200,20),"makeBasket() Add")
        for(I = 1, ItemAmount) {
            # If customer's second typed word is current item of job
            #printColor(vec(20,20,200),"makeBasket() Add for "+ I)
            if(Chat[2,string]:lower() == ItemNames[I,string]:lower() | Chat[2,string]+" "+ Chat[3,string]==ItemNames[I,string]) {
                # Update totalprice and itemsinbasket
                #printColor(vec(200,200,20),"makeBasket() Add Item")
                TotalPrice += ItemPrices[I,normal]
                ItemsInBasket += 1
                # If there are no items in the basket
                if(ItemsInBasket == 1) {
                    Basket[1,string] = ItemNames[I,string]
                    A:egpText(101,""+ TotalPrice,vec2(440,485))
                    A:egpText(100,"Basket ("+ItemsInBasket+"): "+Basket[1,string],vec2(10,485))
                }
                # If there's one item in the basket
                elseif(ItemsInBasket == 2) {
                    Basket[2,string] = ItemNames[I,string]
                    A:egpText(101,""+ TotalPrice,vec2(440,485))
                    A:egpText(100,"Basket ("+ItemsInBasket+"): "+Basket[1,string]+", "+Basket[2,string],vec2(10,485))
                }
                # If there are two items in the basket
                elseif(ItemsInBasket == 3) {
                    Basket[3,string] = ItemNames[I,string]
                    A:egpText(101,""+ TotalPrice,vec2(440,485))
                    A:egpText(100,"Basket ("+ItemsInBasket+"): "+Basket[1,string]+", "+Basket[2,string]+", "+Basket[3,string],vec2(10,485))
                }
                # Break out of for loop
                break
            }
        }
    }
    # If customer's first typed word is 'clear'
    elseif(Chat[1,string]:lower() == "clear") {
        # Tell you that the E2 will 'Clear / Reset'
        printColor(vec(200,20,20),"Clear / Reset")
        timer("reset",50)
    }
}

# Makes the item list (startup only)
function makeItemList() {
    if(ItemPlace < ItemAmount) {
        ItemPlace++
        EGPX = 10
        A:egpText(EGPPlace,ItemNames[ItemPlace,string],vec2(EGPX,EGPY))
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPX = EGPX + 150
        A:egpText(EGPPlace,ItemTypes[ItemPlace,string],vec2(EGPX,EGPY))
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPX = EGPX + 280
        A:egpText(EGPPlace,""+ ItemPrices[ItemPlace,normal],vec2(EGPX,EGPY))
        A:egpSize(EGPPlace,25)
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPY = EGPY + 25
        A:egpLine(EGPPlace,vec2(0,EGPY),vec2(550,EGPY))
            if(ItemPlace % 2 == 0) { A:egpColor(EGPPlace,ItemColour1) }
            else { A:egpColor(EGPPlace,ItemColour2) }
        EGPPlace = EGPPlace + 1
        EGPY = EGPY + 2
        makeItemList()
    }
}

### Startup / Reset

if(first() | duped() | clk("reset")) {
    # Reset screen and variables
    A:egpClear()
    ItemsInBasket = 0
    TotalPrice = 0
    Colour = vec(20,250,20)
    Basket:clear()
    Delay = 0
   
    # Show default text
    A:egpText(1,"Welcome to Bouche's E2 EGP Shop",vec2(70,10))
    A:egpSize(1,25)
    A:egpColor(1,Colour)
    A:egpLine(2,vec2(0,45),vec2(550,45))
    A:egpSize(2,2)
    A:egpColor(2,Colour)
   
    A:egpBox(3,vec2(240,62),vec2(550,34))
    A:egpColor(3,100,100,100,255)
    A:egpText(4,"Name",vec2(10,46))
    A:egpSize(4,30)
    A:egpColor(4,20,20,250,255)
    A:egpText(5,"Type",vec2(160,46))
    A:egpSize(5,30)
    A:egpColor(5,20,20,250,255)
    A:egpText(6,"Price",vec2(440,46))
    A:egpSize(6,30)
    A:egpColor(6,20,20,250,255)
   
    # Reset more variables
    Limit = 13
    EGPPlace = 7
    EGPX = 10
    EGPY = 82
    ItemPlace = 0
    ItemColour1 = vec(50,50,50)
    ItemColour2 = vec(100,100,100)
   
    # If you are a Black Market Dealer
    if(owner():team():teamName() == "Black Market Dealer") {
        # Show text for Black Market Dealer
        printColor(vec(250,20,20),"Black Market Dealers shouldn't use this!")
        ItemAmount = 0
       
        A:egpText(7,"Owner is a Black Market Dealer...",vec2(15,225))
        A:egpSize(7,35)
        A:egpColor(7,vec(250,20,20))
        A:egpText(8,"...and shouldn't be using this E2.",vec2(15,255))
        A:egpSize(8,35)
        A:egpColor(8,vec(250,20,20))
       
    }
    # Else if you are a Gun Dealer (or Citizen for testing)
    elseif(owner():team():teamName() == "Gun Dealer" | owner():team():teamName() == "Citizen") {
        # Ready E2 for Gun Dealer (or Citizen for testing)
        printColor(vec(20,250,20),"Bouche's E2 EGP Shop initializing")
        ItemNames[1,string] = "Glock"
        ItemTypes[1,string] = "Pistol"
        ItemPrices[1,normal] = 200
        ItemNames[2,string] = "USP"
        ItemTypes[2,string] = "Pistol"
        ItemPrices[2,normal] = 200
        ItemNames[3,string] = "P228"
        ItemTypes[3,string] = "Pistol"
        ItemPrices[3,normal] = 200
        ItemNames[4,string] = "Deagle"
        ItemTypes[4,string] = "Pistol"
        ItemPrices[4,normal] = 275
        ItemNames[5,string] = "Elites"
        ItemTypes[5,string] = "Dual Pistols"
        ItemPrices[5,normal] = 275
        ItemNames[6,string] = "Alyx"
        ItemTypes[6,string] = "Automatic Pistol"
        ItemPrices[6,normal] = 1050
        ItemNames[7,string] = "Spas"
        ItemTypes[7,string] = "Shotgun"
        ItemPrices[7,normal] = 225
        ItemNames[8,string] = "M3"
        ItemTypes[8,string] = "Shotgun"
        ItemPrices[8,normal] = 250
        ItemNames[9,string] = "Mac10"
        ItemTypes[9,string] = "Sub Machine Gun"
        ItemPrices[9,normal] = 250
        ItemNames[10,string] = "TMP"
        ItemTypes[10,string] = "Sub Machine Gun"
        ItemPrices[10,normal] = 250
        ItemNames[11,string] = "MP5"
        ItemTypes[11,string] = "Sub Machine Gun"
        ItemPrices[11,normal] = 325
        ItemNames[12,string] = "P90"
        ItemTypes[12,string] = "Sub Machine Gun"
        ItemPrices[12,normal] = 325
        ItemNames[13,string] = "UMP"
        ItemTypes[13,string] = "Sub Machine Gun"
        ItemPrices[13,normal] = 325
        ItemNames[14,string] = "Scout"
        ItemTypes[14,string] = "Sniper Rifle"
        ItemPrices[14,normal] = 425
        ItemNames[15,string] = "Ammo"
        ItemTypes[15,string] = "Weapon Ammunition"
        ItemPrices[15,normal] = 125
       
        ItemAmount = 15
        Limit = ItemAmount + 1
       
        makeItemList()
    }
    # Else if you are a Heavy Gun Dealer
    elseif(owner():team():teamName() == "Heavy Gun Dealer") {
        # Ready E2 for Heavy Gun Dealer
        printColor(vec(20,250,20),"Bouche's E2 EGP Shop initializing")
        ItemNames[1,string] = "Spas"
        ItemTypes[1,string] = "Shotgun"
        ItemPrices[1,normal] = 225
        ItemNames[2,string] = "MP5"
        ItemTypes[2,string] = "Sub Machine Gun"
        ItemPrices[2,normal] = 325
        ItemNames[3,string] = "UMP"
        ItemTypes[3,string] = "Sub Machine Gun"
        ItemPrices[3,normal] = 325
        ItemNames[4,string] = "P90"
        ItemTypes[4,string] = "Sub Machine Gun"
        ItemPrices[4,normal] = 325
        ItemNames[5,string] = "Famas"
        ItemTypes[5,string] = "Automatic Rifle"
        ItemPrices[5,normal] = 325
        ItemNames[6,string] = "Galil"
        ItemTypes[6,string] = "Automatic Rifle"
        ItemPrices[6,normal] = 350
        ItemNames[7,string] = "AK47"
        ItemTypes[7,string] = "Automatic Rifle"
        ItemPrices[7,normal] = 375
        ItemNames[8,string] = "SG552"
        ItemTypes[8,string] = "Automatic Rifle"
        ItemPrices[8,normal] = 375
        ItemNames[9,string] = "M4"
        ItemTypes[9,string] = "Automatic Rifle"
        ItemPrices[9,normal] = 425
        ItemNames[10,string] = "Scout"
        ItemTypes[10,string] = "Sniper Rifle"
        ItemPrices[10,normal] = 425
        ItemNames[11,string] = "M249"
        ItemTypes[11,string] = "Light Machine Gun"
        ItemPrices[11,normal] = 450
        ItemNames[12,string] = "Ammo"
        ItemTypes[12,string] = "Weapon Ammunition"
        ItemPrices[12,normal] = 125
       
        ItemAmount = 12
        Limit = ItemAmount + 1

        makeItemList()
    }
    # Else if you are none of the above jobs
    else {
        # Show text for non Gun Dealer jobs
        printColor(vec(250,20,20),"This E2 is for Gun Dealers only!")
        A:egpText(7,"Owner is a "+owner():team():teamName()+ "...",vec2(115,225))
        A:egpSize(7,35)
        A:egpColor(7,vec(250,20,20))
        A:egpText(8,"...and shouldn't be using this E2.",vec2(15,255))
        A:egpSize(8,35)
        A:egpColor(8,vec(250,20,20))
   
    }
    # Show 'default' text for basket and totalprice
    resetText()
}

### General code

# If player chats, update Chat array and makebasket
if(chatClk(Player)) {
    Chat = Player:lastSaid():explode(" ")
    makeBasket()
}

# If Player:name() is empty and there's
# something in the basket, reset
if(Player:name() == "" && Basket[1,string] != "") {
        printColor(vec(200,20,20),"Target out of range, basket reset")
        timer("reset",50)
}

# If The right amount of money is entered
if(MoneyPot == TotalPrice && Delay == 0) {
    MoneyPotSpawnAmount = TotalPrice
    # Go  through all items in basket
    for(I = 1, ItemsInBasket) {
        # Go through all items of current job
        for(J = 1, ItemAmount+1) {
            # If current basket item is current job item
            if(ItemNames[J,string]:lower() == Basket[I,string]:lower()) {
                # Tell you what is bought by who
                printColor(vec(50,125,250),Player:name()+ " bought: "+ ItemNames[J,string])
                Delay = 1
                timer("Delay and Reset",1250)
                break
            }
        }
    }
}
# Else if Moneypot's not empty, spawn the money
elseif(MoneyPot != 0 && Delay == 0) {
    MoneyPotSpawnAmount = MoneyPot
}

# If timer is called, 'small' reset for new customer
if(clk("Delay and Reset")) {
    Delay = 0
    Chat:clear()
    Basket:clear()
    ItemsInBasket = 0
    TotalPrice = 0
    MoneyPotSpawnAmount = 0
    resetText()
}

12
Wire / E2 / [Release] Gun Dealer chat shortcuts
« on: January 05, 2014, 03:30 pm »
A simple E2 that allows for fast chat interaction with your customers.


If this E2 doesn't output chat type the following command in console: wire_expression2_concmd 1


Commands:

advert - empty by default; adverts text set with setadvert
setadvert [advert]- set [advert] as text to use for command advert
hs - "Hello Sir."
ho - "Hello Officer."
desk - "Please stay in front of the desk."
twb [price] - "That'll be $[price] please."
ammo - empty by default; says text set with setammo
setammo [ammo]- set [ammo] as text to use for command ammo
guns - "I'm selling: Pistols, SMGs, Shotguns, Scout Sniper, Ammo, Armor and Explosive Charges."
pistols - "I'm selling: P228, Glock, USP, Deagle and Elites."
gunsheavy - "I'm selling: SMGs, Spas Shotgun, Automatic Rifles, Scout Sniper, AWPs, Ammo and Armor."
rifles - "I'm selling: SG552, Galil, Famas, M4A1 and AK47."
whatcan - "What can I help you with?"
hand - "Have a nice day!"
plmsi - "Please leave my store immediately."

Code: [Select]
@name Gunshop chat shortcuts
@persist Chat:array [Advert Ammo]:string

interval(600)
runOnChat(1)

if(first() | duped()) {
    printColor(vec(40,180,250),"E2 made by 'Bouche Dag.' [STEAM_0:0:16346500]")
    printColor(vec(250,20,20),"If the commands don't seem to work type the following into your console: wire_expression2_concmd 1")
    Ammo = "Ammo is only being sold in bulk of 10 boxes each at this moment."
}

Chat = owner():lastSaid():explode(" ")

function string composeStringFromArray(Offset:number,Array:array)
{
    #Function made by 'Apple iHue' aka 'Crypto' [STEAM_0:1:39618360]
    local ComposeString = ""
    for(I = 1 + Offset,Array:count())
    {
        ComposeString = ComposeString + " " + Array[I,string]
    }
    return ComposeString
}

if(Chat[1,string] == "advert") {
    hideChat(1)
    concmd("say /advert "+ Advert)
}
elseif(Chat[1,string] == "setadvert") {
    hideChat(1)
    Advert = composeStringFromArray(1,Chat)
}
elseif(Chat[1,string] == "hs") {
    hideChat(1)
    concmd("say Hello Sir.")
}
elseif(Chat[1,string] == "ho") {
    hideChat(1)
    concmd("say Hello Officer.")
}
elseif(Chat[1,string] == "ty") {
    hideChat(1)
    concmd("say Thank you.")
}
elseif(Chat[1,string] == "desk") {
    hideChat(1)
    concmd("say Please stay in front of the desk.")
}
elseif(Chat[1,string] == "twb")   {
    hideChat(1)
    concmd("say That'll be $"+ Chat[2,string]+ " please.")
}
elseif(Chat[1,string] == "ammo") {
    hideChat(1)
    concmd("say "+ Ammo)
}
elseif(Chat[1,string] == "setammo") {
    hideChat(1)
    Ammo = composeStringFromArray(1,Chat)
}
elseif(Chat[1,string] == "guns") {
    hideChat(1)
    concmd("say I'm selling: Pistols, SMGs, Shotguns, Scout Sniper, Ammo, Armor and Explosive Charges.")
}
elseif(Chat[1,string] == "pistols") {
    hideChat(1)
    concmd("say I'm selling: P228, Glock, USP, Deagle and Elites.")
}
elseif(Chat[1,string] == "gunsheavy") {
    hideChat(1)
    concmd("say I'm selling: SMGs, Spas Shotgun, Automatic Rifles, Scout Sniper, AWPs, Ammo and Armor.")
}
elseif(Chat[1,string] == "rifles") {
    hideChat(1)
    concmd("say I'm selling: SG552, Galil, Famas, M4A1 and AK47.")
}
elseif(Chat[1,string] == "whatcan") {
    hideChat(1)
    concmd("say What can I help you with?")
}
elseif(Chat[1,string] == "hand") {
    hideChat(1)
    concmd("say Have a nice day!")
}
elseif(Chat[1,string] == "plmsi") {
    hideChat(1)
    concmd("say Please leave my store immediately.")
}

13
Events Board / BF4: For those who haven't played yet.
« on: November 07, 2013, 11:15 am »
This is an unofficial event

Date changed from Wednesday to Friday.


We (all the cool people who normally are on Teamspeak) have been enjoying Battlefield 4 thus far.
We've been alive for way too long in Scout Helicopters.
Gotten crazy actions going with 5 people in 1 LAV.
Been harassing the enemy with Attack Boats.

And I wouldn't let you guys miss all this.

Therefor, next week, on Friday 9pm GMT, join Teamspeak, get your Battlescreen open and let's get some streaks going!

If you haven't bought it yet, you can get it for around 40 euros aka $54 aka 34 GBP.
http://www.dlcompare.com/games/cd-key-download-battlefield-4-519

Hope to see you there!


A little teaser; this was PURELY healing, reviving, spotting & conquest points:
Spoiler

14
What:
Next week, starting October the 21st you are all invited to come and play TTT on our new server.


In this unofficial event we'll be playing on maps we vote for, as well as some picks from the higher ranked.
The goal is to have a good time and kill Nightmare as many times digitally as possible.

Dates:
Monday         21st of October    9pm GMT (We just started at around 8)
Wednesday   23st of October    8pm GMT
Friday           25st of October    8pm GMT

How-to:
Simply join the server and hop into Teamspeak with us and prepare for some fun!

Until then...

15
Off Topic / Computer upgrade - Discuss!
« on: October 01, 2013, 09:22 pm »
This is what I put together in half an hour. (Don't mind the Dutch)

Horribly long shopping cart link shortened!

New horribly short link!

Mobo changed for a slightly different one (more PCI slots)

PSU, RAM, input & output I'll use from my current computer.
Also, the case in the link is a placeholder;
is the case I want to get.

Is watercooling worth it? (Got a Scythe Mugen 2 right now)
Any (EU) (reliable) SSD deal going on?

Any suggestions?

EDIT 2 October: Removed 7970 & H110i see this post.

Pages: [1] 2 3 ... 10