01.08.2017, 14:22
(
Последний раз редактировалось CodeStyle175; 01.08.2017 в 15:22.
)
PHP код:
new Float:LastShotDis[MAX_PLAYERS];
UName(p){
new s[24];
GetPlayerName(p,s,24);
return s;
}
WName(wid){
new s[32];
GetWeaponName(wid,s,32);
return s;
}
#define scm SendClientMessage
public OnPlayerDeath(playerid, killerid, reason){
if(killerid != INVALID_PLAYER_ID){
new s[128];
format(s,sizeof(s),"You killed %s from distance %.2f with weapon %s.",UName(playerid),LastShotDis[killerid],WName(reason));
scm(killerid,-1,s);
format(s,sizeof(s),"You were killed by %s from distance %.2f with weapon %s.",UName(killerid),LastShotDis[killerid],WName(reason));
scm(playerid,-1,s);
}
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ){
if(hittype==BULLET_HIT_TYPE_PLAYER){
LastShotDis[playerid]=GetPlayerDistanceFromPoint(playerid,fX,fY,fZ);
}
return 1;
}
EDITED