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

Solved CSWeapon_SHIELD is p90?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 02-13-2018 , 16:12   CSWeapon_SHIELD is p90?
Reply With Quote #1

Hi,

I'm wondering why CSWeapon_SHIELD is returning "p90", converting it to its alias.
Looping CSWeapon enum & filtering thru CS_IsValidWeaponID (in csgo)
this is the reply:
(alias - ID)
Code:
glock - 2
hegrenade - 4
xm1014 - 5
c4 - 6
mac10 - 7
aug - 8
smokegrenade - 9
elite - 10
fiveseven - 11
ump45 - 12
famas - 15
awp - 17
m249 - 19
m4a1 - 21
g3sg1 - 23
flashbang - 24
deagle - 25
ak47 - 27
knife - 28
p90 - 29
p90 - 30
kevlar - 31
assaultsuit - 32
nvg - 33
galilar - 34
bizon - 35
mag7 - 36
negev - 37
sawedoff - 38
tec9 - 39
taser - 40
hkp2000 - 41
mp7 - 42
mp9 - 43
nova - 44
p250 - 45
scar20 - 47
sg556 - 48
ssg08 - 49
knifegg - 50
molotov - 51
decoy - 52
incgrenade - 53
defuser - 54
And there are two "p90" the first one is the "right one" (CSWeaponID_P90), the other one is the shield.

Is this an error or what?
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!

Last edited by Papero; 02-14-2018 at 07:03.
Papero is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-13-2018 , 16:56   Re: CSWeapon_SHIELD is p90?
Reply With Quote #2

Can you post your code
Dr!fter is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 02-13-2018 , 17:10   Re: CSWeapon_SHIELD is p90?
Reply With Quote #3

Quote:
Originally Posted by Dr!fter View Post
Can you post your code
It was like this:
PHP Code:
    ArrayList WeaponArray = new ArrayList();
    for (
int i 0<= view_as<int>(CSWeaponID); i++)if (CS_IsValidWeaponID(view_as<CSWeaponID>(i)))
    {
        
WeaponArray.Push(i);
    }
    
    
char sWeapon[32];
    for (
int i 0WeaponArray.Lengthi++)
    {
        
CS_WeaponIDToAlias(view_as<CSWeaponID>(WeaponArray.Get(i)), sWeaponsizeof(sWeapon));
        
ReplyToCommand(client"%s - %i"sWeaponWeaponArray.Get(i));
    } 
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
Dr!fter
The Salt Boss
Join Date: Mar 2007
Old 02-13-2018 , 22:42   Re: CSWeapon_SHIELD is p90?
Reply With Quote #4

What version of sourcemod?

Edit: Im assuming its 1.8, this was probably fixed in 1.9 since 1.8 has lots of hacky fixes. This is the output on SM 1.9

PHP Code:
glock 2
hegrenade 
4
xm1014 
5
c4 
6
mac10 
7
aug 
8
smokegrenade 
9
elite 
10
fiveseven 
11
ump45 
12
famas 
15
awp 
17
m249 
19
m4a1 
21
g3sg1 
23
flashbang 
24
deagle 
25
ak47 
27
knife 
28
p90 
29
kevlar 
31
assaultsuit 
32
galilar 
34
bizon 
35
mag7 
36
negev 
37
sawedoff 
38
tec9 
39
taser 
40
hkp2000 
41
mp7 
42
mp9 
43
nova 
44
p250 
45
scar20 
47
sg556 
48
ssg08 
49
knifegg 
50
molotov 
51
decoy 
52
incgrenade 
53
defuser 
54
heavyassaultsuit 
55
cutters 
56
healthshot 
57
knife_t 
59
m4a1_silencer 
60
usp_silencer 
61
cz75a 
63
revolver 
64
tagrenade 
68
bayonet 
500
knife_flip 
505
knife_gut 
506
knife_karambit 
507
knife_m9_bayonet 
508
knife_tactical 
509
knife_falchion 
512
knife_survival_bowie 
514
knife_butterfly 
515
knife_push 
516 
IIRC there was also a flaw in how CS_IsValidWeaponID worked which now works correctly.

Last edited by Dr!fter; 02-13-2018 at 22:50.
Dr!fter is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 02-14-2018 , 04:12   Re: CSWeapon_SHIELD is p90?
Reply With Quote #5

Quote:
Originally Posted by Dr!fter View Post
What version of sourcemod?

Edit: Im assuming its 1.8, this was probably fixed in 1.9 since 1.8 has lots of hacky fixes. This is the output on SM 1.9

PHP Code:
glock 2
hegrenade 
4
xm1014 
5
c4 
6
mac10 
7
aug 
8
smokegrenade 
9
elite 
10
fiveseven 
11
ump45 
12
famas 
15
awp 
17
m249 
19
m4a1 
21
g3sg1 
23
flashbang 
24
deagle 
25
ak47 
27
knife 
28
p90 
29
kevlar 
31
assaultsuit 
32
galilar 
34
bizon 
35
mag7 
36
negev 
37
sawedoff 
38
tec9 
39
taser 
40
hkp2000 
41
mp7 
42
mp9 
43
nova 
44
p250 
45
scar20 
47
sg556 
48
ssg08 
49
knifegg 
50
molotov 
51
decoy 
52
incgrenade 
53
defuser 
54
heavyassaultsuit 
55
cutters 
56
healthshot 
57
knife_t 
59
m4a1_silencer 
60
usp_silencer 
61
cz75a 
63
revolver 
64
tagrenade 
68
bayonet 
500
knife_flip 
505
knife_gut 
506
knife_karambit 
507
knife_m9_bayonet 
508
knife_tactical 
509
knife_falchion 
512
knife_survival_bowie 
514
knife_butterfly 
515
knife_push 
516 
IIRC there was also a flaw in how CS_IsValidWeaponID worked which now works correctly.
Yeah I'm on 1.8
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
Reply



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 06:53.


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