Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS: Player API #43

Open
JJL772 opened this issue Sep 16, 2022 · 0 comments
Open

JS: Player API #43

JJL772 opened this issue Sep 16, 2022 · 0 comments
Labels
Area: C++ Backend Related to C++ backend code that isn't open source JS API JS API extensions - Requires work by programmers

Comments

@JJL772
Copy link
Member

JJL772 commented Sep 16, 2022

Motivation

A generic player API needs to be provided so we can create health, suit and other HUD elements.

API

  • float GetHealth() - Returns the current health of the player
  • float GetMaxHealth() - Returns the max health of the player
  • int GetTeamIndex() - Returns the team index of the player
  • string GetVehicle() - Returns the vehicle the player is currently in or null

Events

PlayerDamanged(int newHealth, int prevHealth, int dmgBits)
PlayerHealed(int newHealth, int prevHealth)

PlayerKilled()
PlayerSpawn()

PlayerSwitchedTeam(int newTeam, int oldTeam)

PlayerEnteredVehicle(string vehicleClass)
PlayerExitedVehicle(string vehicleClass)

Enums

Expose damage bits as enum

@JJL772 JJL772 added the JS API JS API extensions - Requires work by programmers label Sep 16, 2022
@JJL772 JJL772 added the Area: C++ Backend Related to C++ backend code that isn't open source label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C++ Backend Related to C++ backend code that isn't open source JS API JS API extensions - Requires work by programmers
Projects
None yet
Development

No branches or pull requests

1 participant