Advanced Documentation

Developer Documentation and other advanced configuration options of the ATM Robbery system.

Custom Permission Systems

If you view your config.lua you will find a function to be defined with your permissions check. The same function is called to check for permission to receive notifications and to check if they are allowed to place new ATMs. The requests are differentiated through the type argument. It will be equal to 0 if the permissions check is to see if they can place a ATM, 1 to check if they can currently receive notifications, or 2 to check if they are allowed to initiate the stealing of an ATM, The permission check will be called on every attempted placement, every notification sent, and every attempted robbery.

Config.custom = {
    check_perms_server_side = true, -- If true the permission event will be sent out to the server side resource, this is recommended
    permissionCheck = function(source, type) -- This function will always be called server side.
        if type == 0 then -- Check for admin
            return true or false -- Return true if they have admin, return false if they don't
        elseif type == 1 then -- Check for notification perms
            return true or false -- Return true if they have permissions, return false if they don't
        elseif type == 2 then -- Check for perms to steal the ATM
            return true or false -- Return true if they have permissions, return false if they don't
        end
    end
}

If you need assistance setting this up you can hire a dev by going here and selecting "Hire a Developer".

Developer Documentation

When an ATM is being drilled initially, the sonoran-atmrobbery::ATM::Drilling_s event will fire to the server. The data table can be seen below. Upon completion of the final drilling, if Config.permissionMode is set to ace, the event Sonoran::ATM::Payout will be fired to the server. The data table can be seen below. Example event handlers can also be found below.

Event List

  • Sonoran::ATM::Payout

  • sonoran-atmrobbery::ATM::Drilling_s

Data Table Structure For Sonoran::ATM::Payout

Data Table Structure For sonoran-atmrobbery::ATM::Drilling_s

Example Handler

AddEventHandler("Sonoran::ATM::Payout", function(data)
	print("Player 1 recieved $" .. data["money"] .. " in " .. data["type"] .. " along with " .. data["items"].amount .. " " .. data["items"].item)
end)
AddEventHandler("sonoran-atmrobbery::ATM::Drilling_s", function(data)
	print("An ATM with the hash " .. data["atm"] .. " is currently being stolen on " .. data["street" .. " (" .. data["postal"] .. "). Exact coordinates: ".. data["location"])
end)

Last updated