Exports
getContact(identifier)
Use this export to retrieve the info from a contact, including the player reputation.
If the player hasn't meet the contact yet the export will return false, unless the contact config field default is set to true.
Params:
identifier:
stringThe contact identifierReturns:
result:
table or falselocal result = exports['av_contacts']:getContact("garbage_job") if result then --[[ { identifier:string, name:string, default:boolean, coords:table, xp:number, level:number, description:string, avatar:string, } ]]-- else print("Player doesn't know this contact yet") end
getContacts()
Returns a table with all the contacts known by the player.
newContact(data)
Use this export from an external script to register a new contact in the contact list configuration.
Params:
data:
table
identifier:
stringAn unique identifier for the contact.name:
stringName used for display.coords:
tableCoords where the contact is located {x:number, y:number, z:number}avatar?:
stringAvatar used for contact list.description:
stringDescription used for contact list.default?:
booleanShow this contact by default.max?:
numberMax level available for this contact (every 100XP is 1 level)
addContact(playerId, identifier)
Trigger this export when the player meets a contact, this will register the contact in the player contacts list.
Params:
playerId:
numberThe player server ID.identifier:
stringThe contact identifier.Returns:
result:
booleanIt will return true if the contact is registered successfully or false if the player already had this contact on his list.
removeContact(playerId, identifier)
Use this export to remove a contact from the player contacts list and remove his reputation with the contact.
Params:
playerId:
numberThe player server ID.identifier:
stringThe contact identifier.Returns:
result:
booleanReturn true if the contact was removed or false if the contact didn't exists in player list OR you added a non existing contact identifier.
addXP(playerId, identifier, xp)
Add reputation to the relationship between the player and the selected contact.
Params:
playerId:
numberThe player server IDidentifier:
stringThe contact identifierxp:
numberThe reputation to addReturns:
result:
booleanIt will only return false if the export receives a null value, or if the player ID and/or contact identifier don't exist.
removeXP(playerId, identifier, xp)
Remove reputation to the relationship between the player and the contact.
Params:
playerId:
numberThe player server IDidentifier:
stringThe contact identifierxp:
numberThe reputation to removeReturns:
result:
booleanIt will return false if any parameter is null or invalid, or if the player has no existing relationship with the specified contact.
getContacts(playerId)
Params:
playerId:
numberThe player server IDReturns:
result:
tableReturns a table with all the contacts known by the player.
getContact(playerId, identifier)
Use this export to retrieve the info from a contact, including the player reputation.
If the player hasn't meet the contact yet the export will return false, unless the contact config field default is set to true.
Params:
playerId:
numberThe player server IDidentifier:
stringThe contact identifierReturns:
result:
table or false
Last updated