Distance Shoot
#1

How to get distance shoot ?

like Hostoxide killed you within 100 meters
Reply
#2

Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
    new Float:x, Float:y, Float:z, Float:Distance;
    GetPlayerPos(damagedid, x, y, z);
    Distance = GetPlayerDistanceFromPoint(playerid, x,y,z);
    return 1;
}
Something like this. I hope it helped
Reply
#3

You can delete Float: form distance if you want. I dont know is thats needed
Reply
#4

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid != INVALID_PLAYER_ID)
    {
        new Float:coords[3];
        GetPlayerPos(playerid, coords[0], coords[1], coords[2]);
        format(str, sizeof(str), "You've been killed (Distance: %.2f meters).", GetPlayerDistanceFromPoint(killerid, coords[0], coords[1], coords[2]);
        SendClientMessage(playerid, -1, str);
    }
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)