GKSHOP
GKSPHONE V2Configuration

Charge

Battery drain, powerbanks, and charging stations — every setting in gksphone/config/charge/config.lua.

Everything on this page lives in gksphone/config/charge/config.lua.

The battery system is off out of the box. Nothing on this page has any effect until you set ChargeOn = true.

Turning it on

ChargeOn = false   -- master switch for the whole battery system

With it off, phones never lose charge and charging stations do nothing.

Drain rate

ChargeMillisecond = 120000   -- milliseconds per 1% of battery

At the default of 120000, a phone loses 1% every two minutes — a full battery lasts roughly 3 hours 20 minutes of connected time. Lower the number to drain faster.

Powerbanks

A powerbank is an inventory item a player consumes to top up on the move.

Config.ChargeItems = { "powerbank" }   -- item names that act as a powerbank
PowerBankFillingTime = 5               -- seconds per tick
PowerBank = 2                          -- % restored per tick

The defaults restore 2% every 5 seconds. Add more item names to Config.ChargeItems if you sell several tiers of powerbank — each one is registered as a usable item automatically.

The item has to exist in your inventory as well. Installation has the definitions per inventory.

Charging stations

Two kinds of station are placed around the map, both defined as vector4(x, y, z, heading) lists:

TableStationsPropRateCost
PhoneNormalCharging16gks_charge_normalNormalCharging = 1 % per NormalChargingFillingTime = 5 sNormalChargePay = 30
PhoneFastCharging18gks_charge_fastFastCharging = 3 % per FastChargingFillingTime = 5 sFastChargePay = 50

Fast charging is three times quicker and costs more. Both pay values are multiplied by the percentage actually charged, so a player who tops up 40% at a fast station pays 50 × 40.

Add or remove locations by editing the vector4 entries:

PhoneNormalCharging = {
    vector4(640.49, 257.56, 103.3, 242.0),
    vector4(155.01, -1038.48, 29.3, 159.62),
    -- ...
}

Starting and stopping a charge

Config.UseChargeKey = "E"          -- key pressed at a station
ChargeEyeTarget     = false        -- true: use your target script instead of the key
ChargeEndCommand    = "endcharge"  -- command that ends the session

Leave ChargeEyeTarget = false to use the key prompt. Set it to true if you run a target (eye) script and would rather players interact that way.

Map blips

ChargeBlipOn          = false  -- show charging stations on the map
ChargeBlipScale       = 1.0    -- icon size
ChargeBlipSprite      = 354    -- blip icon
ChargeBlipDisplay     = 2      -- 0 = hidden, 2 = map and minimap
ChargeBlipColourNormal = 0     -- colour for normal stations
ChargeBlipColourFast   = 7     -- colour for fast stations
ChargeBlipMaxDistance = 0      -- only draw blips within N metres (0 = no limit)
ChargeBlipMaxCount    = 0      -- only draw the N nearest blips (0 = all)

With 34 stations on the map, ChargeBlipMaxDistance and ChargeBlipMaxCount are worth using — they keep the map readable by drawing only what is nearby.

The charge config file

gksphone/config/charge/config.lua

Restart the phone

config.lua is read at resource start, so restart gksphone after editing.

On this page