01.10.2016, 17:42
Hi, the code below I made used to work before, but now it doesn't for some reason, I'm really confused because nothing seems to be wrong with it, and sometimes it works and stops working again when I add some new stuff. It's supposed to create a weapon object on you when you don't use the weapon. The WeaponCheck part doesn't work. It's a filterscript also.
Here's the code:
What's up?
Here's the code:
Код:
GetWeaponObjectSlot(weaponid) { new slot; switch (weaponid) { case 22..24: slot = 0; case 25..27: slot = 1; case 28, 29, 32: slot = 2; case 30, 31: slot = 3; case 33, 34: slot = 4; case 35..38: slot = 5; } return slot; } GetWeaponModel(weaponid) { new const WeaponModels[] = { 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, 0, 0, 0, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 368, 371 }; return WeaponModels[weaponid]; } forward WeaponCheck(playerid); public WeaponCheck(playerid) { new weapon[13], ammo[13], objectslot, weaponcount; for (new i; i <= 12; i++) { GetPlayerWeaponData(playerid, i, weapon[i], ammo[i]); if (weapon[i] && ammo[i]) { objectslot = GetWeaponObjectSlot(weapon[i]); if (GetPlayerWeapon(playerid) != weapon[i]) SetPlayerAttachedObject(playerid, objectslot, GetWeaponModel(weapon[i]), 1, -0.116999, -0.087999, -0.126999, -176.799987, 42.499992, 6.300001, 1.000000, 1.000000, 1.000000); else if (IsPlayerAttachedObjectSlotUsed(playerid, objectslot)) RemovePlayerAttachedObject(playerid, objectslot); } } }