Add some JSDoc info for intellisense
This commit is contained in:
@@ -83,6 +83,10 @@ function showAnimationListCommand(command, params, client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {number} animationSlot - The slot index of the animation
|
||||
* @return {Array} The animation's data (array)
|
||||
*/
|
||||
function getAnimationData(animationSlot, gameId = getServerGame()) {
|
||||
return getGameData().animations[gameId][animationSlot];
|
||||
}
|
||||
|
||||
@@ -1506,6 +1506,10 @@ function getBusinessOwnerTypeText(ownerType) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {number} businessId - The data index of the business
|
||||
* @return {BusinessData} The business's data (class instance)
|
||||
*/
|
||||
function getBusinessData(businessId) {
|
||||
if(typeof getServerData().businesses[businessId] != null) {
|
||||
return getServerData().businesses[businessId];
|
||||
|
||||
@@ -887,6 +887,10 @@ function deleteClan(clanId) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {number} clanId - The data index of the clan
|
||||
* @return {ClanData} The clan's data (class instance)
|
||||
*/
|
||||
function getClanData(clanId) {
|
||||
if(typeof getServerData().clans[clanId] != null) {
|
||||
return getServerData().clans[clanId];
|
||||
|
||||
@@ -1116,6 +1116,10 @@ function isPlayerInAnyHouse(client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {number} houseIndex - The data index of the house
|
||||
* @return {HouseData} The house's data (class instance)
|
||||
*/
|
||||
function getHouseData(houseId) {
|
||||
if(typeof getServerData().houses[houseId] != "undefined") {
|
||||
return getServerData().houses[houseId];
|
||||
|
||||
@@ -8,13 +8,19 @@
|
||||
// ===========================================================================
|
||||
|
||||
function initNPCScript() {
|
||||
loadNPCsFromDatabase();
|
||||
getServerData().npcs = loadNPCsFromDatabase();
|
||||
setAllNPCDataIndexes();
|
||||
|
||||
spawnAllNPCs();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getNPCData(ped) {
|
||||
/**
|
||||
* @param {number} npcId - The data index of the NPC
|
||||
* @return {NPCData} The NPC's data (class instancee)
|
||||
*/
|
||||
function getNPCData(npcId) {
|
||||
return ped.getData("vrr.dataIndex");
|
||||
}
|
||||
|
||||
@@ -187,7 +193,14 @@ function spawnNPC(npcIndex) {
|
||||
let civilian = createGameCivilian(getNPCData(npcIndex).model, getNPCData(npcIndex).spawnPosition, getNPCData(npcIndex).spawnRotation);
|
||||
if(civilian) {
|
||||
civilian.setData("vrr.dataIndex", npcIndex);
|
||||
getNPCData(npcIndex).ped = civilian;
|
||||
}
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// ===========================================================================
|
||||
|
||||
function spawnAllNPCs() {
|
||||
for(let i in getServerData().npcs) {
|
||||
spawnNPC(npcIndex);
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,10 @@ function getGameAreas(gameId) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {Client} client - The client
|
||||
* @return {ClientData} The player/client's data (class instancee)
|
||||
*/
|
||||
function getPlayerData(client) {
|
||||
if(client != null) {
|
||||
return getServerData().clients[client.index];
|
||||
|
||||
@@ -189,6 +189,10 @@ function spawnAllVehicles() {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
/**
|
||||
* @param {Vehicle} vehicle - The vehicle element
|
||||
* @return {VehicleData} The vehicles's data (class instance)
|
||||
*/
|
||||
function getVehicleData(vehicle) {
|
||||
if(isVehicleObject(vehicle)) {
|
||||
let dataIndex = getEntityData(vehicle, "vrr.dataSlot");
|
||||
|
||||
Reference in New Issue
Block a user