You can use these to send alerts, distress signals and call to.
To add or modify job contacts [taxi, police, etc.] you can do that in the high_phone/config.lua file.
This resource is also compatible with dispatch scripts. The kinds that change your phone number to 911 or some other number, you just have to change the script's event that updates the phone data to a client-event high_phone:updateData
To add more job contacts or modify the existing ones find the line Config.JobContacts = {
Now if you want to add more contacts just copy the part below and paste it below all the job contacts, to understand what each line does, read the comments next to them:
["examplejob"] = { -- People with this job will receive these calls/messages. name ="Example", -- Shown contact name number ="123", -- Phone number to call to photo ="./media/icons/filename.png", -- base64 data image or an image URL or file location OR leave empty for no image. preAdded =true, -- Add it to the contacts app or not? If not added [set to false], you can only call it through the phone app, or message it through the messages app. callable =true, -- Can you call the contact? attachments =false, -- Can you send images as attachments to this contact? displayStatus =true, -- Display the online status for this contact when there are players in the job online?messageCallback=function(server,content,senderNumber)-- Add shared (server & client) code here. Argument 'server' is the IsDuplicityVersion function's returned value (shows if the environment is server-side or client-side)if(not server) thenprint("This is on the client-side, I just sent this message: '" .. content .."'")elseprint("This is on the client-side, number " .. senderNumber .." just sent this message: '" .. content .."'")endend },
To use custom pictures for these contacts head to html/media/icons and upload your icons there. Then just change the file name in the field photo to the name of the image file you've uploaded and you're done!
If you want to use image links, just paste the link in the field photo
You can execute your own functions once a message is sent to that number. This function can be used for seperate dispatch resources such as core_dispatch.
This code snippet should be pasted inside a job contact's table inside Config.JobContacts
messageCallback=function(server,content,senderNumber)-- Add shared (server & client) code here. Argument 'server' is the IsDuplicityVersion function's returned value (shows if the environment is server-side or client-side)if(not server) thenprint("This is on the client-side, I just sent this message: '" .. content .."'")elseprint("This is on the client-side, number " .. senderNumber .." just sent this message: '" .. content .."'")endend
Invisible job contacts are useful if you want to send messages from the server to a player. Here's how you can do that:
Paste the snippet above inside Config.JobContacts.
Replace the "examplejob" to a random non-existant job name.
Set the preAdded field to false.
If you've done everything above, you should be able to send messages from that number to player in the server-side using exports from here.