27.04.2013, 11:38
Can someone tell me how to add the 'ding' sound when you hit a player?
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID) //If issuer isn't a invalid player. (!= means not equal to)
{ //Then
PlayerPlaySound(playerid, 6401, 0.0, 0.0, 0.0); //Plays a sound of kinda bell.
//if you need it for the guy who takes damage, change 'playerid' to issuerid.
}
return 1;
}
#define DING_SOUND_ID 1111
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
PlayerPlaySound(playerid, DING_SOUND_ID, 0.0, 0.0, 10.0);
}
return 1;
}