SA-MP Forums Archive
How can I make this work? - 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: How can I make this work? (/showthread.php?tid=514847)



How can I make this work? - GloomY - 23.05.2014

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if ( pickupid == HousePickup[h] )
        {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X,Y,Z);
            PlayerPlaySound(playerid, 1139, X, Y, Z);
        }
    }
    return 1;
}
How can I stop my function to play the sound all the time when I'm on my house pickup? If I stay on the house pickup all the time, it just reproduces the sound all the time and it becomes annoying.
Thanks for help.


Re : How can I make this work? - S4t3K - 23.05.2014

Simply add "break;" after "PlayerPlaySound".

Or move the "return 1;" just after PlayerPlaySound. (recommended)


Re: How can I make this work? - sl!x - 23.05.2014

i would recomend you to set a timer


Re: How can I make this work? - GloomY - 23.05.2014

Thank you guys, reputation up...