SA-MP Forums Archive
Armed Body - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Armed Body (/showthread.php?tid=611863)



Armed Body - GoldenLion - 11.07.2016

Hi, I'm using that armed body filterscript by yezizhu.
I've made it like that all weapons will use player attached object slot 6, but the weapon objects aren't appearing anymore. It's good if every weapon has a different attached object slot, but I don't want it like that because I want to use the attached object slots for something else.
Here's the code:
Код:
public OnPlayerUpdate(playerid)
{
	if(GetTickCount() - Weapons_pTick[playerid] > 113){
		new
			weaponid[13],weaponammo[13],pArmedWeapon;
			
		pArmedWeapon = GetPlayerWeapon(playerid);
		GetPlayerWeaponData(playerid,3,weaponid[3],weaponammo[3]);
		GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]);
		GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]);
		GetPlayerWeaponData(playerid,6,weaponid[6],weaponammo[6]);
		if(weaponid[3] && weaponammo[3] > 0){
			if(pArmedWeapon != weaponid[3]){
				if(!IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					SetPlayerAttachedObject(playerid, 6, GetOnBodyGunModel(weaponid[3]),1, -0.116999, -0.087999, -0.126999, -176.799987, 42.499992, 6.300001, 1.000000, 1.000000, 1.000000);
				}
			}
			else {
				if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					RemovePlayerAttachedObject(playerid, 6);
				}
			}
		}
		else if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
			RemovePlayerAttachedObject(playerid, 6);
		}
		if(weaponid[4] && weaponammo[4] > 0){
			if(pArmedWeapon != weaponid[4]){
				if(!IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					SetPlayerAttachedObject(playerid, 6, GetOnBodyGunModel(weaponid[4]),7, 0.000000, -0.100000, -0.080000, -95.000000, -10.000000, 0.000000, 1.000000, 1.000000, 1.000000);
				}
			}
			else {
				if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					RemovePlayerAttachedObject(playerid, 6);
				}
			}
		}
		else if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
			RemovePlayerAttachedObject(playerid, 6);
		}
		if(weaponid[5] && weaponammo[5] > 0){
			if(pArmedWeapon != weaponid[5]){
				if(!IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					SetPlayerAttachedObject(playerid, 6, GetOnBodyGunModel(weaponid[5]),1, -0.147999, -0.163000, 0.048999, 0.000000, 31.199996, 5.599999, 1.000000, 1.000000, 1.000000);
				}
			}
			else {
				if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					RemovePlayerAttachedObject(playerid, 6);
				}
			}
		}
		else if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
			RemovePlayerAttachedObject(playerid, 6);
		}
		if(weaponid[6] && weaponammo[6] > 0){
			if(pArmedWeapon != weaponid[6]){
				if(!IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					SetPlayerAttachedObject(playerid, 6, GetOnBodyGunModel(weaponid[6]),1, -0.231000, -0.121000, 0.008000, -173.500167, -0.799997, 4.800000, 1.000000, 1.000000, 1.000000);
				}
			}
			else {
				if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
					RemovePlayerAttachedObject(playerid, 6);
				}
			}
		}
		else if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
			RemovePlayerAttachedObject(playerid, 6);
		}
		Weapons_pTick[playerid] = GetTickCount();
	}



Re: Armed Body - GoldenLion - 11.07.2016

Oh, I will remove
Код:
		else if(IsPlayerAttachedObjectSlotUsed(playerid, 6)){
			RemovePlayerAttachedObject(playerid, 6);
		}
I don't know why am I asking for help if I can solve it myself. :P