Functions
Here you will find functions and example code on how to use our Interactions.
Local Entity
The Interactions can only be invoked on the Client-Side!
Adding Local Entity
exports["is_interaction"]:addInteractionLocalEntity(name, entity, data)exports["is_interaction"]:addTextLocalEntity(name, entity, data)name:
stringentity:
objectdata:
tablehideSquare:
booleanornilcheckVisibility:
booleanornilshowInVehicle:
booleanornildistance:
numberornildistanceText:
numberorniloffset:
tableorniltext:
tablex:
numbery:
numberz:
number
target:
tablex:
numbery:
numberz:
number
bone:
numberorstringorniloptions:
tableoption:
indexed tablename:
stringornillabel:
stringornilicon:
stringornilkey:
stringornilduration:
numberornilonSelect:
functionornil
Example Usage
-- Example 1: Using Interaction
exports["is_interaction"]:addInteractionLocalEntity("testInteraction", entity, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
key = "E",
duration = 500,
onSelect = function()
print("option1 working")
end
},
}
})
-- Example 2: Using Text
exports["is_interaction"]:addTextLocalEntity("testText", entity, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
},
}
})Removing Local Entity
exports["is_interaction"]:removeLocalEntity(entity, name, option)entity:
objectname:
stringorniloption:
nameornil
Example Usage
-- Example 1: Removing All Interactions
exports["is_interaction"]:removeLocalEntity(entity)
-- Example 2: Removing provided Interaction
exports["is_interaction"]:removeLocalEntity(entity, "testText")
-- Example 3: Removing provided Interaction Option
exports["is_interaction"]:removeLocalEntity(entity, "testText", "option1")Hiding/Showing Local Entity
exports["is_interaction"]:hideLocalEntity(entity, name)exports["is_interaction"]:showLocalEntity(entity, name)entity:
objectname:
stringornil
Example Usage
-- Example 1: Hiding All Interactions for specified Local Entity
exports["is_interaction"]:hideLocalEntity(entity)
-- Example 2: Hiding Interaction for specified Local Entity
exports["is_interaction"]:hideLocalEntity(entity, "testText")
-- Example 3: Showing All Interactions for specified Local Entity
exports["is_interaction"]:showLocalEntity(entity)
-- Example 4: Showing Interaction for specified Local Entity
exports["is_interaction"]:showLocalEntity(entity, "testText")Model
The Interactions can only be invoked on the Client-Side!
Adding Model
exports["is_interaction"]:addInteractionModel(name, model, data)exports["is_interaction"]:addTextModel(name, model, data)name:
stringmodel:
hashdata:
tablehideSquare:
booleanornilcheckVisibility:
booleanornilshowInVehicle:
booleanornildistance:
numberornildistanceText:
numberorniloffset:
tableorniltext:
tablex:
numbery:
numberz:
number
target:
tablex:
numbery:
numberz:
number
bone:
numberorstringorniloptions:
tableoption:
indexed tablename:
stringornillabel:
stringornilicon:
stringornilkey:
stringornilduration:
numberornilonSelect:
functionornil
Example Usage
-- Example 1: Using Interaction
exports["is_interaction"]:addInteractionModel("testInteraction", model, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
key = "E",
duration = 500,
onSelect = function(entity)
print("found "..entity)
end
},
}
})
-- Example 2: Using Text
exports["is_interaction"]:addTextModel("testText", model, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
},
}
})Removing Model
exports["is_interaction"]:removeModel(model, name, option)model:
hashname:
stringorniloption:
nameornil
Example Usage
-- Example 1: Removing All Interactions
exports["is_interaction"]:removeModel(model)
-- Example 2: Removing provided Interaction
exports["is_interaction"]:removeModel(model, "testText")
-- Example 3: Removing provided Interaction Option
exports["is_interaction"]:removeModel(model, "testText", "option1")Hiding/Showing Model
exports["is_interaction"]:hideModel(model, name)exports["is_interaction"]:showModel(model, name)model:
hashname:
stringornil
Example Usage
-- Example 1: Hiding All Interactions for specified Model
exports["is_interaction"]:hideModel(model)
-- Example 2: Hiding Interaction for specified Model
exports["is_interaction"]:hideModel(model, "testText")
-- Example 3: Showing All Interactions for specified Model
exports["is_interaction"]:showModel(model)
-- Example 4: Showing Interaction for specified Model
exports["is_interaction"]:showModel(model, "testText")Global Entities
The Interactions can only be invoked on the Client-Side!
Adding Global Entities
exports["is_interaction"]:addInteractionGlobal(name, select, data)exports["is_interaction"]:addTextGlobal(name, select, data)name:
stringselect:
"vehicle"or"ped"or"player"data:
tablehideSquare:
booleanornilcheckVisibility:
booleanornilshowInVehicle:
booleanornildistance:
numberornildistanceText:
numberorniloffset:
tableorniltext:
tablex:
numbery:
numberz:
number
target:
tablex:
numbery:
numberz:
number
bone:
numberorstringornilignoreModel:
indexed tablemodel:
hash
options:
tableoption:
indexed tablename:
stringornillabel:
stringornilicon:
stringornilkey:
stringornilduration:
numberornilonSelect:
functionornil
Example Usage
-- Example 1: Using Interaction
exports["is_interaction"]:addInteractionGlobal("testInteraction", "vehicle", {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
ignoreModel = {-295689028},
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
key = "E",
duration = 500,
onSelect = function(entity)
print("found "..entity)
end
},
}
})
-- Example 2: Using Text
exports["is_interaction"]:addTextGlobal("testText", "vehicle", {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
bone = nil,
ignoreModel = {-295689028},
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
},
}
})Removing Global Entities
exports["is_interaction"]:removeGlobal(select, name, option)select:
"vehicle"or"ped"or"player"name:
stringorniloption:
nameornil
Example Usage
-- Example 1: Removing All Interactions
exports["is_interaction"]:removeGlobal(select)
-- Example 2: Removing provided Interaction
exports["is_interaction"]:removeGlobal(select, "testText")
-- Example 3: Removing provided Interaction Option
exports["is_interaction"]:removeGlobal(select, "testText", "option1")Hiding/Showing Global Entities
exports["is_interaction"]:hideGlobal(select, name)exports["is_interaction"]:showGlobal(select, name)select:
"vehicle"or"ped"or"player"name:
stringornil
Example Usage
-- Example 1: Hiding All Interactions for specified Global Entities
exports["is_interaction"]:hideGlobal(select)
-- Example 2: Hiding Interaction for specified Global Entities
exports["is_interaction"]:hideGlobal(select, "testText")
-- Example 3: Showing All Interactions for specified Global Entities
exports["is_interaction"]:showGlobal(select)
-- Example 4: Showing Interaction for specified Global Entities
exports["is_interaction"]:showGlobal(select, "testText")Coordinates
The Interactions can only be invoked on the Client-Side!
Adding Coordinates
exports["is_interaction"]:addInteractionCoords(name, coords, data)exports["is_interaction"]:addTextCoords(name, coords, data)name:
stringcoords:
vector3data:
tablehideSquare:
booleanornilcheckVisibility:
booleanornilshowInVehicle:
booleanornildistance:
numberornildistanceText:
numberorniloffset:
tableorniltext:
tablex:
numbery:
numberz:
number
target:
tablex:
numbery:
numberz:
number
options:
tableoption:
indexed tablename:
stringornillabel:
stringornilicon:
stringornilkey:
stringornilduration:
numberornilonSelect:
functionornil
Example Usage
-- Example 1: Using Interaction
exports["is_interaction"]:addInteractionCoords("testInteraction", coords, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
key = "E",
duration = 500,
onSelect = function()
print("option1 working")
end
},
}
})
-- Example 2: Using Text
exports["is_interaction"]:addTextCoords("testText", coords, {
hideSquare = false,
checkVisibility = true,
showInVehicle = false,
distance = 5.0,
distanceText = 1.0,
offset = {
text = {x = 0.0, y = 0.0, z = 1.0},
target = {x = 0.0, y = 0.0, z = 0.0}
},
options = {
{
name = "option1",
label = "Example Text",
icon = nil,
},
}
})Removing Coordinates
exports["is_interaction"]:removeCoords(coords, name, option)coords:
vector3name:
stringorniloption:
nameornil
Example Usage
-- Example 1: Removing All Interactions
exports["is_interaction"]:removeCoords(coords)
-- Example 2: Removing provided Interaction
exports["is_interaction"]:removeCoords(coords, "testText")
-- Example 3: Removing provided Interaction Option
exports["is_interaction"]:removeCoords(coords, "testText", "option1")Hiding/Showing Coordinates
exports["is_interaction"]:hideCoords(coords, name)exports["is_interaction"]:showCoords(coords, name)coords: vector3
name:
stringornil
Example Usage
-- Example 1: Hiding All Interactions at specified Coordinates
exports["is_interaction"]:hideCoords(coords)
-- Example 2: Hiding Interaction at specified Coordinates
exports["is_interaction"]:hideCoords(coords, "testText")
-- Example 3: Showing All Interactions at specified Coordinates
exports["is_interaction"]:showCoords(coords)
-- Example 4: Showing Interaction at specified Coordinates
exports["is_interaction"]:showCoords(coords, "testText")Misc
The Interactions can only be invoked on the Client-Side!
Removing Interactions Created By Resource
exports["is_interaction"]:removeResource(resource)resource:
stringornil
Example Usage
-- Example 1: Removing Interactions in specified resource
exports["is_interaction"]:removeResource("qb-shops")
-- Example 2: Removing Interactions in current resource
exports["is_interaction"]:removeResource()Last updated