SA-MP Forums Archive
pickups giving lot of sounds - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: pickups giving lot of sounds (/showthread.php?tid=659224)



pickups giving lot of sounds - severance - 27.09.2018

Well i just made a weapon and health pickups and everything seem to work but , the pickup sound sometimes is not synced on the moment you taking the pickup, it seems like once you took it the sounds are looping or even before you taking them. Well that's just a lost case which i dont seem to understand what's causing it.

This is the drop pickups

PHP код:
function create_player_drops(playerid)
{
    new 
Float: x, Float: y, Float: z, p_weapon, p_ammo, getspace;
    
    
GetPlayerPos(playerid, x, y, z);
    
pickup_Health = CreatePickup(1240, 3, x, y+1, z, -1);
    for (new 
i = 0; i < 12; i++)
    {
        
GetPlayerWeaponData(playerid, i, p_weapon, p_ammo);
        
getspace++;
        
pickup_Weapon[i] = CreatePickup(WeaponObject(p_weapon), 3, x+getspace, y, z, -1);
    }
        
    
SetTimerEx("DestroyPlayerDrops", 10000, false, "i", playerid);
        
    return 
1;
} 
Even tho... i'm not using any sounds here

PHP код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    new 
Float: HP;
    
    if(
pickupid == pickup_Weapon[playerid]) DestroyPickup(pickup_Weapon[playerid]);
       
    if(
pickupid == pickup_Health)
    {
         
GetPlayerHealth(playerid, HP); 
         if(
HP < 80) SetPlayerHealth(playerid, HP+20);
         
DestroyPickup(pickup_Health);
     }
        
    return 
1;
} 



Re: pickups giving lot of sounds - v1k1nG - 27.09.2018

Check pickup types, you may need to use pickup type 1 for scripting purposes


Re: pickups giving lot of sounds - severance - 28.09.2018

Yeah i made type 1, but now pickup can't be taken