SA-MP Forums Archive
[FilterScript] [0.3x] Hitting Sound. - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [0.3x] Hitting Sound. (/showthread.php?tid=418146)



[0.3x] Hitting Sound. - [UG]Daniel - 23.02.2013

[0.3x] Hitting Sound


Hi all.
Today I'm going to release my first Filterscript on the sa-mp forums

Why did you make it?
Because I was bored. So I got the idea of making this.

What does it do?
Well, When you shoot a player, When you hit him you can hear a sound.

Why releasing it?
Because I think this is useful for Stunt/DM or TDM/DM servers.

Download Link?
The files are attached to the post

Please, Don't remove the credits
I hope this can be useful for you
Cheers,
Daniel


Re: [0.3x] Hitting Sound. - Guest9328472398472 - 24.02.2013

Just saying (not leaving bad comments) but the sound will eventually get annoying down the line, tbh

Otherwise, nice job for your first!


Re: [0.3x] Hitting Sound. - 2KY - 24.02.2013

Quote:
Originally Posted by Brandon Javorsky
Посмотреть сообщение
Just saying (not leaving bad comments) but the sound will eventually get annoying down the line, tbh

Otherwise, nice job for your first!
That'd be easily combated with a simple toggle command!


Re: [0.3x] Hitting Sound. - [UG]Daniel - 24.02.2013

Quote:
Originally Posted by Brandon Javorsky
Посмотреть сообщение
Just saying (not leaving bad comments) but the sound will eventually get annoying down the line, tbh

Otherwise, nice job for your first!
Maybe it will :/
But thanks


Re: [0.3x] Hitting Sound. - Matz - 24.02.2013

Actually this is wrong because you used OnPlayerGiveDamage. I mean if you hit opponent's skin (not lead shoot) you will hear sound but you wont hit him (if ping is high). So you have to use OnPlayerTakeDamage only and remove OnGivePlayerDamage.

pawn Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new s[20];

    //The one who got damaged
    format(s, 20, "-Damage %.0f", amount);
    TextDrawSetString(TakeDamage[playerid], s);
    TextDrawShowForPlayer(playerid, TakeDamage[playerid]);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);

    //The one who damaged it
    format(s, 20, "+Damage %.0f", amount);
    TextDrawSetString(GiveDamage[issuerid], s);
    TextDrawShowForPlayer(issuerid, GiveDamage[issuerid]);
    PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", issuerid);
    return 1;
}



Re: [0.3x] Hitting Sound. - Mac-10 - 25.02.2013

Nice Job!


Re: [0.3x] Hitting Sound. - [UG]Daniel - 25.02.2013

Quote:
Originally Posted by Matz
Посмотреть сообщение
Actually this is wrong because you used OnPlayerGiveDamage. I mean if you hit opponent's skin (not lead shoot) you will hear sound but you wont hit him (if ping is high). So you have to use OnPlayerTakeDamage only and remove OnGivePlayerDamage.

pawn Код:
forward OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid);
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new s[20];

    //The one who got damaged
    format(s, 20, "-Damage %.0f", amount);
    TextDrawSetString(TakeDamage[playerid], s);
    TextDrawShowForPlayer(playerid, TakeDamage[playerid]);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);

    //The one who damaged it
    format(s, 20, "+Damage %.0f", amount);
    TextDrawSetString(GiveDamage[issuerid], s);
    TextDrawShowForPlayer(issuerid, GiveDamage[issuerid]);
    PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
    SetTimerEx("DestruirTextoDraw", 1000, false, "i", issuerid);
    return 1;
}
Ohh yeah
Thanks for the warning


Re: [0.3x] Hitting Sound. - [UG]Daniel - 25.02.2013

Quote:
Originally Posted by Mac-10
Посмотреть сообщение
Nice Job!
Thanks


Re: [0.3x] Hitting Sound. - NoahF - 20.06.2013

Thanks for this.


Re: [0.3x] Hitting Sound. - floydya - 21.06.2013

Just put
PHP код:
PlayerPlaySound(playerid64010.00.00.0
into
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid