Documentation

Server Base Functions

vRP.getUserIdByIdentifiers(ids, cbr)

Fetches the user id from the player's identifiers.

Params:

ids - (Table)

cbr (Call back of UserID)

vRP.getSourceIdKey(source)

Returns an identification string for the source provided.

Params:

source - (Player's tempid)

vRP.getPlayerEndpoint(player)

Returns the player's IP address. (Required to be on the server at the time)

Params:

player - Source, again (Player's tempid)

vRP.getPlayerName(player)

Returns the name of the player they must be on the server.

Params:

player - Source, again (Player's tempid)

vRP.ReLoadChar(source)

This is a recent implementation in Dunko vRP which allows the restarting of vRP and resolves nil ids.

Params:

source - Source, again (Player's tempid)

vRP.isBanned(user_id, cbr)

This allows us to check if the user is banned from the server and will provide a callback return of true or false if a database entry is found.

Params:

user_id - The user's id in the database.

Cbr - callback function to return the value.

vRP.GiveWarning(target_id, adminName, warningReason)

This allows you to give a user a warning on the F10 system implementation.

Params:

target_id - The user's id to warn in the database.

adminName - The warning admin

warningReason - The reason for the F10 warning.

vRP.isWhitelisted(user_id, cbr)

This allows us to check if the user is whitelisted from the server and will provide a callback return of true or false if a database entry is found.

Params:

user_id - The user's id in the database.

Cbr - callback function to return the value.

vRP.setWhitelisted(user_id,whitelisted)

This allows us to set if the player is whitelisted this will only work if whitelisting is enabled in base.lua cfg

Params:

user_id - The user's id in the database.

whitelisted - The value true or false if to set the whitelist.

vRP.getLastLogin(user_id, cbr)

Get the last login of the player from the database.

Params:

user_id - The user's id in the database.

Cbr - callback function to return the value.

vRP.fetchBanReasonTime(user_id,cbr)

Fetches the ban reason, bantime, and banning admin.

Params:

user_id - The user's id in the database.

Cbr - callback function to return the values.

vRP.setUData(user_id,key,value)

Sets the user data table with the specified key this is usually used to set inventory data and vehicle boot data.

Params:

user_id - The user's id in the database.

key - The key that is used to select the database entry for that specific data.

value - Is the value to save to that entry usually in a JSON format.

vRP.getUData(user_id,key,cbr)

This fetches the user data with the specified key this is used to fetch the value.

Params:

user_id - The user's id in the database.

key - The key that is used to select the database entry for that specific data.

cbr - The callback to return the data.

vRP.setSData(key,value)

Params:

key - The database entry key to select for that specific data.

value - To set for the database entry value.

vRP.getSData(key, cbr)

Params:

key - The database entry key to select for that specific data.

cbr - The callback to return the data.

vRP.getUserDataTable(user_id)

Fetches the user data table entry in the database vrpuser_data entry.

Params:

user_id - The user's id in the database.

Will return the user table.

vRP.getUserTmpTable(user_id)

Returns the user temp table which will reset when the server restarts or vRP resource restarts.

Params:

user_id - The user's id in the database.

Will return the temp table.

vRP.isConnected(user_id)

Returns if the user is connected to the server or not.

Params:

user_id - The user's id in the database.

Will return true or false whether the user is on the server.

vRP.isFirstSpawn(user_id)

Returns whether this is the first time the user is connecting to the server.

Params:

user_id - The user's id in the database.

vRP.getUserId(source)

Fetches the userid from the source of the player.

Params:

source - (Player's tempid)

vRP.getUsers()

Returns the users on the table with a key and index

Example:

local users = vRP.getUsers()
for userid,source in pairs(users) do 
   print(userid, source)
end

vRP.getUserSource(user_id)

Returns the source of the player from the user_id

Params:

user_id - The user's id in the database.

vRP.IdentifierBanCheck(source,user_id,cb)

Checks if this players identifiers are banned.

Params:

source - The source of the player (temp id as some may call it)

user_id - The user's id in the database.

cb - The callback function to return true or false whether they are banned + the userid this is linked too.

vRP.BanIdentifiers(user_id, value)

This will ban all the users identifiers in the database for the specified user ID.

Params:

user_id - The user's id in the database.

value - true or false whether to be banned or not.

vRP.setBanned(user_id,banned,time,reason, admin)

This will set the specified user banned and will automatically ban identifiers and tokens.

Params:

user_id - The user's id in the database.

banned - Sets whether the user is banned or not.

Time - this time should be in unix time (s)

Reason - the reason for the ban to be displayed.

Admin - The admin to show up on the banned by: message.

This can be used to unban players too! Example below

vRP.setbanned(user_id, false)

vRP.ban(adminsource,permid,time,reason)

This will ban the user. This is to be used on ban functions.

Params:

adminsource - The banning admin.

permid - The userid that is getting banned.

Time - This is the time in hours it will convert to unix for you.

Reason - the reason for the ban in a string format.

This can be used even if the player is offline!

vRP.ban(adminsource, 1, 24, "Being a JamesUK!!") -- This will ban the player for 24 hours (1 day)

This function will automatically token and identifier ban.

vRP.banConsole(permid,time,reason)

This function is new to Dunko vRP and will allow you to console ban users without requiring an admin source.

Params:

permid - The user id of the user being banned.

time - The time in hours this will be converted for you to unix.

reason - Again the reason for the ban.

This can even be used if the player is offline!

vRP.banConsole(1, 24,"Stop being a JamesUK!!") -- This again will console ban the player for 24 hours.

vRP.StoreTokens(source, user_id)

This will store all the tokens from the specified source and assign them to that userid.

Params:

source - The player's tempid.

userid - The player's userid in the database entry.

vRP.CheckTokens(source, user_id)

Checks each of the sources tokens to see if the player is banned by any of his tokens and then will return that if the user is banned and the users user_id.

Params:

source - The player's tempid.

userid - The player's userid in the database.

The player must be online

vRP.BanTokens(user_id, banned)

This will ban all the tokens of the player that are registered.

Params:

user_id - The player's userid in the database.

banned - Sets whether the tokens are banned or not.

vRP.kick(source,reason)

This will kick the source and remove them from the server with the specified reason they can reconnect.

Params:

source - The player's tempid.

userid - The player's userid in the database.

Server Survival Functions

vRP.getHunger(user_id)

This will return the number value of hunger for that player.

Params:

userid - The player's userid in the database.

vRP.getThirst(user_id)

This will return the number value of thirst for that player.

Params:

userid - The player's userid in the database.

vRP.setHunger(user_id, value)

This will set value of hunger for the player.

Params:

userid - The player's userid in the database.

value - The amount of hunger eg: 0-100

vRP.setThirst(user_id, value)

This will set value of thirst for the player.

Params:

userid - The player's userid in the database.

value - The amount of thirst eg: 0-100

vRP.varyHunger(user_id, variation)

This will vary the hunger which means it will add the variation on top of their current hunger.

Params:

userid - The player's userid in the database

variation - The amount to add onto their hunger.

vRP.varyThirst(user_id, variation)

This will vary the thirst which means it will add the variation on top of their current thirst.

Params:

userid - The player's userid in the database

variation - The amount to add onto their thirst.

Server Police Functions

vRP.insertPoliceRecord(user_id, line)

This will insert a new police record line, however this function is likely to be deprecated in future.

Params:

userid - The player's userid in the database

line - The string to add.

vRP.openPolicePC(source)

Will open the police pc

Params:

source - The user's tempid persay as some would call it.

vRP.openPoliceMenu(source)

Will open the police menu

Params:

source - The user's tempid persay as some would call it.

vRP.getUserWantedLevel(user_id)

This will return the wanted level of the player, again this likely won't be required by most of you.

Params:

user_id - The user's id in the database.

Server Money Functions

vRP.getMoney(user_id)

This will get the player's wallet amount.

Params:

user_id - The user's id in the database.

vRP.setMoney(user_id,value)

This will set the user's wallet to the specified amount

Params:

user_id - The user's id in the database.

value - The amount of money to set.

vRP.tryPayment(user_id,amount)

This reducts money from the user's wallet. It will return a true or false value if it successfully took the money from the user.

Params:

user_id - The user's id in the database.

amount - The amount of money to take.

if vRP.tryPayment(1, 2000) then 
    print('Money taken!! Award Item')
else
    print('Darn money not taken not enough funds bro.')
end

vRP.tryBankPayment(user_id, amount)

This reducts money from the user's bank

Params:

user_id - The user's id in the database.

amount - The amount of money to take.

The example above will work in the same way this however just need to change vRP.tryPayment to vRP.tryBankPayment

vRP.giveMoney(user_id,amount)

This will give the user money which will add to his current amount of money this money will be stored within his wallet.

Params:

user_id - The user's id in the database.

amount - The amount of money to take.

vRP.getBankMoney(user_id)

This function will fetch the user's money that they have in their bank!

Params:

user_id - The user's id in the database.

Returns the amount of money in their bank.

vRP.setBankMoney(user_id,value)

This will set the bank money for the user it will not add or remove it will set it to that exact value.

Params:

user_id - The user's id in the database.

Value - the amount to set it too!

vRP.giveBankMoney(user_id,amount)

This will add to the current bank balance of the user.

Params:

user_id - The user's id in the database.

amount - The amount to add to their bank balance.

vRP.tryWithdraw(user_id,amount)

This value checks if the user has the specified amount to withdraw and if it does it will withdraw that to their wallet.

Params:

user_id - The user's id in the database.

amount - The amount to add to their bank balance.

Returns true or false if successful or not.

vRP.tryDeposit(user_id,amount)

This value checks if the user has the specified amount to deposit and if it does it will deposit that to their bank.

Params:

user_id - The user's id in the database.

amount - The amount to add to their bank balance.

Returns true or false if successful or not.

vRP.tryFullPayment(user_id,amount)

This will try to take money from both the bank and wallet. It will return true or false whether successful or not.

Params:

user_id - The user's id in the database.

amount - The amount to subtract.

if vRP.tryFullPayment(1, 2000) then 
    print('Money taken!! Award Item')
else
    print('Darn money not taken not enough funds bro.')
end

Server Map Functions

vRP.setArea(source,name,x,y,z,radius,height,cb_enter,cb_leave)

This sets a set of coords as an "area" when a user enters this vRP will update and send a callback on entering and leaving. This function will likely be deprecated soon as it's rarely used.

Params:

source - The tempid of the user.

name - The name of the area

x - X Coordinate

y - Y Coordinate

z - Z Coordinate

Radius - The radius from center of those coords.

Height - How height this area is applied for.

cb_enter - Function to handle entering in area will return source and name.

cb_leave - Function to handle entering in area will return source and name.

This is set for that user source only.

vRP.removeArea(source,name)

This is self-explanatory and just removes the area for the player.

Params:

source - Users TempID

name - Name of the area.

This is set for that user source only.

Server Inventory Functions

vRP.computeItemName(item,args)

This will return the item name for the specified item.

Params:

item - The item name.

args - The path to the item in the vRP.Items table

Example:

  local args = vRP.parseItem(idname) 
  local item = vRP.items[args[1]] -- Args[1] is the name of the item
  if item ~= nil then
    return vRP.computeItemName(item,args), vRP.computeItemDescription(item,args), vRP.computeItemWeight(item,args)
  end

vRP.computeItemWeight(item,args)

This will return the item weight for the specified item.

Params:

item - The item name.

args - The path to the item in the vRP.Items table

Example:

  local args = vRP.parseItem(idname) 
  local item = vRP.items[args[1]] -- Args[1] is the name of the item
  if item ~= nil then
    return vRP.computeItemName(item,args), vRP.computeItemDescription(item,args), vRP.computeItemWeight(item,args)
  end

vRP.computeItemDescription(item,args)

This will return the item description for the specified item.

Params:

item - The item name.

args - The path to the item in the vRP.Items table

Example:

  local args = vRP.parseItem(idname) 
  local item = vRP.items[args[1]] -- Args[1] is the name of the item
  if item ~= nil then
    return vRP.computeItemName(item,args), vRP.computeItemDescription(item,args), vRP.computeItemWeight(item,args)
  end

vRP.computeItemChoices(item,args)

This will return the choices for the item which can then be compiled into a use list.

Params:

item - The item name.

args - Path to item in vRP.Items Table

This works the same as the above examples do also.

Example:

local args = vRP.parseItem(idname)
local item = vRP.items[args[1]]
local choices = {}
    if item ~= nil then
        -- compute choices
        local cchoices = vRP.computeItemChoices(item, args)
        if cchoices then -- copy computed choices
            for k, v in pairs(cchoices) do
                choices[k] = v
            end
        end

        -- add give/trash choices
        choices[lang.inventory.give.title()] = {function(player, choice)
            ch_give(idname, player, choice)
        end, lang.inventory.give.description()}
        choices[lang.inventory.trash.title()] = {function(player, choice)
            ch_trash(idname, player, choice)
        end, lang.inventory.trash.description()}
    end

vRP.parseItem(idname)

Splits the string based on the | seperator set by vRP.

Params:

idname - The idname of the item set in the cfg/items configuration.

vRP.getItemDefinition(idname)

Fetches you the name, description, weight of the item.

Params:

idname - The idname of the item set in the cfg/items configuration.

Returns name, description, weight.

local name, description, weight = vRP.getItemDefinition("seeds")
print(name, description, weight)

vRP.getItemName(idname)

Returns the item name from the idname

Params:

idname - The idname of the item set in the cfg/items configuration.

vRP.getItemDescription(idname)

Returns the item description from the idname.

Params:

idname - The idname of the item set in the cfg/items configuration.

vRP.getItemChoices(idname)

This will again set the choices out for the inventory.

Params:

idname - The idname of the item set in the cfg/items configuration.

vRP.getItemWeight(idname)

This will fetch the item weight for the specified item.

Params:

idname - The idname of the item set in the cfg/items configuration.

vRP.computeItemsWeight(items)

This will compute all the item weight of all the items in the inventory/chest table format.

Params:

items - A table of the user's inventory.

local data = vRP.getUserDataTable(user_id)
local weight = vRP.computeItemsWeight(data.inventory)

vRP.giveInventoryItem(user_id, idname, amount, notify)

Gives the specified user an item.

Params:

user_id - The id of the user

idname - The item name

amount - The amount of the item

notify - Whether to give them a notification on the fact they recieved the item.

Example:

vRP.giveInventoryItem(user_id, "money", 1000, true)

vRP.tryGetInventoryItem(user_id, idname, amount, notify)

This will try to obtain the item specified from the user and returns a true or false value if successful the same as vRP.tryPayment and vRP.tryFullPayment work!

Params:

user_id - The id of the user

idname - The item name

amount - The amount of the item

notify - Whether to give them a notification on the fact they recieved the item.

 if vRP.tryGetInventoryItem(user_id,"weed",1) then
    print('he has the item!')
 else
    print('pog you do not sad.')
 end

vRP.getInventoryItemAmount(user_id, idname)

Will return the item amount in the user's inventory.

Params:

user_id - The id of the user.

idname - The item name in the items.lua

vRP.getInventoryWeight(user_id)

Will return the current inventory weight for the user.

Params:

user_id - The id of the user.

vRP.getInventoryMaxWeight(user_id)

Will return the max weight for the user.

Params:

user_id - The id of the user.

vRP.clearInventory(user_id)

Clears the inventory for that user.

Params:

user_id - The id of the user.

vRP.openInventory(source)

Opens the inventory for the specified source.

Params:

source - The temp id of the user.

vRP.openChest(source, name, max_weight, cb_close, cb_in, cb_out)

Opens a chest by the name for the specified user.

Params:

source - The temp id of the user

name - The name of the chest.

max_weight - The weight of the chest.

cb_close - The function upon closing the chest.

cb_in - Function upon opening the chest.

Server Identity Functions

vRP.getUserIdentity(user_id, cbr)

Fetches the user identity from the database.

Params:

user_id - The id of the user.

cbr - The callback to return the value.

vRP.getUserByRegistration(registration, cbr)

This will return the user_id from the registeration number stored in the database.

Params:

registration - The user's car registeration.

cbr - The callback function to return the userid.

vRP.getUserByPhone(phone, cbr)

This will return the user_id from the phone number stored in the database.

Params:

phone - The user's phone number.

cbr - The callback function to return the userid.

vRP.generateStringNumber(format)

Returns a random generated string.

Params:

format - (ex: DDDLLL, D => digit, L => letter)

vRP.generateRegistrationNumber(cbr)

Returns a random generated registration number.

Params:

cbr - The callback function to return the generated numberplate.

vRP.generatePhoneNumber(cbr)

Returns a random generated phone number.

Params:

cbr - The callback function to return the generated phone number.

Server Home Functions

vRP.getUserAddress(user_id, cbr)

Fetches the user's address from user_id

Params:

user_id - The id of the user.

cbr - The callback function to return the address.

vRP.setUserAddress(user_id,home,number)

It sets the users address.

Params:

user_id - The id of the user.

Home - Set the specified home

Number - Sets specified number for that specified home.

vRP.removeUserAddress(user_id)

Removes user address from that user_id

Params:

user_id - The id of the user.

vRP.getUserByAddress(home,number,cbr)

Returns the userid from the user's address.

Params:

home - The set slot.

number - Number for set slot

cbr - The callback function to return the user_id.

vRP.findFreeNumber(home,max,cbr)

Finds a free house number to buy.

Will return nil if none are available.

Params:

Home - specified house slot.

Max - Max number of houses.

Cbr - The callback function to return the user_id

vRP.defHomeComponent(name, oncreate, ondestroy)

This defines homes as such:

ondestroy(owner_id, slot_type, slot_id, cid, config, x, y, z, player)

oncreate(owner_id, slot_type, slot_id, cid, config, x, y, z, player)

name: unique component id

Params:

name - The specified plot

oncreate - The callback for creation with the args above.

ondestroy - The callback for destruction with the args above.

vRP.accessHome(user_id, home, number, cbr)

This function allows access to homes via address for the specified user the same as pressing enter on the home.

Params:

user_id - The id of the user.

Home - the plot name.

Number - the plot number

Cbr - The callback to return true or false.

Server GUI Functions

vRP.openMenu(source,menudef)

This will open a menu to the source player provided.

Params:

source - The user's tempid persay.

menudef - The table of information for the GUI like styling etc.

Example:

local atm_menu = {
    name = "ATM",
    css = {
        top = "75px",
        header_color = "rgba(0,255,125,0.75)"
    }
}
vRP.openMenu(source, atm_menu)

vRP.closeMenu(source)

Closes the player menu.

Params:

source - The user's tempid persay.

vRP.prompt(source,title,default_text,cb_result)

This will prompt an input box to the player to enter the required input which can then be validated by you all on the server side!

Params:

source - The user's tempid persay.

Title - The input box top part that will contain what you are asking for eg: What is the permid?

default_text - Is what will be in the box default.

cb_result - To return the specified text. function(player, text)

Example:

 vRP.prompt(player,"User id:","",function(player,user_id) 
     if user_id then 
         print('His userid is: ' .. user_id)
     end
 end)

You should validate the data as it can return empty!

vRP.request(source,text,time,cb_ok)

This will return a response to accept or decline if the user accepts it will return true and if not then it will return false.

Params:

source - The user's tempid persay.

text - The question to ask eg: Admin Ticket TP to?

time - The time in seconds for it to expire.

Example:

vRP.request(v,"Take admin ticket", 60, function(v,ok)
   if ok then
      print('ticket accepted teleporting now!')
   end
end)

vRP.registerMenuBuilder(name, builder)

This will register a new menu builder function.

Params:

name - The name of the menu

builder - The builder callback.

Example:

vRP.registerMenuBuilder("main", function(add, data)
    local user_id = vRP.getUserId(data.player)
    if user_id ~= nil then
        local choices = {}
        if vRP.hasPermission(user_id, "emergency.revive") then
            choices[lang.emergency.menu.revive.title()] = choice_revive
        end

        add(choices)
    end
end)

vRP.buildMenu(name, data, cbr)

This will build a new menu.

Params:

name -- menu type.

data - The custom data table

cbr - The return built choices.

Example:

vRP.buildMenu("admin", {player = source}, function(menudata)
        menudata.name = "Admin"
        menudata.css = {top="75px",header_color="rgba(0,125,255,0.75)"}
        vRP.openMenu(source,menudata)
end)

vRP.openMainMenu(source)

This will open the player menu.

Params:

source - The user's tempid.

This will open the generated menu as can be seen in the example above!

vRP.addStaticMenuChoices(name, choices)

This will add menu choices to the phone.

Params:

name - The name of the menu

choices - The choices eg: Use, Trash etc..

Choices example:

local emergency_heal = {}
emergency_heal["Heal"] = function(player,choice)
	local user_id = vRP.getUserId(player) 
	vRPclient.setHealth(player,1000)
end

Server Group Functions

vRP.getUserGroups(user_id)

This will return all of the user's groups.

Params:

user_id - The id of the user.

vRP.addUserGroup(user_id,group)

This will add the specified group to the specified user.

Params:

user_id - The id of the user.

group - The group name that is specified in the cfg/groups.lua

Example:

vRP.addUserGroup(1,"superadmin")

vRP.getUserGroupByType(user_id,gtype)

Fetches the user group by it's group type which is set in the cfg/groups.lua

Params:

user_id - The user's id.

gtype - The group type.

vRP.getUsersByGroup(group)

Returns a list of connected users by their group.

Params:

group - The groups's name

vRP.getUsersByPermission(perm)

Returns a list of connected users by their perm.

Params:

perm - The permission.

vRP.removeUserGroup(user_id,group)

This will remove the group from a connected user.

Params:

user_id - The user's id.

group - The group name

vRP.hasGroup(user_id,group)

This will return true or false whether the specified user has that group. Great for permission checking your events!

Params:

user_id - The user's id

group - The group name.

vRP.hasPermission(user_id, perm)

This will return true or false whether the specified user has that permission. Great for permission checking your events!

Params:

user_id - The user's id

perm - The perm name.

vRP.hasPermissions(user_id, perms)

Checks if a user has all the specified perms listed in the perms table.

Params:

user_id - The user's id

perms - The table of perms to check.

Server Business Functions

vRP.getUserBusiness(user_id, cbr)

Returns the user's business data from the database.

Params:

user_id - The user's id

cbr - The callback for the data.

vRP.closeBusiness(user_id)

Deletes the business for the specified user.

Params:

user_id - The user's id.

Server Phone Functions

vRP.sendServiceAlert(sender, service_name,x,y,z,msg)

This will send a call to the police or EMS.

Params:

sender - The caller or nil.

service_name - The service required eg: emergency for EMS.

x,y,z - The coordinates of the call.

msg - The msg of what the call will be.

Example:

vRP.sendServiceAlert(source,"emergency",x,y,z,"Help! I've fallen and can't get up!")

vRP.sendSMS(user_id, phone, msg, cbr)

Used to notify a user of an SMS message they have recieved from another player.

Params:

user_id - The user's id.

phone - The phone number of the user the message has been sent to.

msg - The message to be sent.

cbr - The callback to return whether it was successfully sent.

vRP.sendSMSPos(user_id, phone, x,y,z, cbr)

Sends their position from a user to another user's phone number.

Params:

user_id - The user's id.

phone - The phone number of the user the message has been sent to.

x,y,z - The coordinates of the position.

cbr - The callback for the SMS to see if it has been sent successfully returns true if so.

vRP.getPhoneDirectory(user_id)

Returns the phone directory for the specified user.

Params:

user_id - The user's id.

vRP.getPhoneDirectoryName(user_id, phone)

Returns the directory name for that specified phone number.

Params:

user_id - The user's id.

vRP.getPhoneSMS(user_id)

Fetches the temp SMS table.

Params:

user_id - The user's id.

Server Admin Menu Functions

vRP.openAdminMenu(source)

Opens the admin menu for the specified source.

Params:

source - The user's tempid persay.

Client Basic Garage Functions

tvRP.spawnGarageVehicle(vtype,name,pos)

This will spawn a garage vehicle for that user which will register if you have the one vehicle out at a time only option enabled this will not allow them to get the vehicle out if they already have one out.

Params:

vtype - This is the vehicle type eg: "Car" etc.

name - This is the vehicle spawncode.

pos - The coors to spawn the vehicle at.

tvRP.despawnGarageVehicle(vtype,max_range)

This will despawn the garage vehicle by the vehicle type.

Params:

vtype - This is the vehicle type eg: "Car" etc.

max_range - This is the max range to despawn all vehicles within that radius from the player.

Client Map Functions

tvRP.addBlip(x,y,z,idtype,idcolor,text)

Adds a blip to the map in the specified coords with the specified id and color.

Params:

x,y,z - The coordinates for the blip.

idtype - The blip id type which can be found here

idcolor - The id colours can also be found on the above page.

text - The text for the blip.

This returns the blip native id.

tvRP.removeBlip(id)

This will remove the blip by it's native ID.

Parms:

id - The blips id.

Client Base Functions

tvRP.teleport(x,y,z)

This will teleport the player to the specified coordinates.

Params:

x,y,z - The coordinates to teleport the player too.

tvRP.getPosition()

This will get the position of the player and return their specified coordinates.

Client Police Functions

tvRP.setCop(flag)

This will set whether the player is a cop or not.

Params:

flag - True or false.

tvRP.toggleHandcuff()

This will toggle whether the player is in handcuffs or not.

We are aware of an exploit where cheaters can uncuff themselves.

Client Survival Functions

tvRP.varyHealth(variation)

This will add health onto the player's current health.

Params:

variation - The amount to add onto their current health.

tvRP.getHealth()

This will return the players current health.

Client GUI Functions

tvRP.openMenuData(menudata)

Opens a menu with the specified menu data.

Params:

menudata - A JSON containing data for the menu.

tvRP.closeMenu()

Closes the users menus.

Client Player State Functions

tvRP.getWeaponTypes()

Fetches weapon types.

tvRP.getWeapons()

Fetches all of a players weapons and ammo and returns them in a table.

tvRP.giveWeapons(weapons,clear_before)

Will give the specified weapons in the weapons param table to the player.

Params:

weapons - The table with all the weapons,.

clear_before - Whether to clear the weapon wheel beforehand.

Last updated