SA-MP Forums Archive
[Help] AttachedObjects - 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: [Help] AttachedObjects (/showthread.php?tid=555328)



[Help] AttachedObjects - fatlirmorina - 07.01.2015

Hello there,

I've been using an attachedobject in my server when do I aim it don't remove,
I've searched here for a script which it can fix to remove it when I aim with Sniper or Rocker Launcher etc.

May someone help me to fix it?

I'm currlenty using the inculde attachedobjex

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (KEY_FIRE && IsPlayerAttachedObjectSlotUsed(playerid, 0))
{
ToggleRemoveNormAOWeaponZoom(playerid, 1);
}
return 1;
}

I've fixed it, but when do I stop aiming it don't comes back.

Can anyone reply here with the codes when I stop aim, to attachedobject to come back.
Please
Who helps me +rep.

Have a nice day.
#regards


Re: [Help] AttachedObjects - ZombieNest - 07.01.2015

Here you get, Try it so:
Add it in onplayerkeystatechange
Код:
if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE))
{
      if(IsPlayerAttachedObjectSlotUsed(playerid, 0))
      {
       //Here your code to add the object again
      }
}