Raised This Month: $12 Target: $400
 3% 

CSO Costumes v4.0


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff       
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 - 1372 views - 67.0 KB)
File Type: ini costumes.ini (22.6 KB, 826 views)
File Type: txt cso_costumes.txt (13.4 KB, 748 views)

Last edited by Smilex_Gamer; 12-19-2020 at 18:59.
Smilex_Gamer is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 01-12-2019 , 05:40   Re: CSO Costumes
Reply With Quote #2

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.
__________________
eat1k is offline
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-12-2019 , 08:32   Re: CSO Costumes
Reply With Quote #3

Quote:
Originally Posted by eat1k View Post
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.
Smilex_Gamer is offline
eat1k
Senior Member
Join Date: Apr 2018
Old 01-12-2019 , 09:23   Re: CSO Costumes
Reply With Quote #4

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] = 
__________________

Last edited by eat1k; 01-12-2019 at 09:23.
eat1k is offline
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-12-2019 , 10:21   Re: CSO Costumes
Reply With Quote #5

That's already in the TODO list but thanks. I gotta test that.
Smilex_Gamer is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-13-2019 , 06:32   Re: CSO Costumes
Reply With Quote #6

That's a bit OP. 80MB+ it's way too much, nor the idea is great.
__________________
Relaxing is offline
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-13-2019 , 08:01   Re: CSO Costumes
Reply With Quote #7

Quote:
Originally Posted by Relaxing View Post
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
Still it's something for fun stuff, it isn't a masterpiece
Smilex_Gamer is offline
ArslanLatif20
New Member
Join Date: Jan 2019
Old 01-14-2019 , 14:49   Re: CSO Costumes
Reply With Quote #8

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.
__________________
ArslanLatif20 is offline
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 01-14-2019 , 19:57   Re: CSO Costumes
Reply With Quote #9

Quote:
Originally Posted by ArslanLatif20 View Post
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..
Smilex_Gamer is offline
Shoko
New Member
Join Date: Feb 2022
Location: Argentina
Old 02-11-2022 , 18:40   Re: CSO Costumes
Reply With Quote #10

Quote:
Originally Posted by Smilex_Gamer View Post
Yeah just for costumization..
hello, you know why I install the plugin in the same way you describe it, but when I start a map, the game crashes. it closes without leaving any error message.
can this be used on maps with bots? because I need it for that, or is it only for ZP MOD?
can you give me an answer?
Shoko is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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