[DUDA]sonido al golpear o disparar.
#1

Hola.
Bueno mi duda es como se hace para que cuando un player le de un disparo o un golpe a otro player,el player que dio el disparo o golpe,escuche un sonido,ej: sonido id 1052.
Gracias.
Reply
#2

PlayPlayerSound(playerid, Soundid, 0.0, 0.0, 0.0);


O tambien..

https://sampwiki.blast.hk/wiki/PlayerPlaySound
Reply
#3

lo puse asi pero no funciona:

public OnPlayerDeath(playerid, killerid, reason)
{
PlayerPlaySound(killerid, 1052, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
Reply
#4

chequeaste que carajos es el id 1052 ? xd
Reply
#5

probe con varias id,esa la saque del SA-MP Script King.
Reply
#6

proba la id 1112
Reply
#7

no,no funciona,ps lo que quiero hacer es que al dar un golpe o disparo se reprodusca un sonido.
creo que no va haci la funcion...
Reply
#8

aquн tu soluciуn ъselo como fs

pawn Код:
#include <a_samp>

new Float:Aero_LastHealth[200];

public OnPlayerUpdate(playerid){
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    if(Health < Aero_LastHealth[playerid]){
        CallRemoteFunction("OnPlayerLoseHealth", "df", playerid, Aero_LastHealth[playerid] - Health);
    } else if(Health > Aero_LastHealth[playerid]){
        CallRemoteFunction("OnPlayerGainHealth", "df", playerid, Health - Aero_LastHealth[playerid]);
    }
    if(Health != Aero_LastHealth[playerid]){
        CallRemoteFunction("OnPlayerHealthChange", "ddd", playerid, Aero_LastHealth[playerid], Health);
    }
    Aero_LastHealth[playerid] = Health;

    return 1;
}

IsPlayerAiming(playerid, aimid){
    new Float:X1, Float:Y1, Float:Z1, Float:X2, Float:Y2, Float:Z2;
    GetPlayerPos(playerid, X1, Y1, Z1);
    GetPlayerPos(aimid, X2, Y2, Z2);
//  new keys, own, pwn;
//  GetPlayerKeys(playerid, keys, own, pwn);
//  if(!(keys & KEY_SECONDARY_ATTACK))return false;
    new Float:Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
    if(Distance < 100){
        new Float:A;
        GetPlayerFacingAngle(playerid, A);
        X1 += (Distance * floatsin(-A, degrees));
        Y1 += (Distance * floatcos(-A, degrees));
        Distance = floatsqroot(floatpower(floatabs(X1-X2), 2) + floatpower(floatabs(Y1-Y2), 2));
        if(Distance < 1.0){
            return true;
        }
    }
    return false;
}

forward OnPlayerLoseHealth(playerid, Float:lose);
public OnPlayerLoseHealth(playerid, Float:lose){
    for(new g=0;g<GetMaxPlayers();g++)if(IsPlayerConnected(g) && g!=playerid){
        if(IsPlayerAiming(g, playerid))return PlayerPlaySound(g, 1057, 0.0, 0.0, 0.0);
    }
    return true;
}
Reply
#9

perfecto,duda solucionada.
Gracias adrianxd.
Reply
#10

ajam (y)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)