Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/05/20 in Posts

  1. The command&events decorators (@command, @commandable, @event, @eventable) Information Installation Disadvantages Examples Sources Event decorator 1. Information: There is a snippet which helps to registry any commands/events to Rage API with the simple interface by using decorators. Library: rage-decorators [github] [npm-package] If you're using typescript, make sure there two options (experimentalDecorators, emitDecoratorMetadata) are true in your tsconfig.json: { "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true }, } 2. Installation: Via npm: $ npm i --save rage-decorators Via yarn: $ yarn add rage-decorators 3. Disadvantages: Disadvantage 1: the snippet requires rage-decorators package 4. Examples: Simple example: My example of command list: 5. Source: Sources is now allowed on github repository and as npm package: https://github.com/READYTOMASSACRE/rage-decorators the source of decorators.ts (server-side only, for supporting events, client-side usage npm package) the source of decorators.js (server-side only, for supporting events, client-side usage npm package) 6. Event decorator: Event decorator is now avaliable in npm package, here an usaging example: import { eventable, event } from 'rage-decorators' @eventable() class Foo { @event("playerJoin") playerJoin(player: PlayerMp): void { console.log(`Player[${player.id}]${player.name} has joined to the server`) } }
    2 points
  2. This function aims to simplify mp.game.gameplay.displayOnscreenKeyboard usage by doing all the work for you and returning a promise. Options title: Title shown on the input box. Default: empty string defaultText: Default value of the input box. Default: empty string maxLength: Obvious enough, maximum length of the input. Default: 32 showMaxLength: If true, will display max length on title. Default: false trimResult: Removes whitespace from the player's input. Default: true rejectIfEmpty: If true, empty input causes promise rejection instead of resolving with an empty string. Default: true timeout: If higher than 0, input box will close & promise will be rejected with the reason "timeout" if the player fails to write something in specified milliseconds. Default: 0 Rejection reasons empty: When the player didn't write anything, needs rejectIfEmpty option to be true. cancelled: When the player closes the input box. keyboard_not_active: No idea on this one, it was in the native description so it's supported. timeout: When the player fails to write something in the specified time, needs timeout option to be set. Download The function and example is on GitHub Gist: https://gist.github.com/root-cause/5137a2b71c922bd24534462595b84a0f Notes - Needs RAGE Multiplayer 1.1 and above since it uses GXT API.
    1 point
  3. Guten Tag Wir suchen einen Scripter der Scripts selber schreiben sowie um schreiben kann. Preis ist verhandelbar. Zum Kontaktieren für Fragen etc Discord: Gizeh#9999 MfG Synthax
    1 point
×
×
  • Create New...