Im back, reporting in for the people in search of a solution i was missing.
The usermessage 63 refers to trades, 61 refers to case openings.
When in the usermessage, the protobuf looks like this
https://github.com/alliedmodders/hl2...ges.proto#L341
entindex is thie clientid, you need to read the iteminfo protbuf though
https://github.com/alliedmodders/hl2...ges.proto#L307
which then contains all infos you need. If you want to get the basic informations its as follows
"quality" refers to stattrak or not. 4 means normal, 9 means stattrak
"defindex" is the index you can read from the kv file "scripts/items/items_game.txt" when navigating into "items"
"paintindex" refers to the index you can read from the same kv file when navigating into "paint_kits", which contains the tag of the camo name, which you then again can find in the language file.
Now comes the tricky part, if you want to get the wear of the skin from the usermessage, you need to check the field "paintwear". This is a integer which, probably, reaches from 1000000000 to 2000000000. I traded a lot of skins back and forth with friends and estimated the boundaries as follows:
Code:
new String:wearString[64];
if(camowear<1035000001){
wearString = "Factory New";
}else if(camowear<1042000001){
wearString = "Minimal Wear";
}else if(camowear<1052900001){
wearString = "Field-Tested";
}else if(camowear<1055000001){
wearString = "Well-Worn";
}else{
wearString = "Battle-Scarred";
}
The pool of data i used for estimation:
http://i.imgur.com/WmnJsNC.png
I hope i never have to do such stuff ever again. All of this because good old gabe never actually finishes his shit.
Also, if you want "Pretty" weapon names, which you also need when trying to request the market price of an item, here's the edited list which you can use instead of the items_game kv file
Code:
public String:Weapons[64][64] = {"PH", "Desert Eagle", "Dual Berettas", "Five-SeveN", "Glock-18", "",
"", "AK-47", "AUG", "AWP", "Famas",
"G3SG1", "", "Galil AR", "M249", "",
"M4A4", "MAC-10", "", "P90", "",
"", "", "", "UMP-45", "XM1014",
"PP-Bizon", "MAG-7", "Negev", "Sawed-Off", "Tec-9",
"Taser", "P2000", "MP7", "MP9", "Nova",
"P250", "", "SCAR-20", "SG556", "SSG 08",
"", "Knife", "Flashbang", "HE-Grenade", "Smoke-Grenade",
"Molotov", "Decoy", "Incindiary", "C4", "",
"", "", "", "", "",
"", "", "", "", "M4A1-S",
"USP-S", "", "CZ75-Auto"};
Edit1:
About the pretty weapon names, it goes further, forgot the knives.
Code:
if(defindex == 500) {
weaponName = "★ Bayonet";
}else if(defindex == 505) {
weaponName = "★ Flip Knife";
}else if(defindex == 506) {
weaponName = "★ Gut Knife";
}else if(defindex == 507) {
weaponName = "★ Karambit";
}else if(defindex == 508) {
weaponName = "★ M9 Bayonet";
}else if(defindex == 509) {
weaponName = "★ Huntsman Knife";
}else if(defindex == 515) {
weaponName = "★ Butterfly Knife";
}else{
weaponName = Weapons[defindex];
}
Edit2:
Found out that quality 4,9, and 12 exist, 12 refers to souvenir