[Ajuda] OnPlayerGiveDamage - Sistema de HIT
#3

Acabei de fazer ..

Obs: Nгo testei mais pela logica estб parecendo ser fucional .


pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID && weaponid == 34)
    {
        new Float:Distancia, string[100];
        Distancia = GetDistanceBetweenPlayers(issuerid,playerid);
        format(string, sizeof(string), "[ INFO ] vocк deu um tiro no jogador %s em uma distancia de %.1f", PlayerName(playerid), Distancia);
        SendClientMessage(issuerid, -1, string);
    }
    return 1;
}


pawn Код:
stock PlayerName(playerid)
{
new Nome[MAX_PLAYERS];
GetPlayerName(playerid, Nome, MAX_PLAYERS);
return Nome;
}
pawn Код:
stock GetDistanceBetweenPlayers(playerid,playerid2){
        new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
        new Float:dis;
        GetPlayerPos(playerid,x1,y1,z1);
        GetPlayerPos(playerid2,x2,y2,z2);
        dis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
        return floatround(dis);
}
Reply


Messages In This Thread
Distancia entre player - edit - by ModaLOKO - 15.05.2015, 23:17
Re: OnPlayerGiveDamage - Sistema de HIT - by Bruno_Cyra - 16.05.2015, 15:06
Re: OnPlayerGiveDamage - Sistema de HIT - by Jimmmy - 16.05.2015, 16:07
Re: OnPlayerGiveDamage - Sistema de HIT - by ModaLOKO - 16.05.2015, 16:18
Re: OnPlayerGiveDamage - Sistema de HIT - by Jimmmy - 16.05.2015, 16:24
Re: OnPlayerGiveDamage - Sistema de HIT - by ModaLOKO - 16.05.2015, 16:25

Forum Jump:


Users browsing this thread: 2 Guest(s)