PDA

View Full Version : [Help] AttachedObjects


fatlirmorina
07/01/2015, 02:30 PM
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

ZombieNest
07/01/2015, 02:45 PM
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
}
}