24.04.2012, 18:27
You can do something as this:
Should work, best regards!
pawn Код:
if(!strcmp(cmdtext, "/putgun", true))
{
//Your code, etc...
PutWeaponInTheBack(playerid, GetPlayerWeapon(playerid));
return 1;
}
//A function to do that easily:
stock PutWeaponInTheBack(playerid, gun)
{
if(gun == 2)
{
SetPlayerAttachedObject(playerid, 4,333,1,0.3,-0.1,0.1,0.0,230.0,0.0);
}
else if(gun == 3)
{
SetPlayerAttachedObject(playerid, 4,334,7,0.0,-0.0,-0.0,0.0,90.0,0.0);
}
else if(gun == 4)
{
SetPlayerAttachedObject(playerid, 4,335,7,0.0,-0.1,-0.1,0.0,90.0,90.0);
}
else if(gun == 5)
{
SetPlayerAttachedObject(playerid, 4,336,1,0.3,-0.1,0.1,0.0,230.0,0.0);
}
else if(gun == 7)
{
SetPlayerAttachedObject(playerid, 4,338,1,0.3,-0.1,0.1,0.0,230.0,0.0);
}
else if(gun == 8)
{
SetPlayerAttachedObject(playerid, 4,339,1,0.3,-0.1,0.1,0.0,230.0,0.0);
}
else if(gun == 10)
{
SetPlayerAttachedObject(playerid, 4,321,7,0.3,-0.0,-0.2,0.0,280.0,0.0);
}
else if(gun == 11)
{
SetPlayerAttachedObject(playerid, 4,322,7,0.2,-0.0,-0.0,0.0,90.0,0.0);
}
else if(gun == 12)
{
SetPlayerAttachedObject(playerid, 4,323,7,0.3,-0.0,-0.2,0.0,280.0,0.0);
}
else if(gun == 13)
{
SetPlayerAttachedObject(playerid, 4,324,7,0.2,-0.0,-0.0,0.0,90.0,0.0);
}
else if(gun == 15)
{
SetPlayerAttachedObject(playerid, 4,326,1,0.3,-0.1,0.1,0.0,230.0,0.0);
}
else if(gun == 16)
{
SetPlayerAttachedObject(playerid, 4,342,7,0.0,0.0,-0.1,0.0,270.0,0.0);
}
else if(gun == 17)
{
SetPlayerAttachedObject(playerid, 4,343,7,0.0,0.0,-0.1,0.0,270.0,0.0);
}
else if(gun == 18)
{
SetPlayerAttachedObject(playerid, 4,344,7,0.0,0.0,-0.1,0.0,270.0,0.0);
}
else if(gun == 22)
{
SetPlayerAttachedObject(playerid, 4,346,8,-0.1,0.0,0.1,270.0,0.0,0.0);
}
else if(gun == 23)
{
SetPlayerAttachedObject(playerid, 4,347,8,-0.1,0.0,0.1,270.0,0.0,0.0);
}
else if(gun == 24)
{
SetPlayerAttachedObject(playerid, 4,348,8,-0.1,0.0,0.1,270.0,0.0,0.0);
}
else if(gun == 25)
{
SetPlayerAttachedObject(playerid, 4,349,1,0.2,-0.1,0.2,180.0,40.0,180.0);
}
else if(gun == 26)
{
SetPlayerAttachedObject(playerid, 4,350,8,-0.1,0.0,0.1,270.0,0.0,0.0);
}
else if(gun == 27)
{
SetPlayerAttachedObject(playerid, 4,351,1,0.2,-0.1,0.3,180.0,40.0,186.0);
}
else if(gun == 28)
{
SetPlayerAttachedObject(playerid, 4,372,8,0.1,0.0,0.1,270.0,270.0,0.0);
}
else if(gun == 29)
{
SetPlayerAttachedObject(playerid, 4,353,8,0.1,-0.1,0.1,270.0,0.0,0.0);
}
else if(gun == 30)
{
SetPlayerAttachedObject(playerid, 4,355,1,0.2,-0.1,0.2,180.0,40.0,180.0);
}
else if(gun == 31)
{
SetPlayerAttachedObject(playerid, 4,356,1,0.2,-0.1,0.2,180.0,40.0,180.0);
}
else if(gun == 32)
{
SetPlayerAttachedObject(playerid, 4,372,8,0.1,0.0,0.1,270.0,270.0,0.0);
}
else if(gun == 33)
{
SetPlayerAttachedObject(playerid, 4,357,1,0.2,-0.1,0.2,180.0,40.0,180.0);
}
else if(gun == 34)
{
SetPlayerAttachedObject(playerid, 4,358,1,0.2,-0.1,0.2,180.0,40.0,180.0);
}
else if(gun == 35)
{
SetPlayerAttachedObject(playerid, 4,359,1,0.1,-0.2,-0.2,0.0,50.0,0.0);
}
else if(gun == 42)
{
SetPlayerAttachedObject(playerid, 4,366,1,0.4,-0.2,0.1,180.0,50.0,180.0);
}
else if(gun == 41)
{
SetPlayerAttachedObject(playerid, 4,365,7,0.0,0.0,-0.1,0.0,270.0,0.0);
}
}