Skip to content

Commit

Permalink
Type Support
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuyk committed Jul 5, 2020
1 parent 366f309 commit 7ea9429
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
},
"type": "module",
"devDependencies": {
"@altv/types-client": "^1.1.0",
"@altv/types-server": "^1.2.0",
"prettier": "^1.18.2"
},
"prettier": {
Expand Down
2 changes: 1 addition & 1 deletion resources/example/client/panels/chat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-client';

alt.log(`Loaded: panels/chat`);

Expand Down
3 changes: 2 additions & 1 deletion resources/example/client/startup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as alt from 'alt';
/// <reference types="@altv/types-client" />
import alt from 'alt-client';
import * as native from 'natives';

import '/client/panels/chat';
Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/commands/vehicle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';
import { registerCmd } from '../systems/chat';
import { getForwardVectorServer } from '../utility/vector';

Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/events/playerConnect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';
import chalk from 'chalk';
import { randomPositionAround } from '../utility/vector';
import { DEFAULT_CONFIG } from '../configuration/config';
Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/events/playerDeath.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';
import chalk from 'chalk';
import { randomPositionAround } from '../utility/vector';
import { DEFAULT_CONFIG } from '../configuration/config';
Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/events/playerDisconnect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';
import chalk from 'chalk';

alt.log(chalk.greenBright('Loaded: events/playerDisconnect'));
Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/prototypes/player.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';

/**
* This is how you properly extend player functionality within the resource.
Expand Down
3 changes: 2 additions & 1 deletion resources/example/server/startup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as alt from 'alt';
/// <reference types="@altv/types-server" />
import alt from 'alt-server';
import chalk from 'chalk';

// alt:V Files to Load
Expand Down
2 changes: 1 addition & 1 deletion resources/example/server/systems/chat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import alt from 'alt';
import alt from 'alt-server';

let commands = {};

Expand Down
4 changes: 2 additions & 2 deletions resources/example/server/utility/vector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as alt from 'alt';
import alt from 'alt-server';

/**
* Get all players in a certain range of a position.
Expand All @@ -10,7 +10,7 @@ import * as alt from 'alt';
export function getPlayersInRange(pos, range, dimension = 0) {
if (pos === undefined || range === undefined) {
throw new Error('GetPlayersInRange => pos or range is undefined');
};
}

return alt.Player.all.filter(player => {
return player.dimension === dimension && distance2d(pos, player.pos) <= range;
Expand Down

0 comments on commit 7ea9429

Please sign in to comment.