View Single Post
Plugin Info:     Modification:          Category:         
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-11-2019 , 18:59   CSO Costumes v4.0
Reply With Quote #1

Description: This plugin allows you to buy and use costumes from Counter-Strike: Online/Counter-Strike Nexon: Studio (or CS:O/CSN:S) using the plugin's currency "Cash".

Features:
  • Many Player Models (90+ Player Models)
  • Many Costumes (All in 6 Models) (Head, Back and Pelvis)
  • You can see a preview of all costumes (MOTD showing an image of the costume)
  • Kill players to earn cash (Costumizable; see Configuration section for more info)
  • To add a new costume, simply follow the way it's done in "costumes.ini" (It has some comments in the file explaining it)
  • To remove a costume, simply put a semicolon (;) behind it or delete the line.
  • The plugin will disable the types of costumes that don't have costumes added in "costumes.ini"
  • To activate the nVault saving system, edit "SAVING_METHOD" value to 1 in "costumes.ini"
  • nVault's vault name is customizable (see Configuration section for more info)
  • To activate the MySQL saving system, edit "SAVING_METHOD" value to 2 in "costumes.ini"
  • MySQL credentials are customizable (see Configuration section for more info)
  • If the plugin cannot connect to your MySQL database, it will automatically change the saving system to nVault.
  • If the plugin fails to use nVault, it will continue without saving system.
  • To activate the Zombie Plague Mod Support, just uncomment "#define ZP_SUPPORT" in line 13 (you will need to edit the source code "costumes.sma" and then compile it locally)
  • To activate the Zombie Plague Mod 4.3 (or older) Support, edit "ZP43_SUPPORT" value to 1 in "costumes.ini" (You must have "#define ZP_SUPPORT" uncommented in the source code)
  • Multi-Lingual Support (check Translations section to see the current supported languages)

Configuration (costumes.ini):
Configuration


Commands:
Commands


