killer distance ?
#10

I made only the distance part, the rest was copy-paste of what you did. You use %s which is for strings and the arguments are killerid and playerid which are integers..

You'll also need to check if the killer is valid.

That should work:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new Float:x, Float:y, Float:z, Float:fDistance, szMessage[90], szName[MAX_PLAYER_NAME];
        GetPlayerPos(playerid, x, y, z);
        fDistance = GetPlayerDistanceFromPoint(killerid, x, y, z);
        GetPlayerName(killerid, szMessage, MAX_PLAYER_NAME);
        GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
        format(szMessage, sizeof(szMessage), "%s has killed %s from the distance of %0.2f", szMessage, szName, fDistance);
        SendClientMessage(playerid, 0xA9C4E4FF, szMessage);
        // I assume you wanted a message to all?
        //SendClientMessageToAll(0xA9C4E4FF, szMessage);
    }
    return 1;
}
Reply


Messages In This Thread
killer distance ? - by Champ - 09.11.2013, 19:19
Re: killer distance ? - by Konstantinos - 09.11.2013, 19:24
Re: killer distance ? - by erminpr0 - 09.11.2013, 19:29
Re: killer distance ? - by Pottus - 09.11.2013, 19:33
Re: killer distance ? - by Champ - 09.11.2013, 19:40
Re: killer distance ? - by Champ - 09.11.2013, 19:50
Re: killer distance ? - by iZN - 09.11.2013, 19:53
Re: killer distance ? - by Konstantinos - 09.11.2013, 19:54
Re: killer distance ? - by Champ - 09.11.2013, 20:08
Re: killer distance ? - by Konstantinos - 09.11.2013, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)