Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: why the knife is set as invalid index with rg_get_weapon_info? #29

Closed
ivanmaxlogiudice opened this issue Oct 31, 2016 · 1 comment
Labels

Comments

@ivanmaxlogiudice
Copy link
Contributor

Line: https://github.com/s1lentq/reapi/blob/master/reapi/src/reapi_utils.h#L137

I notice this, because this gives me an error with the WEAPON_KNIFE

for (new WeaponIdType: iWeaponID = WEAPON_P228, szName[32]; iWeaponID <= WEAPON_P90; iWeaponID++)
	{
		/* Ignore invalid weapons */
		if (iWeaponID == WEAPON_GLOCK || iWeaponID == WEAPON_C4) continue;

		/* Get the weapon name */
		rg_get_weapon_info(iWeaponID, WI_NAME, szName, charsmax(szName));

		/* Hook the weapon deploy */
		RegisterHam(Ham_Item_Deploy, szName, "fw_Item_Deploy_Post", true);
	}
@ivanmaxlogiudice
Copy link
Contributor Author

https://github.com/s1lentq/reapi/blob/master/reapi/src/natives/natives_misc.cpp#L664
adding:

& weaponID != WEAPON_KNIFE

should be fine, right?

We can get the knife info, but can't modify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants