Functions | Usage
CreatePedDialog / Create
exports['sx-advanced-ped-dialog']:Create(options, callback)interface PedOptions {
ped_model: string;
ped_name: string;
ped_group?: string;
interaction?: {
useKeyInteractions: boolean;
showLabelOverHead: boolean;
distCanInteract: number; // float
distShowLabel: number; // float
textOverHead?: string;
interactionText?: string;
};
cam: {
enabled: boolean;
offset?: vector3;
fov?: number; // float
pointZOffset?: number; // float
};
pos: {
coords: vector3,
heading: number; // float
};
blip?: {
sprite: number;
color: number;
scale: number; // float
name: string;
shortRange: boolean;
},
animations: {
idleAnim?: {
dict?: string;
name?: string;
scenario?: string;
};
openAnim?: {
dict?: string;
name?: string;
scenario?: string;
// If you don't specify duration animation will be cancelled when player closes menu.
duration?: number; // In miliseconds
};
closeAnim?: {
dict?: string;
name?: string;
scenario?: string;
// Specify duration when to reset back to idle animation
duration: number;
};
};
menus?: {
regular?: {
[key: string]: RegularMenu;
},
dynamic?: {
[globally_unique_key: string]: DynamicMenu;
}
};
// Will be explained below
dialog?: (create: Function, close: Function) => void;
}
interface RegularMenu {
type: 'buy' | 'sell',
// If not specified, title will be peds name.
title?: string;
description?: string;
moneyType?: string; // This value will be passed to add/remove/has money function.
items: {
{
name: string;
price: number;
// In case when your image is not [name].[default_extension]
image?: string;
// If you're using fetchItems you don't have to specify it.
label?: string;
}[]
}
}
interface DynamicMenu {
type: 'buy' | 'sell';
// If not specified, title will be peds name.
title?: string;
description?: string;
moneyType?: string; // This value will be passed to add/remove/has money function.
items: {
{
name: string;
// You can define it if you're not planning that this item price will change.
price?: number;
// In case when your image is not [name].[default_extension]
image?: string;
// If you're using fetchItems you don't have to specify it.
label?: string;
}[]
}
}Dialog Function
Adding Sound
Menus
RemovePedDialog / Remove
OpenDialogMenu / Open
CloseMenu / Close
Action event
Last updated