[Help] AttachedObjects
#1

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
Reply
#2

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
      }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)