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

metal_upa 01-24-2019 06:58

Re: CSO Costumes
 
The costumes are nice, but i don't think it a good idea to force server hoster to use cso player models. Let them decide to use what player model they want.

Smilex_Gamer 01-25-2019 07:19

Re: CSO Costumes
 
Its not forcing nobody to use it. You can deactivate your activated costumes and player models.

rtpg6 01-27-2019 05:43

Re: CSO Costumes
 
Cant wait for saving system! This idea is great man!

rtpg6 02-27-2019 04:49

Re: CSO Costumes
 
When i want to select costume its shutting down server. That`s too when im bought costume and round will change. its something with sql.
L 02/27/2019 - 10:49:11: [AMXX] Run time error 3: stack error
L 02/27/2019 - 10:49:11: [AMXX] [0] costumes.sma::Save_MySql (line 349)
L 02/27/2019 - 10:49:11: [AMXX] [1] costumes.sma::client_disconnect (line 385)
(its can be other lines for u because i remove the skins for ct and tr)

Smilex_Gamer 03-01-2019 15:48

Re: CSO Costumes
 
Quote:

Originally Posted by rtpg6 (Post 2641160)
When i want to select costume its shutting down server. That`s too when im bought costume and round will change. its something with sql.
L 02/27/2019 - 10:49:11: [AMXX] Run time error 3: stack error
L 02/27/2019 - 10:49:11: [AMXX] [0] costumes.sma::Save_MySql (line 349)
L 02/27/2019 - 10:49:11: [AMXX] [1] costumes.sma::client_disconnect (line 385)
(its can be other lines for u because i remove the skins for ct and tr)

Send me your .sma so I can help you.

Smilex_Gamer 03-04-2019 18:45

Re: CSO Costumes
 
1 Attachment(s)
Quote:

Originally Posted by rtpg6 (Post 2641938)
:)

First of all, don't post your private information inside the sma, you might get hacked so I recommend you to delete your post ASAP.
Second, I fixed your problem and already tested it. You forgot to precache the models and another little thing.

rtpg6 03-09-2019 04:43

Re: CSO Costumes
 
@Smilex_Gamer Can u add command to give H@ allow to give player money for buy costumes?
aand
L 03/09/2019 - 15:08:54: [AMXX] Displaying debug trace (plugin "costumes.amxx", version "1.1")
L 03/09/2019 - 15:08:54: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/09/2019 - 15:08:54: [AMXX] [0] costumes.sma::register_client (line 320)
its problem with
g_vars[id][g_cash] = SQL_ReadResult(Query, query); query++

Kempa 03-25-2019 17:29

Re: CSO Costumes
 
L 03/25/2019 - 23:17:40: [MySQL] Invalid column: 101
L 03/25/2019 - 23:17:40: [AMXX] Displaying debug trace (plugin "costumes.amxx", version "1.1")
L 03/25/2019 - 23:17:40: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/25/2019 - 23:17:40: [AMXX] [0] costumes.sma::register_client (line 370)


fix for that ?

Smilex_Gamer 03-26-2019 12:51

Re: CSO Costumes
 
Quote:

Originally Posted by Kempa (Post 2644908)
L 03/25/2019 - 23:17:40: [MySQL] Invalid column: 101
L 03/25/2019 - 23:17:40: [AMXX] Displaying debug trace (plugin "costumes.amxx", version "1.1")
L 03/25/2019 - 23:17:40: [AMXX] Run time error 10: native error (native "SQL_ReadResult")
L 03/25/2019 - 23:17:40: [AMXX] [0] costumes.sma::register_client (line 370)


fix for that ?

The error already tells what's wrong, the column is invalid. Maybe you changed something in the code on the function "register_client". If that's so, Im not going to support modifications of the code.

Kempa 03-26-2019 13:32

Re: CSO Costumes
 
Quote:

Originally Posted by Smilex_Gamer (Post 2644998)
The error already tells what's wrong, the column is invalid. Maybe you changed something in the code on the function "register_client". If that's so, Im not going to support modifications of the code.



I did not make any changes

download - compile - upload = error

Smilex_Gamer 03-26-2019 16:01

Re: CSO Costumes
 
Quote:

Originally Posted by Kempa (Post 2645001)
I did not make any changes

download - compile - upload = error

You downloaded from the main post or from the another sma that I provided to other guy in the posts? Because the another one I just made what he asked for, despite that now I wont support those.

Kempa 03-26-2019 17:16

Re: CSO Costumes
 
the main post, I tried to compile with the other versions of amxmodx the same problem. does not save cash / skins, etc

Smilex_Gamer 04-04-2019 18:00

Re: CSO Costumes
 
Quote:

Originally Posted by Kempa (Post 2645027)
the main post, I tried to compile with the other versions of amxmodx the same problem. does not save cash / skins, etc

