Adding new documents

For a example we add a police badge

@vms_documents/server/server.lua search function showDocument, and we adding a new elseif

lines :63 -> :71

elseif type == "id_weapon" then
    playerInfo = {
        ['firstname'] = result[1].firstname,
        ['lastname'] = result[1].lastname,
        ['dob'] = result[1].dateofbirth,
        ['sex'] = result[1].sex,
        ['weapon'] = getLicense(src, "weapon"),
    }
elseif type == "police_badge" then -- unique of type
    playerInfo = { --here we fetch the things we want to be displayed on the document
        ['firstname'] = result[1].firstname, -- It must be because it is required in every document by JS by default
        ['lastname'] = result[1].lastname, -- It must be because it is required in every document by JS by default
        ['dob'] = result[1].dateofbirth, -- It must be because it is required in every document by JS by default
        ['sex'] = result[1].sex,
        ['grade'] = xPlayer.job.grade_label
    }
end

@vms_documents/config.lua search a Config.Documents, and we adding a new table named by unique type from server side

@vms_documents/html/app.js search eventListener from message, and we adding a new if to action open

Last updated

Was this helpful?