Hitsound activate with command
#1

Hello, how can i make that the hitsound comes when i shoot someone or hurt someone, because that dont work?

Код:
CMD:hitsound(playerid)
{
   PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
   SendClientMessage(playerid,-1,""chat""COL_GREEN" Hit Sound Activated!");
}

CMD:stophitsound(playerid)
{
   PlayerPlaySound(playerid,1184,0.0,0.0,0.0);
   SendClientMessage(playerid,-1,""chat""COL_GREEN" Hit Sound Deactivated!");
}
Reply
#2

first add this :
pawn Код:
new HitSound[MAX_PLAYERS];
second use this under OnPlayerConnect if you want when player connects it don't work :
pawn Код:
HitSound[playerid] = 0;
third use this code under OnPlayerTakeDamage :
pawn Код:
if(HitSound[issuerid] == 1)
    {
    PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
    }
then add the commands :
pawn Код:
CMD:hitsound(playerid)
{
   HitSound[playerid] = 1;
   SendClientMessage(playerid,-1,""chat""COL_GREEN" Hit Sound Activated!");
}

CMD:stophitsound(playerid)
{
   HitSound[playerid] = 0;
   SendClientMessage(playerid,-1,""chat""COL_GREEN" Hit Sound Deactivated!");
}
Reply
#3

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0);
    PlayerPlaySound(playerid, 1184, 0.0, 0.0, 0.0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)