I'm kinda busy, but I saw my code again and that line 370 in the sma of the main post it doesn't correspond with your line. You must have another sma, really.
EDIT: I am now testing the plugin again (sma from the main post) in mysql mode and it doesn't seem to have any problem really.

Smilex_Gamer 04-19-2019 20:46

Re: CSO Costumes
 
Update 1.5 (20/04/2019):

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

Smilex_Gamer 04-26-2019 12:34

Re: CSO Costumes
 
Update 1.6 (26/04/2019):

Added new Player Models and Costumes from CSO.

mousesports 04-30-2019 12:13

Re: CSO Costumes
 
How can i save on nick by nVault ? I see there is no cvar settings about

Smilex_Gamer 04-30-2019 15:21

Re: CSO Costumes
 
Quote:

Originally Posted by mousesports (Post 2649472)
How can i save on nick by nVault ? I see there is no cvar settings about

Only MySQL support is available due to a lack of knowledge of nVault, sorry... check PM, there I explained to you how you can use the MySQL support :)

Smilex_Gamer 07-10-2019 11:29

Re: CSO Costumes
 
Update 1.7 (10/07/2019):

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.

Smilex_Gamer 07-11-2019 21:02

Re: CSO Costumes
 
Update 1.8 (12/07/2019):

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

Smilex_Gamer 08-07-2019 05:34

Re: CSO Costumes
 
Update 1.9 (07/08/2019):

Corrected some CSO Costumes translations.

Smilex_Gamer 08-31-2019 21:08

Re: CSO Costumes
 
Update 2.0 (01/09/2019):

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

Smilex_Gamer 09-01-2019 11:59

Re: CSO Costumes
 
Update 2.1 (01/09/2019):

Small bug fix regarding model change in Player Spawn.

Smilex_Gamer 09-03-2019 13:02

Re: CSO Costumes
 
Update 2.2 (03/09/2019):

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

Smilex_Gamer 09-05-2019 18:50

Re: CSO Costumes
 
Update 2.3 (05/09/2019):

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

Smilex_Gamer 09-06-2019 20:44

Re: CSO Costumes
 
Update 2.4 (07/09/2019):

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).

Dexon 09-12-2019 12:04

Re: CSO Costumes v2.4
 
Dear @Smilex_Gamer.
Your awesome plugin not working for me. If the ZP Support undefined it works, but if I define the ZP Support it doesn't react to commands, etc... Using zp 4.3. Any fix?

Smilex_Gamer 09-12-2019 17:11

Re: CSO Costumes v2.4
 
Quote:

Originally Posted by Dexon (Post 2666766)
Dear @Smilex_Gamer.
Your awesome plugin not working for me. If the ZP Support undefined it works, but if I define the ZP Support it doesn't react to commands, etc... Using zp 4.3. Any fix?

Hmm that's odd. I'm going to test it right now and then I tell you if I got the same results.

P.S: I'm going to use AmxModX 1.8.2 and Zombie Plague 4.3 Fix 5a

Smilex_Gamer 09-12-2019 22:04

Re: CSO Costumes v2.4
 
Quote:

Originally Posted by Dexon (Post 2666766)
Dear @Smilex_Gamer.
Your awesome plugin not working for me. If the ZP Support undefined it works, but if I define the ZP Support it doesn't react to commands, etc... Using zp 4.3. Any fix?

Well, after some hours (yes, hours because I wasn't understanding the problem) I got the problem and fixed it. Firstly you'll need to have "cs_player_models_api" (include and plugin) in your server to work.
The reason why you don't have it originally with your Zombie Plague 4.3 is because only since Zombie Plague 5.0 until earlier versions (including the last version: Zombie Plague 5.0.8a) it didn't use that include and plugin, but now it uses. And one important thing that I didn't mention before: When I made the Zombie Plague Support (in version 1.5), I made it based on Zombie Plague 5.0.8a and I didn't test it in other versions like Zombie Plague 4.3 (my fault, sorry).
So, long story short, I added a new define called "ZP43_SUPPORT" in the line 13 to support Zombie Plague versions from ZP 4.3 to the very first version (at least I think it does, but now nobody uses versions before ZP 4.3 though). If your server uses those versions before 5.0, then uncomment it. If your ZP version is 5.0 or newer, then leave as it is and it will work fine.
Also, I'm going to leave here a link to "cs_player_models_api" include and plugin: https://forums.alliedmods.net/showthread.php?t=161255

P.S: I hope now everything is fine :D

Smilex_Gamer 09-12-2019 22:31

Re: CSO Costumes v2.5
 
Update 2.5 (13/09/2019):

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).

Dexon 09-13-2019 09:31

Re: CSO Costumes v2.5
 
Thank you so much. It works! Btw, I'm using ZP 4.3 only because there are so many great old plugins for 4.3 version, and 5.0 doesn't compatible with them, even with the compatible plugin.
But there is a big problem, for me. If I active a model, the server starts to create big lags. I don't even know why.

Malformed packet size (2782, 1230) => Console msg.


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

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