CMD:trolley(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 2831.6045,2442.6086,1786.4811))
{
SendClientMessage(playerid, -1, "{FFCC33} Type again /trolley to eliminate it. ");
SetPlayerAttachedObject(playerid, 1, 1349, 1, 0.000000, -0.100000, 0.000000, 3.000000, 90.000000, 1.000000, 1.000000, 1.000000, 1.000000);
}
}
change coordinates manually
or with this https://sampwiki.blast.hk/wiki/EditAttachedObject |
You have to attach it not to the hand, you have to attach it to the spine (index 1 at the 4th parameter(bone))
Oh, I'm sorry, you have been already did it, you have to try any attachment editor. |
cmd:Command(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 2831.6045,2442.6086,1786.4811))
{
SendClientMessage(playerid, -1, "{FFCC33} Use /command again to disable it. ");
SetPlayerAttachedObject(playerid, 0, 1349, 1);
EditAttachedObject(playerid, 0);
}
if(IsPlayerAttachedObjectSlotUsed(playerid, 0)
{
RemovePlayerAttachedObject(playerid, 0);
}
}
CMD:trolley(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,2.0, 2831.6045,2442.6086,1786.4811))
{
if(!IsPlayerAttachedObjectSlotUsed(playerid, 1)) //It checks if the object isn't (! symbol) attached to the player
{
SendClientMessage(playerid, -1, "{FFCC33} Type again /trolley to eliminate it. ");
SetPlayerAttachedObject(playerid, 0, 1349, 1);
EditAttachedObject(playerid, 0);
}
else
{
RemovePlayerAttachedObject(playerid, 1);//It removes the object
}
}
return 1;
}