Nereziel / cs2-WeaponPaints

GNU General Public License v3.0
217 stars 55 forks source link

Skins arent saving #354

Open gatusocs opened 4 days ago

gatusocs commented 4 days ago

I don't know why but in my server, the knife and gloves aren't saving, instead the agent and coin are. Any idea?

Oneycs commented 3 days ago

Does the console give any errors when you equip knives etc.?

gatusocs commented 3 days ago

actually yes. Nov 12 20:39:27: [All Chat][gatuso.- (341379896)]: !knife Nov 12 20:39:27: L 11/12/2024 - 20:39:27: "gatuso.-<2><[U:1:341379896]>" say "!knife" Nov 12 20:39:28: [WeaponPaints] Error syncing knife to database: Unknown column 'weapon_team' in 'field list'

gatusocs commented 3 days ago

There are errors when entering the server. Nov 12 20:42:49: [WeaponPaints] An error occurred in GetKnifeFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 12 20:42:49: [WeaponPaints] An error occurred in GetGlovesFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 12 20:42:49: [WeaponPaints] An error occurred in GetMusicFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 12 20:42:49: [WeaponPaints] An error occurred in GetWeaponPaintsFromDatabase: Unknown column 'weapon_team' in 'order clause'

Oneycs commented 3 days ago

You have to add columns to your database.


ALTER TABLE wp_player_skins
ADD COLUMN weapon_nametag VARCHAR(128) DEFAULT NULL,
ADD COLUMN weapon_stattrak tinyint(1) NOT NULL,
ADD COLUMN weapon_stattrak_count int(10) NOT NULL,
ADD COLUMN weapon_sticker_0 VARCHAR(128) DEFAULT '0;0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
ADD COLUMN weapon_sticker_1 VARCHAR(128) DEFAULT '0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
ADD COLUMN weapon_sticker_2 VARCHAR(128) DEFAULT '0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
ADD COLUMN weapon_sticker_3 VARCHAR(128) DEFAULT '0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
ADD COLUMN weapon_sticker_4 VARCHAR(128) DEFAULT '0;0;0;0;0;0' COMMENT 'id;schema;x;y;wear;scale;rotation',
ADD COLUMN weapon_keychain VARCHAR(128) DEFAULT '0;0;0;0;0' COMMENT 'id;x;y;z;seed';```
gatusocs commented 2 days ago

Sorry, Where is "field list"? Where I should put that?

Oneycs commented 2 days ago

Field list is in your Database. In your config you have set a database. You have to add the columns there.

gatusocs commented 2 days ago

I already did it but the problem persists Nov 14 00:52:32: L 11/14/2024 - 00:52:32: "gatuso.-<2><[U:1:341379896]>" say "!wp" Nov 14 00:52:32: [WeaponPaints] An error occurred in GetKnifeFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 14 00:52:32: [WeaponPaints] An error occurred in GetGlovesFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 14 00:52:32: [WeaponPaints] An error occurred in GetMusicFromDatabase: Unknown column 'weapon_team' in 'field list' Nov 14 00:52:32: [WeaponPaints] An error occurred in GetWeaponPaintsFromDatabase: Unknown column 'weapon_team' in 'order clause' Nov 14 00:52:35: [Allies Chat][gatuso.- (341379896)]: !knife Nov 14 00:52:35: L 11/14/2024 - 00:52:35: "gatuso.-<2><[U:1:341379896]>" say_team "!knife" Nov 14 00:52:36: [WeaponPaints] Error syncing knife to database: Unknown column 'weapon_team' in 'field list'

gatusocs commented 2 days ago

I solved this by modifying and adding columns to the database, both for knives, gloves and music, these are the queries that worked for me:

ALTER TABLE wp_player_knife MODIFY COLUMN weapon_team INT NULL; UPDATE wp_player_knife SET weapon_team = 0 WHERE weapon_team IS NULL;

ALTER TABLE wp_player_gloves ADD COLUMN weapon_team INT(10) NOT NULL DEFAULT 0;

ALTER TABLE wp_player_music ADD COLUMN weapon_team INT(10) NOT NULL DEFAULT 0;

Thank you Oneycs