Getting the weapon slot of the armed weapon
#1

hi there, is there any function to get the weapon slot of the weapon that the player is currently holding?
Reply
#2

Is it so difficult to search?
Look this function
Reply
#3

well that is getplayerweapondata, but how do I know what slot the weapon is,
I mean the weapon the player holds
Reply
#4

pawn Код:
new
    Weapons = 0, Ammo, Msg[ 64 ];
   
for( new i = 0; i < 13; i ++ )
{
    GetPlayerWeaponData( playerid, i, Weapons, Ammo );
    if( Weapons != 0 )
    {
        format( Msg, sizeof( Msg ), "%d: %d (%d)", i, Weapons, Ammo );
        SendClientMessage( playerid, -1, Msg );
    }
}
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
pawn Код:
new
    Weapons = 0, Ammo, Msg[ 64 ];
   
for( new i = 0; i < 13; i ++ )
{
    GetPlayerWeaponData( playerid, i, Weapons, Ammo );
    if( Weapons != 0 )
    {
        format( Msg, sizeof( Msg ), "%d: %d (%d)", i, Weapons, Ammo );
        SendClientMessage( playerid, -1, Msg );
    }
}
You don't get it,
this is for all weapons,

I want to know the Weapon Slot of the weapon the player is currently holding in his hands, not all of his weapons
Reply
#6

pawn Код:
new
    Weapons = 0, Ammo;
   
for( new i = 0; i < 13; i ++ )
{
    GetPlayerWeaponData( playerid, i, Weapons, Ammo );
    if(Weapons == GetPlayerWeapon(playerid))
    {
        printf("The slot is: %d", i);
    }
}
Reply
#7

Quote:
Originally Posted by Universal
Посмотреть сообщение
pawn Код:
new
    Weapons = 0, Ammo;
   
for( new i = 0; i < 13; i ++ )
{
    GetPlayerWeaponData( playerid, i, Weapons, Ammo );
    if(Weapons == GetPlayerWeapon(playerid))
    {
        printf("The slot is: %d", i);
    }
}
thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)