weapon change
#1

Hi. Someone helped me a long time ago with a script.

If I have M4 (ex) and scroll it, the weapon gets attached on my back.


My question how can I edit with customizable position? (Those x,y,z arrows to put everywhere I want) via cmd

PHP код:
CMD:gunholdster(playerid,params[])
{
..........


PHP код:
        if(tickcount() - armedbody_pTick[playerid] > 113)
        {
            new
                
weaponid[13],weaponammo[13],pArmedWeapon;
            
pArmedWeapon GetPlayerWeapon(playerid);
            
GetPlayerWeaponData(playerid,1,weaponid[1],weaponammo[1]);
            
GetPlayerWeaponData(playerid,2,weaponid[2],weaponammo[2]);
            
GetPlayerWeaponData(playerid,4,weaponid[4],weaponammo[4]);
            
GetPlayerWeaponData(playerid,5,weaponid[5],weaponammo[5]);
            
#if ARMEDBODY_USE_HEAVY_WEAPON
            
GetPlayerWeaponData(playerid,7,weaponid[7],weaponammo[7]);
            
#endif
            
if(weaponid[1] && weaponammo[1] > 0){
                if(
pArmedWeapon != weaponid[1]){
                    if(!
IsPlayerAttachedObjectSlotUsed(playerid,5)){
                        
//SetPlayerAttachedObject(playerid,5,GetWeaponModel(weaponid[1]),1, 0.199999, -0.139999, 0.030000, 0.500007, -115.000000, 0.000000, 1.000000, 1.000000, 1.000000);
                        
SetPlayerAttachedObjectplayerid5GetWeaponModel(weaponid[1]), 16, -0.1950320.120565, -0.0524460.00000020.2500000.0000000.9686020.9049521.110462 );
                    }
                }
                else {
                    if(
IsPlayerAttachedObjectSlotUsed(playerid,5)){
                        
RemovePlayerAttachedObject(playerid,5);
                    }
                }
            }
            else if(
IsPlayerAttachedObjectSlotUsed(playerid,5)){
                
RemovePlayerAttachedObject(playerid,5);
            }
            if(
weaponid[2] && weaponammo[2] > 0){
                if(
pArmedWeapon != weaponid[2]){
                    if(!
IsPlayerAttachedObjectSlotUsed(playerid,6)){
                        
//SetPlayerAttachedObject(playerid,6,GetWeaponModel(weaponid[2]),8, -0.079999, -0.039999, 0.109999, -90.100006, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
                        
SetPlayerAttachedObject(playerid6GetWeaponModel(weaponid[2]), 12, -0.050205, -0.069741, -0.08091220.17999817.460956354.6689451.1509071.0611560.884258 );
                    }
                }
                else {
                    if(
IsPlayerAttachedObjectSlotUsed(playerid,6)){
                        
RemovePlayerAttachedObject(playerid,6);
                    }
                }
            }
            else if(
IsPlayerAttachedObjectSlotUsed(playerid,6)){
                
RemovePlayerAttachedObject(playerid,6);
            }
            if(
weaponid[4] && weaponammo[4] > 0){
                if(
pArmedWeapon != weaponid[4]){
                    if(!
IsPlayerAttachedObjectSlotUsed(playerid,7)){
                        
SetPlayerAttachedObject(playerid,7,GetWeaponModel(weaponid[4]),70.000000, -0.100000, -0.080000, -95.000000, -10.0000000.0000001.0000001.0000001.000000);
                    }
                }
                else {
                    if(
IsPlayerAttachedObjectSlotUsed(playerid,7)){
                        
RemovePlayerAttachedObject(playerid,7);
                    }
                }
            }
            else if(
IsPlayerAttachedObjectSlotUsed(playerid,7)){
                
RemovePlayerAttachedObject(playerid,7);
            }
            if(
weaponid[5] && weaponammo[5] > 0){
                if(
pArmedWeapon != weaponid[5]){
                    if(!
IsPlayerAttachedObjectSlotUsed(playerid,8)){
                        
SetPlayerAttachedObject(playerid,8,GetWeaponModel(weaponid[5]),10.200000, -0.119999, -0.0599990.000000206.0000000.0000001.0000001.0000001.000000);
                    }
                }
                else {
                    if(
IsPlayerAttachedObjectSlotUsed(playerid,8)){
                        
RemovePlayerAttachedObject(playerid,8);
                    }
                }
            }
            else if(
IsPlayerAttachedObjectSlotUsed(playerid,8)){
                
RemovePlayerAttachedObject(playerid,8);
            }
            
#if ARMEDBODY_USE_HEAVY_WEAPON
            
if(weaponid[7] && weaponammo[7] > 0){
                if(
pArmedWeapon != weaponid[7]){
                    if(!
IsPlayerAttachedObjectSlotUsed(playerid,9)){
                        
SetPlayerAttachedObject(playerid,9,GetWeaponModel(weaponid[7]),1,-0.1000000.000000, -0.10000084.399932112.00000010.0000001.0999991.0000001.000000);
                    }
                }
                else {
                    if(
IsPlayerAttachedObjectSlotUsed(playerid,9)){
                        
RemovePlayerAttachedObject(playerid,9);
                    }
                }
            }
            else if(
IsPlayerAttachedObjectSlotUsed(playerid,9)){
                
RemovePlayerAttachedObject(playerid,9);
            }
            
#endif
            
armedbody_pTick[playerid] = tickcount();
        }
        }
    return 
1;

Reply


Messages In This Thread
weapon change - by Zeus666 - 25.10.2018, 21:22
Re: weapon change - by ReD_HunTeR - 25.10.2018, 21:25
Re: weapon change - by Zeus666 - 25.10.2018, 21:26
Re: weapon change - by v1k1nG - 25.10.2018, 22:59
Re: weapon change - by Zeus666 - 25.10.2018, 23:52
Re: weapon change - by v1k1nG - 26.10.2018, 00:01
Re: weapon change - by Zeus666 - 26.10.2018, 00:30
Re: weapon change - by v1k1nG - 26.10.2018, 01:00
Re: weapon change - by Zeus666 - 26.10.2018, 09:53
Re: weapon change - by v1k1nG - 26.10.2018, 11:03

Forum Jump:


Users browsing this thread: 1 Guest(s)