Requirements:
Installation:
  1. Download all the attached files, [CS] Player Models API (thread url in "Requirements") and the resources (at the end of this post)
  2. Compile "cs_player_models_api.sma" locally or click "Get Plugin" in its post to get the .amxx file (https://forums.alliedmods.net/showthread.php?t=161255)
  3. Compile "costumes.sma" locally or click "Get Plugin" in this post to get the .amxx file
  4. Put "cs_player_models_api.amxx" in the plugins folder (addons/amxmodx/plugins/)
  5. Put "costumes.amxx" in the plugins folder (addons/amxmodx/plugins/)
  6. Write "cs_player_models_api.amxx" in the bottom of your "plugins.ini" in the configs folder (addons/amxmodx/configs/)
  7. Write "costumes.amxx" in the bottom of your "plugins.ini" in the configs folder (addons/amxmodx/configs/)
  8. Put "costumes.ini" in your configs folder (addons/amxmodx/configs/)
  9. Put "costumes.txt" in your lang folder (addons/amxmodx/data/lang/)
  10. Put the folder "player" and "costumes" from "resources.zip" in your models folder (cstrike/models/)
  11. If you want to add more costumes or to activate nVault/MySQL/Zombie Plague Mod/Zombie Plague Mod 4.3 (or older) Support, just read the first text (Features)

TODO List:
  • Add MySQL saving system [DONE]
  • Create a file to add new costumes easier [DONE]
  • Add Multi-Lingual Support [DONE]
  • Add Zombie Plague Mod Support [DONE]
  • Add a configuration file to make it easier to change cvars, activate/deactivate MySQL saving system, nVault saving system, ZP 4.3 Support, etc. (all configs will be in costumes.ini) [DONE]
  • Add nVault saving system (I'll try to understand that way of saving data and implement it in the plugin) [DONE]
  • If ZP_SUPPORT is defined in the source code, merge Skin CT and Skin TR in one section [DONE]
  • Add an option in the inventory to deactivate one type of costume one by one, adding an option "None" in the beginning of each section [DONE]
  • Add a way to transfer data from MySQL to nVault and vice-versa, so it's possible to switch saving system without losing any data

Change Logs:
Code:
1.0: First version.

1.1: Added MySQL saving system support.

1.2: Small fix & Added saving on MySQL at round end.

1.3: Added Multi-Lingual support and added new Player Models and Costumes.
I have a problem with 3 Back Costumes, so if somebody knows how to fix it, it is the "Phoenix Wings", "Laser Wing's Wings" and "Frozen Terror's Bat".

1.4: Fixed error "Invalid menu id".

1.5: Added Zombie Plague Mod Support and fixed error "Invalid column" in MySQL saving system.

1.6: Added new Player Models and Costumes from CSO.

1.7: Added more new Player Models and Costumes from CSO.
I still have that problem with 3 Back Costumes like in version 1.3 and now it appeared in another back costume called "Wings of Medea".
As I said before, if someone knows how to solve it, please PM me so I can upload it here.

1.8: Added more new Player Models and Costumes from CSO and fixed some bugs.

1.9: Corrected some CSO Costumes translations.

2.0: Removed all hardcoded costumes. Added a new way to add costumes (using an INI file).

2.1: Small bug fix regarding model change in Player Spawn.

2.2: Added a new console command to give Cash (only users with flag ADMIN_RCON can use it).

2.3: Added new Costumes from CSO (when it gets released in CSN:Z, I will verify the translations).

2.4: From now on, if any type of costume has no costumes in costumes.ini,
it will show a message in the chat saying that there are no costumes of that type of costume available in the moment (whenever you try to open your inventory or the shop of that type of costume, it will show that message).

2.5: Added a new define called "ZP43_SUPPORT" in the line 13 to support Zombie Plague versions since ZP 4.3 until the very first version (at least I think it does, but I didn't even test it and now nobody uses versions before ZP 4.3 though).
If your ZP version is 4.3 or older, then uncomment it and download (and install) cs_player_models_api here (you will need the include to compile my plugin and its plugin "cs_player_models_api.amxx" installed in your server).
If your ZP version is 5.0 or newer, then leave as it is and it will work fine (you still need to have "#define "ZP_SUPPORT" uncommented to support any Zombie Plague Mod version).

2.6: Replaced cs_set_user_model and cs_reset_user_model with cs_set_player_model and cs_reset_player_model from [CS] Player Models API (so when a server has many players, it doesn't crash). So from now on, this API is a basic requirement of the plugin.
[MySQL Related] Added a verification code to check if the player's current costume doesn't exist (eg. The total costumes on your server is 3 and a player's current costume number is 4, then the plugin will set it to 0 (no costume selected) to prevent errors from appearing).

2.7: [MySQL Related] Now the plugin will add a new column for each new costume added (to prevent errors from appearing), even if the table was already created. (I wanted to do this much earlier but I didn't know how to do it).

2.8: Added 8 old Player Models from CSO (4 SkinCT, 4 SkinTR).
[MySQL Related] Improved MySQL performance (faster connecting, saving and loading data).

2.9: Added 2 new Player Models and 2 new Costumes from CSO.
Corrected model bugs (actually it's still somehow bugged, but now it's better than before. There are only 6 Costumes that have this bug and all them are Back Costumes).
Fixed a bug that made the last costume (of any type of costume) being added twice.

3.0: Added a configuration in "costumes.ini" to make it easier to change cvars and activate/deactivate systems of this plugin.
Added 2 new Player Models and 6 new Costumes from CSO.
[MySQL Related] Fixed a bug where the plugin tried to save bot's data at round end (It showed an error in console whenever that happened).

3.1: Added nVault saving system.
Added a new configuration in "costumes.ini" called "VAULT" for nVault. See "Configuration" section for more info.
Added new translations (Thanks Snake. and Rivotril).
Fixed a model bug of a Pelvis type Costume.
Fixed a small bug about giving/taking cash using the console command "costumes_give_cash".

3.2: Merged Skin CT and Skin TR in one section when ZP_SUPPORT is defined in the source code.
Added an option in the inventory to deactivate one type of costume one by one, by adding an option "None" in the beginning of each section.
Improved the configuration system.
Added 2 new Player Models and 2 new Costumes (Head and Back) from CS:O.

3.3: Added 2 new Player Models and 8 new Costumes (Head and Pelvis) from CS:O.
Added new translations.
Corrected some Costumes' names.

3.4: Added 2 new Player Models and 2 new Costumes (Head) from CS:O.
Corrected a Costume's name.
Optimized the code.
Fixed some minor bugs.
Changed "client_putinserver" to "client_authorized" in order to get a valid SteamID from the player when loading data from nVault/MySQL.

3.5: Fixed saving/loading data in nVault and MySQL.

3.6: Added 6 new Costumes (Head, Back and Pelvis) from CS:O.
Stored get_maxplayers() in a variable so it isn't called several times at the end of each round.

3.7: Added a verification code to check if the player's current costume doesn't exist in nVault (I forgot to add this when I implemented nVault in the plugin).
Added a verification code to check if the file "costumes.ini" is missing.
Switched get_maxplayers() loop with get_players() in order to decrease native calls.
Cached if the player is a bot/hltv and if the player is connected to decrease native calls.
Optimized Load_Configuration() and Load_Costumes() code.
Hooked FM_Sys_Error, FM_GameShutdown and FM_ServerDeactivate to save data.
Removed unnecessary code.
Added new translations.

3.8: Optimized some code.
Removed some unnecessary code.
Added 6 new costumes (Head and Back) from CS:O.

3.9: Removed hardcoded array sizes (I'm 100% sure there isn't anything hardcoded now).
Corrected some Costumes' names.
Added 2 new Player Models from CS:O.
DruGzOG made a suggestion about uploading the preview images for people to host, so from now on I'll be putting those in the resources zip file.

4.0: Corrected a Costume's name.
Fixed some Back Costumes' models (although there are still some that I couldn't fix).
Added 2 new Player Models from CS:O.
Added 2 new Costumes (Head and Back) from CS:O.
Credits:
Credits


Translations: https://forums.alliedmods.net/showthread.php?p=2646616

Resources:
Attached Files
File Type: sma Get Plugin or Get Source (costumes.sma - 1395 views - 67.0 KB)
File Type: ini costumes.ini (22.6 KB, 839 views)
File Type: txt cso_costumes.txt (13.4 KB, 759 views)

Last edited by Smilex_Gamer; 12-19-2020 at 18:59.
Smilex_Gamer is offline