#include <a_samp>
#define FILTERSCRIPT
#define DIALOG_RULES 2
#pragma tabsize 0
forward Float:GetDistanceBetweenPlayers(p1,p2);
stock Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float:x11,Float:y11,Float:z11,Float:x3,Float:y3,Float:z3;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2))
{
return -1.00;
}
GetPlayerPos(p1,x11,y11,z11);
GetPlayerPos(p2,x3,y3,z3);
return floatsqroot(floatpower(floatabs(floatsub(x3,x11)),2)+floatpower(floatabs(floatsub(y3,y11)),2)+floatpower(floatabs(floatsub(z3,z11)),2));
}
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
new deathreason[20];
new PlayerNamea[30];
new string[256];
new Float:h;
new Float:a;
new n[30];
new msg[150];
GetPlayerHealth(killerid,h);
GetPlayerArmour(killerid,a);
GetPlayerName(killerid,n,30);
GetWeaponName(reason,deathreason, 20);
//if(killerid != INVALID_PLAYER_ID && reason != 255)
//{
//}
//else{
format(PlayerNamea,sizeof PlayerNamea," Info ",PlayerNamea);
msg="At your murderer [%s] \nremains [%d] XP \n and [%d] AR\n has killed you with [%s]\nfrom distance [%d].";
format(string,sizeof string,msg,n,floatround(h),floatround(a),deathreason,floatround(GetDistanceBetweenPlayers(i,playerid)));
ShowPlayerDialog(playerid,DIALOG_RULES,0,PlayerNamea,string,"OK","Exit");
//}
}
}
return 1;
}
Originally Posted by ikarus
Hy all my hungarys!
|