Problem with GetPlayerWeaponData.
#1

Hello !

GetPlayerWeaponData is bugged?

If I have a Desert Eagle with 30 ammos and I switch for a Knife (1 ammo), it tell me that the knife has 30 balls for example.

[quote=Baltimore;3427993]
pawn Код:
for(new slot = 0; slot < 13; slot++)
{
    new gun,
        ammo,
        munis;
               
    GetPlayerWeaponData(i, slot, gun, ammo);   

    new wslot = getSlotByWeaponID(GetPlayerWeapon(i));
                   
    if(ammo < WeaponInfos[i][wslot][Ammo])
        WeaponInfos[i][wslot][Ammo] = ammo;
               
    new id = -1;
               
    for(new w; w < sizeof(wep_Data); w++)
    {
        if(wep_Data[w][wep_CustomWeapon] != 0 && wep_Data[w][wep_CustomWeapon] == WeaponInfos[i][wslot][Model])
        {
            id = w;
        }
    }
                   
    if(WeaponInfos[i][wslot][Ammo] < ammo || wep_Data[id][wep_MaxAmmo] < ammo)
        munis = gun;
               
    if(munis > 0)
    {
        // Detect cheats
    }
}
Reply
#2

I didnt check all of the code but try this
pawn Код:
for(new slot = 0; slot < 12; slot++)
{
    new gun,
        ammo,
        munis;
               
    GetPlayerWeaponData(i, slot, gun, ammo);   
                   
    if(ammo < WeaponInfos[i][slot][Ammo])
        WeaponInfos[i][slot][Ammo] = ammo;
               
    new id = -1;
               
    for(new w; w < sizeof(wep_Data); w++)
    {
        if(wep_Data[w][wep_CustomWeapon] != 0 && wep_Data[w][wep_CustomWeapon] == WeaponInfos[i][slot][Model])
        {
            id = w;
        }
    }
                   
    if(WeaponInfos[i][slot][Ammo] < ammo || wep_Data[id][wep_MaxAmmo] < ammo)
        munis = gun;
               
    if(munis > 0)
    {
        // Detect cheats
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)