R_Atmrobbery
r_atmrobbery Exports & Commands
r_atmrobbery server exports, the hooks in the custom files and the admin command.
Server exports
ATMs are found by their position, so an ATM's id is its coordinates times ten, rounded:
'1475_-21_573' for an ATM at 147.5, -2.1, 57.3. The admin command near shows the position of
the nearest robbed ATM.
ResetAtm
Ends the cooldown and clears the cash of one ATM, or every ATM with 'all'. Returns true when it
worked.
exports.r_atmrobbery:ResetAtm('all')IsBeingRobbed
true while someone is robbing that ATM (not when it is only on cooldown).
if exports.r_atmrobbery:IsBeingRobbed(id) then
-- robbery in progress
endHooks
server/sv_custom.lua and client/cl_custom.lua are open. Fill in these functions to tie the
script to your server:
| Function | File | When |
|---|---|---|
CanRob(src, atm, method) | server | Before a robbery starts. Return false to block it. |
OnRobbed(src, atm, method, reward) | server | After a successful robbery, with the cash and items paid. |
OnAlarm(data, src) | server | When the police get the call (used for lb-tablet). |
CanRob(method, atm) | client | Before a robbery starts. Blocks dead, cuffed or in-vehicle players by default. |
SkillCheck(difficulty) | client | The crowbar skill check. |
HackMinigame(params, index, entity, token) | client | The hack. Swap in your own minigame. |
method is 'crowbar', 'hack', 'thermite' or 'rope'.
Admin command
/atmrobbery <action> for R.Admin.group (admin and god by default).
| Action | What it does |
|---|---|
status | One line per robbed ATM: position, phase, method and when it resets |
near | The nearest robbed ATM within 100 m and how far it is |
reset | Reset the robbed ATM within 5 m of you |
reset all | Reset every ATM |