July 23, 2019, 10:59 pm

Rates Given - RealGuy

Pages: [1] 2 3
1
General Chat / Re: Lawsuit Against BYB
Winner Winner
on July 02, 2019, 04:12 pm to Danrox147
去他妈的自己
2
News & Announcements / Re: Should we hit go? (Vote number 3... no pressure)
Agree Agree
on December 27, 2018, 12:34 am to Xenvious
Can we hit go again? Thanks
3
General Chat / Re: This is why you always build large printer vaults...
Agree Agree
on November 30, 2018, 01:33 am to Pantho
In my opinion, there should be no change to how long printers last. People pay for the supporter rank for good reason. Apart from the jobs, printers are another huge reason people are willing to support.

There is a section in legacy rules dictating that you are not allowed to sell printers to other players. It can be argued that even if you can buy printers, you can just steal them, and it would be a valid point.

With this said, there are many instances where players set up a shop to specifically buy printers off others, accelerating the rate of printers per player/base. Even though you would be able to steal them off other players, having a rule dictating selling printers as illegal would slow the main source of the problem.

It would also be a fantastic idea to add a rule dictating that if you carry more than x printers, they must be placed on a shelf, stopping any collisions between them.

Late reply!

Collisions of that degree are meh, don't do much harm to the server.
Plus if I wanted to not have piled up colliding printers, id just make them have a collision counter that decays over time.

So if they collide more than 100 times/minute for example they ignite :D
4
Wire / E2 / Re: [REQUEST] Index Table (somthin like that)
Helpful Helpful
on August 13, 2018, 04:56 pm to Scriptis
Using a set of an arrays like that is a programming antipattern. It's something you should avoid doing. I did it for ages, and once I figured out a better way, I immediately stopped using it.

I'm not demanding that you stop doing it, but here's something to consider:

Code: [Select]
@name Gun Store
@inputs Reset Up Down
@persist Index
@persist Shipments:table Profit

if (first()) {
    Profit = 1000

    Shipments = table(
        table(
            "Name" = "AK-47",
            "Price" = 2500,
            "Description" = "The AK-47 is a Semi-Automatic Rifle, that does a moderate ammount of damage, Popular among thiefs, this gun is cheap and reliable."
        ),

        table(
            "Name" = "AI AW50",
            "Price" = 3000,
            "Description" = "The AI AW50 is a heavy duty Sniper Rifle, Doing a ton of damage, this Rifle is extremely popular among snipers"
        ),

        table(
            "Name" = "M24",
            "Price" = 2550,
            "Description" = "the less powerfull m24 does less damage, can pentetrate less, but is faster at getting a shot off, and reloading, this rifle is popular among hitman"
        ),

        table(
            "Name" = "ACR",
            "Price" = 2500,
            "Description" = "Almost the same as an ak-47 lower damage but higher firerate"
        )
    )
}

if (~Up && Up) {
    # Index must not go above the number of shipments we have
    Index = min(Index + 1, Shipments:count())
}

if (~Down && Down) {
    # Nor below zero
    Index = max(Index - 1, 0)
}

if (~Reset && Reset) {
    Index = 0
}

local Gun = Shipments[Index, table]

# Debug code
printTable(Gun)

# Name = Gun["Name", string]
# Description = Gun["Description", string]
# Price = Gun["Price", number] + Profit

# EGP rendering nonsense goes here

Some notes here:
  • if (~Up && Up) { ... } - If up triggered the current execution (i.e., changed value) and is true (i.e., is pressed/active)
  • local - Completely optional in this example, but useful when you're building something crazy. Prevents variables from overwriting anything in @persist and introduces some scoping; especially helpful in UDFs, which we'll see in a bit.
  • Shipments[Index, table] - Table accessor. You can treat this like a regular variable, and even assign values to it with =. Index can be a number or a string, and table is the type you're retrieving from (or setting to) the table. Tables can contain contain anything, even more tables!

As for detecting if a button has been pressed, wire EGPs have an output called User:entity. With a bit of math and some trickery, we get this:
Code: [Select]
@name EGP Button Demo
@inputs Scr:wirelink
@persist User:entity

# The trick here is to wire this to the EGP's User:entity,
# so that the E2 runs and this is set whenever the screen
# is actually used (i.e., somebody presses E on it)

@inputs UserTrigger:entity

interval(100)

if (first()) {
    # User-defined function (UDF) to determine if a point is in
    # an EGP object (specifically, a rectangle around it)
    # if it looks scary, remember that it isn't--it creates a function less complicated
    # than egpBox :)

    function number wirelink:egpHover(Index:number, User:entity) {
        local Center = This:egpPos(Index)
        local Radius = This:egpSize(Index) / 2

        # Return 1 (true) if...

        return inrange(
            # The user's cursor is in range...
            This:egpCursor(User),

            # ...of the top left of the object...
            Center - Radius,

            # ...and the bottom right.
            Center + Radius
        )
    }

    # Little debug box

    Scr:egpBox(1, vec2(256), vec2(32))
}

if (findCanQuery()) {
    # Set User to the nearest player.
    findByClass("player")
    User = findClosest(Scr:entity():pos())
}

# Make the box darker if the user is hovering over it.

Scr:egpColor(1, vec(Scr:egpHover(1, User) ? 172 : 255))

# Print a message if the user presses the button.

if (Scr:egpHover(1, User) && UserTrigger == User) {
    print("Button pressed!")
}

Which should get you the rest of the way. If you don't get how all of it works yet, that's alright, just keep fiddling with it until you do. The Wiremod discord is a great resource!

A good place to go from here is to swap out the @inputs in the first E2 I've listed with the EGP buttons of the second. It'll take some doing, but it shouldn't be too hard. That should solve what you were aiming for in your post, good luck!
5
Dark RP - News / Information / Re: Staff applications?
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:50 pm to DjSexualWonderBread
Mod isn't really staff
6
News & Announcements / Re: Admin Helper E2...
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:50 pm to DjSexualWonderBread
Make 10 Generic ByB e2's to be used on the server, host a contest for e2s pick the best ones and whitelist them and blacklist any other code. Possibly whitelist certain users to make their own on the server??
7
DarkRP - MOTD Revisions / Re: Rules Missing
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:50 pm to DjSexualWonderBread
Taxi Driver : You do not own a slurpee machine, you're a taxi driver. Do your fucking job bitch.

Mechanic : You are not Bernie Sander 's even know you're a complete doppelganger looking character. Stop trying to give out free college and hand the shirt off MY back to these broke ass mfers and go fix some cars for a living you socialist fuck.

MOTD REVISION DJSEX
8
DarkRP - In Character / Re: Adam S Construction Co. - [FREE BASES]
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:50 pm to DjSexualWonderBread
I strongly disagree
9
General Chat / Re: Problems of ByB
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:50 pm to DjSexualWonderBread
Nice graph, printers need a buff
10
TTT General Chat / Re: ByB Sandbox
Idiocy Awards Idiocy Awards
on July 29, 2018, 07:49 pm to DjSexualWonderBread
hand picked admins :)
Pages: [1] 2 3