multitheftauto / mtasa-resources

This project maintains a list of up-to-date resources that come with Multi Theft Auto.
https://multitheftauto.com
MIT License
151 stars 149 forks source link

admin2: added missing set nick functionality #425

Closed Dark-Dragon closed 1 year ago

Dark-Dragon commented 1 year ago

"Set nick" was previously missing any form of functionality beyond opening an input box. This pull request fixes that.

The input box will now correctly default to the current nick of the target player.

aFunction now has a "setnick" function associated in the player section that will change the target player's name as you would expect.

The messages.xml file was updated to include texts for the target player, the admin and the server log upon use. The color values were taken directly from admin1.

Additionally the two neighboring functions "sethealth" and "setarmour" received a minor fix, so that they now accept 0 as the lowest valid input and "sethealth" will no longer display an unintended message when the admin provides a non-number input. If undesired, the other commit can be cherry-picked to keep the current behavior.