AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   CSO Costumes v4.0 (https://forums.alliedmods.net/showthread.php?t=313496)

Smilex_Gamer 01-11-2019 18:59

CSO Costumes v4.0
 
3 Attachment(s)
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:

eat1k 01-12-2019 05:40

Re: CSO Costumes
 
I think it would be greater if you would do a config for all this, where you can specify the category (head, pelvis...), name, price, submodel. Also, it would be great to add a CVar that disables categories, i.e., you add costumes/hats/etc... without categories to the menu.

Smilex_Gamer 01-12-2019 08:32

Re: CSO Costumes
 
Quote:

Originally Posted by eat1k (Post 2634281)
I think it would be greater if you would do a config for all this, where you can specify the category (head, pelvis...), name, price, submodel. Also, it would be great to add a CVar that disables categories, i.e., you add costumes/hats/etc... without categories to the menu.

Sorry could you be more specific? I didn't quite understand it.

eat1k 01-12-2019 09:23

Re: CSO Costumes
 
I mean remove all the hardcode from plugin so people will be able to add costumes from config file (for example /amxmodx/configs/costumes.ini". Something like this:
PHP Code:

"category number" "name" "price" "submodel" // that will be number 1 in the menu of the specified category
"category number" "name" "price" "submodel" // that will be number 2 in the menu of the specified category (if the first was in category 1 and this one too, so it will be number 2) 

Regarding the CVar, if we disable the categories so it will be something like this:
PHP Code:

"name" "price" "submodel" // that will be number 1 in the main menu
"name" "price" "submodel" // that will be number 2 in the main menu 

To sum up, remove the hardcode:
PHP Code:

new const Costumes_SkinCT[][Vars] =
new const 
Costumes_SkinTR[][Vars] =
new const 
CostumeModels[][] =
new const 
Costumes_Head[][Vars2] =
new const 
Costumes_Back[][Vars2] =
new const 
Costumes_Pelvis[][Vars2] = 


Smilex_Gamer 01-12-2019 10:21

Re: CSO Costumes
 
That's already in the TODO list but thanks. I gotta test that.

Relaxing 01-13-2019 06:32

Re: CSO Costumes
 
That's a bit OP. 80MB+ it's way too much, nor the idea is great.

Smilex_Gamer 01-13-2019 08:01

Re: CSO Costumes
 
Quote:

Originally Posted by Relaxing (Post 2634443)
That's a bit OP. 80MB+ it's way too much, nor the idea is great.

Welp if someone could put all player models in one model it would reduce the size but I don't know how :P
Still it's something for fun stuff, it isn't a masterpiece

ArslanLatif20 01-14-2019 14:49

Re: CSO Costumes
 
Costumes serve with the only purpose as player decoration, which means they do not affect in any way the hit-boxes of the player. For each different costume sets, certain parts are required.For more Details.

Smilex_Gamer 01-14-2019 19:57

Re: CSO Costumes
 
Quote:

Originally Posted by ArslanLatif20 (Post 2634777)
Costumes serve with the only purpose as player decoration, which means they do not affect in any way the hit-boxes of the player. For each different costume sets, certain parts are required.For more Details.

Yeah just for costumization..

tarsisd2 01-15-2019 04:15

Re: CSO Costumes
 
some screenshots would be cool


All times are GMT -4. The time now is 19:40.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.