Skip to content

Conversation

Addlibs
Copy link
Contributor

@Addlibs Addlibs commented Aug 6, 2018

All get functions accept only CPlayer except the following which take CElement but later restricted to player and console only (they returned somewhat useful info when console was passed, and some scripts may rely on this still being the case)

  • getPlayerName
  • getPlayerIP
  • getPlayerAccount

The following set/do functions changed to accept only players as they do not use RUN_CHILDREN internally but previously allowed for non-player elements

  • SetPlayerName
  • RedirectPlayer

The following set/do functions remain unchanged as they use RUN_CHILDREN thus should allow non-players elements as long as they have at least one child that is a player (unless that should change)

  • SetPlayerMoney
  • GivePlayerMoney
  • ShowPlayerHudComponent
  • TakePlayerScreenShot
  • SetPlayerWantedLevel
  • ForcePlayerMap
  • SetPlayerNametagText (not sure if its useful to run this on children)
  • SetPlayerNametagColor
  • SetPlayerNametagShowing
  • SetPlayerMuted
  • SetPlayerBlurLevel
  • PlaySoundFrontEnd
  • ShowCursor
  • ShowChat
  • PlayMissionAudio
  • PreloadMissionAudio

If there's anything that could be done better, let me know.

This PR closes #304

@patrikjuvonen patrikjuvonen added the bug Something isn't working label Aug 6, 2018
@patrikjuvonen patrikjuvonen added this to the 1.5.6 milestone Aug 6, 2018
@Pirulax
Copy link
Contributor

Pirulax commented Aug 7, 2018

Good to know that I can pass root instead of the player, but It's not mentioned on the Wiki

@qaisjp
Copy link
Contributor

qaisjp commented Aug 7, 2018 via email

@qaisjp qaisjp merged commit 6780fbd into multitheftauto:master Aug 10, 2018
@qaisjp
Copy link
Contributor

qaisjp commented Aug 10, 2018

Thank you! Good work 🙂

@Addlibs Addlibs deleted the issue-#304 branch April 2, 2020 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many player functions behave inconsistently when passing an invalid player element
4 participants