Thread
: [Solved]
CSS Knife can't be equipped with Command ?
View Single Post
xerox8521
Senior Member
Join Date: Sep 2011
12-20-2023 , 10:13 Re: CSS Knife can't be equipped with Command ?
#
2
You are passing a weapon id to EquipPlayerWeapon which requires an entity index of that weapon.
Your game crashes as it tries to equip a non weapon entity.
What you need is the return value of GetPlayerWeaponSlot(client, CS_SLOT_KNIFE) which you then can pass to EquipPlayerWeapon. Be sure to always check if GetPlayerWeaponSlot does
not
return -1 before attempting to use EquipPlayerWeapon.
xerox8521
View Public Profile
Send a private message to xerox8521
Find More Posts by xerox8521