09.05.2010, 12:36
how can i get this ?
player1 killed player2. (desert) with 60 Health (Distance: 10m)
thanks
player1 killed player2. (desert) with 60 Health (Distance: 10m)
thanks
stock Float:GetDistanceBetweenPoints(Float:X, Float:Y, Float:Z, Float:PointX, Float:PointY, Float:PointZ) return floatsqroot(floatadd(floatadd(floatpower(floatsub(X, PointX), 2.0), floatpower(floatsub(Y, PointY), 2.0)), floatpower(floatsub(Z, PointZ), 2.0)));
stock Float:GetDistanceBetweenPlayers(playerid, otherplayerid)
{
new Float:X[2], Float:Y[2], Float:Z[2];
GetPlayerPos(playerid, X[0], Y[0], Z[0]);
GetPlayerPos(otherplayerid, X[1], Y[1], Z[1]);
return GetDistanceBetweenPoints(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
}
new WeaponNames[][20] = {
{"Unarmed"},{"Brass Knuckles"},{"Golf Club"},{"Night Stick"},{"Knife"},{"Bat"},{"Shovel"},{"Pool Cue"},{"Katana"},{"Chainsaw"},{"Dildo"},{"Vibrator1"},{"Vibrator2"},{"Vibrator3"},{"Flowers"},{"Cane"},{"Grenade"},{"Tear Gas"},{"Molotov"},{" "},{"N/A"},{" "},{"Pistol"},
{"Silencer"},{"Deagle"},{"Shotgun"},{"Sawnoff"},{"Spas12"},{"Mac-10"},{"Mp5"},{"AK-47"},{"M4"},{"Tec-9"},{"Rifle"},{"Sniper"},{"RPG"},{"HeatSeeker"},{"Flamethrower"},{"Minigun"},{"Satchel"},{"Detonator"},{"Spraycan"},{"Extinguisher"},{"Camera"},{"Nightvision"},{"Infrared"},{"Parachute"},{" "},{" "},{"Vehicle Collision"},{"HeliKill"},{"Explosion"},{" "},{" "},{"Long Fall"}};
// Top Of Your Script Out Of Any CallBack
public OnPlayerDeath(playerid,killerid,reason)
{
new
PlayerNick[MAX_PLAYER_NAME],
KillerNick[MAX_PLAYER_NAME],
Float:H,
Float:A,
String[128];
GetPlayerHealth(killerid,H);GetPlayerArmour(killerid,A);
GetPlayerName(playerid, PlayerNick, MAX_PLAYER_NAME);
GetPlayerName(killerid, KillerNick, MAX_PLAYER_NAME);
format(String,sizeof(String),"*** %s Killed %s (%s) (HP : %.0f) (Dist : %.2f Ft)",KillerNick,PlayerNick,WeaponNames[reason],H+A,GetDistanceBetweenPlayers(playerid,killerid));
SendClientMessageToAll(Colour,String);
return 1;
}
Originally Posted by Killa_
pawn Код:
|
stock Float:GetDistanceBetweenPoints(Float:X, Float:Y, Float:Z, Float:PointX, Float:PointY, Float:PointZ) return floatsqroot(floatadd(floatadd(floatpower(floatsub(X, PointX), 2.0), floatpower(floatsub(Y, PointY), 2.0)), floatpower(floatsub(Z, PointZ), 2.0)));
stock Float:GetDistanceBetweenPlayers(playerid, otherplayerid)
{
new Float:X[2], Float:Y[2], Float:Z[2];
GetPlayerPos(playerid, X[0], Y[0], Z[0]);
GetPlayerPos(otherplayerid, X[1], Y[1], Z[1]);
return GetDistanceBetweenPoints(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
}