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;
}
I think this won't show me the Weapon name that killed me ! I need that too
|
C:\Users\Rohit\Desktop\kill.pwn(19) : warning 217: loose indentation C:\Users\Rohit\Desktop\kill.pwn(19) : error 017: undefined symbol "format" C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition C:\Users\Rohit\Desktop\kill.pwn(19) : warning 202: number of arguments does not match definition C:\Users\Rohit\Desktop\kill.pwn(20) : warning 217: loose indentation C:\Users\Rohit\Desktop\kill.pwn(20) : error 017: undefined symbol "SendClientMessage" C:\Users\Rohit\Desktop\kill.pwn(25) : warning 235: public function lacks forward declaration (symbol "OnPlayerWeaponShot") C:\Users\Rohit\Desktop\kill.pwn(26) : error 017: undefined symbol "BULLET_HIT_TYPE_PLAYER" C:\Users\Rohit\Desktop\kill.pwn(27) : error 017: undefined symbol "GetPlayerDistanceFromPoint" C:\Users\Rohit\Desktop\kill.pwn(27) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 11 Errors. |