Usage
five-pedmanager Usage
Create Ped Export
Export
exports['five-pedmanager']:createPed(uniquename, pedmodel, vector4, freeze, invincible, animDict, animName)Parameters
Parameters
uniquename: (string) A unique identifier for the ped. This name is used to reference the ped in other functions.pedmodel: (string) The model name of the ped to be created. This should be a valid ped model string from GTA V (e.g.,a_m_m_farmer_01for a male farmer).vector4: (vector4) The position and heading where the ped will be spawned. Thevector4includes the x, y, z coordinates and the heading (rotation).freeze: (boolean) Determines whether the ped's position should be frozen, preventing it from moving.invincible: (boolean) If set totrue, the ped will be invincible, meaning it cannot be harmed or killed.animDict: (string) The animation dictionary to be used for the ped. This is a collection of animations in GTA V that the ped can perform.animName: (string) The specific animation name from theanimDictthat the ped will perform.return: (boolean)
Example Usage
local ped = exports['five-pedmanager']:createPed(
'farmer_1',
'a_m_m_farmer_01',
vector4(122.2, 97.2, 81.43, 180),
true,
true,
'amb@world_human_hang_out_street@male_a@idle_a',
'idle_a'
)Notes
Ensure that the
pedmodelandanimDict/animNameare valid strings, as incorrect values may cause errors or the ped not to spawn.The
freezeandinvincibleoptions are useful for creating static NPCs that serve specific roles, such as shopkeepers or mission giver
Freeze Ped Export
Export
Parameters
Parameters
uniquename: (string) The unique identifier of the ped that you want to freeze or unfreeze. This name should match the one used when creating the ped with thecreatePedfunction.freeze: (boolean) A boolean value that determines whether the ped should be frozen or not.true: The ped will be frozen in place, unable to move.false: The ped will be unfrozen, allowing it to move freely.
Example Usage
Notes
The
uniquenamemust correspond to a ped that has already been created using thecreatePedfunction. If the name is incorrect or does not match any existing peds, the function will not have any effect.This function is particularly useful for scenarios where the behavior of an NPC needs to change dynamically, such as making an NPC start moving after a specific event triggers.
Ped Dress Up Export
Export
Parameters
Parameters
uniquename: (string) The unique identifier of the ped you want to dress up. This name should match the one used when creating the ped with thecreatePedfunction.componentId: (integer) The ID of the component you want to change. Components represent different parts of the ped's outfit or appearance (e.g., torso, legs, shoes). Each component has a specific ID:0: Head1: Mask2: Hair3: Torso4: Legs5: Hands6: Shoes7: Accessories8: Undershirt9: Body Armor10: Decals11: Tops
drawableId: (integer) The ID of the drawable (specific model) to be applied to the selected component. This determines the specific item or appearance for that component.textureId: (integer) The ID of the texture to be applied to the drawable. Textures can change the color or pattern of the drawable. Setting this to0usually applies the default texture.
Example Usage
Notes
The
uniquenamemust correspond to a ped that has already been created using thecreatePedfunction.Ensure that the
componentId,drawableId, andtextureIdvalues are valid for the ped model you are customizing. Incorrect values may result in no visible change or unexpected appearance.This function is particularly useful for giving peds a specific look, which can be important for role-playing scenarios, missions, or thematic environments in your server.
Ped Emote Export
Export
Parameters
Parameters
uniquename: (string) The unique identifier of the ped that you want to perform the emote. This name should match the one used when creating the ped with thecreatePedfunction.animDict: (string) The animation dictionary that contains the emote or animation you want the ped to perform. This is a collection of animations in GTA V that the ped can perform.animName: (string) The specific name of the animation within theanimDictthat you want the ped to perform.
Example Usage
Notes
The
uniquenamemust correspond to a ped that has already been created using thecreatePedfunction.Ensure that the
animDictandanimNameare valid and correspond to an existing animation in GTA V. If the values are incorrect, the ped will not perform the animation.This function is particularly useful for creating immersive environments where NPCs are engaged in specific activities, enhancing the realism of your server.
Get Ped Emote Export
Export
Parameters
Parameters
uniquename: (string) The unique identifier of the ped whose animation you want to retrieve. This name should match the one used when creating the ped with thecreatePedfunction.anim: (string) The name of the animation you want to check or retrieve. This parameter allows you to specify which animation to query for the ped.
Return Value
pedanim: (string) The function returns the current animation name if the ped is performing the specified animation. If the ped is not performing the animation, it may returnnilor another indicative value.
Example Usage
Notes
The
uniquenamemust correspond to a ped that has already been created using thecreatePedfunction.The
animparameter should be a valid animation name that corresponds to the animations available to the ped.This function is particularly useful in scenarios where the behavior of an NPC is dependent on its current animation state, such as conditional actions or interaction triggers.
Last updated
Was this helpful?