RockySouthpaw aebf496dbd Merge pull request #85 from Oldarorn/patch-2
Translation: Updated fr.json. Added translation for additional app names, added translation for notes app, and added translation date format.
2021-02-12 13:46:13 -05:00
2021-02-07 03:21:59 -05:00
2021-02-12 12:30:55 +01:00
2021-01-04 10:29:42 +01:00
2021-02-09 12:55:29 -05:00

New Phone Who Dis

Project Error Discord

Join the Discord to follow current development of the project.

Production Server Installation (WIP)

Database

New Phone Who Dis (NPWD) uses its own database driver compatible with mysql-async and ghmattimysql's connection string. If you don't utilize these resources, ensure you have this set in your console.

set mysql_connection_string "server=127.0.0.1;database=es_extended;userid=user;password=pass"

Configuration

This resource is highly configurable through the config.json. This JSON file holds configuration for the phone itself, for the apps running on it and peripheral information.

Below is the list of current configuration options (WIP):

Option Default Description
Locale en The language locale used by the app. See fivem keybinds for options
KeyTogglePhone 288 (F1) The keybind to open and close the app. See fivem keybinds for options
PhoneAsItem false whether or not the phone is an item in game
SwimDestroy false whether or not the phone will have a chance to be destroyed while swimming
RunRate 10 interval in seconds to check phone destruction
DestoryChance 100 Percent chance that phone destruction will occur
DestroyPhoneReCheck 3 Time in minutes before another phone destruction attempt will happen
notificationPosition.horizontal right Horizontal position of phone notifications. left, center or right
notificationPosition.vertical bottom Vertical positon of phone notifications. top or bottom
twitter.showNotifications true Whether or not to show twitter notifications
twitter.generateProfileNameFromUsers true Whether or not the server should automtically generate a player's profile name from their user in the database
twitter.allowEdtiableProfileName true Whether or not players can edit their profile name
twitter.allowDeleteTweets true Whether or not players can delete their own tweets
twitter.allowReportTweets true Whether or not players can report tweets. Optional discord integration.
twitter.characterLimit 160 Limit on how many characters tweets can contain
twitter.newLineLimit 10 Limit on how many new lines a message can contain
twitter.enableAvatars true Whether or not player's can select avatars for their twitter profile
twitter.enableEmojis true Whether or not player's can use emojis in tweets
twitter.enableImages true Whether or not player's can add images to tweets (external URLs)
twitter.maxImages 3 The maximum amount of images allowed in a tweet

Discord

To configure Discord integration; add the following variables to your server.cfg file:

set discord_bot_token "YOUR_DISCORD_BOT_TOKEN"
set discord_channel_id "YOUR_DISCORD_CHANNEL_ID"

Current Discord integrations with the phone (WIP):

  • Twitter: reporting tweets

Development

This resource is a React project with a TypeScript client/server environment.

Prerequisites

The Installation Steps assumes you have the following prerequisites:

  1. The ability to open a terminal. It's recomended, not required, to use Visual Studio Code or Windows Powershell for the sake of this guide to better provide support should issues arise.
  2. Git for windows installed
  3. LTS node.js installed
  4. yarn package manager installed (npm install -g yarn)
  5. A fivem environment that is set up according to the setting up a server instructions from the fivem documentation.

Installation Steps

  1. Clone the repo into your server-data/resources/ folder. The path will be server-data\resources\new-phone-who-dis. Don't clone the repo into a sub folder.
  2. Ensure the resource folder is named new-phone-who-dis.
  3. Import the sql file into your database.
  4. Add ensure new-phone-who-dis to your server.cfg.
  5. Make your configurations in the config.json before building the phone.
  6. Open a terminal with the program of your choice.
  7. Change your directiory into new-phone-who-dis\phone like so: cd A:\FXServer\server-data\resources\new-phone-who-dis\phone
  8. Install node dependencies with yarn install.
  9. Build in the current directory with yarn build.
  10. Change your directiory into new-phone-who-dis\resources like so: cd A:\FXServer\server-data\resources\new-phone-who-dis\resources
  11. Install node dependencies withyarn install.
  12. Build in the current directory with yarn build.
  13. Start your FiveM server

Development iteration cycle:

  • You must rebuild the resource following any changes by doing yarn build in the resources and phone folder.
  • If iteration on UI changes run the project with yarn watch which will monitor the JavaScript project and rebuild when you make code changes and then do ensure new-phone-who-dis after making your change.
  • Avoid commiting index.html as the development version overrides the production version

Important Note

  • By installing NPWD you agree to the use of the following diagnostic package, Sentry, (in use within the React portion of NPWD), that automatically uploads relevant sesssion details and stack traces whenever an exception is thrown. We use these metrics to further improve the quality of the phone. To explicitly disable this (we urge you not to as its incredibly useful metrics for us). Please change the SentryErrorMetrics setting to false in phone/config/default.json and rebuild the phone.

  • This resource has NOT been tested with esx_kashacter so compatability with it is unknown. For best results, use the resource on with no kash.

S
Description
NPWD is a FiveM phone resource written entirely in TypeScript and React. It is currently a WIP and is not ready for production use.
Readme
10 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 97.8%
JavaScript 1.2%
CSS 0.5%
Lua 0.4%