HEADSHOT DISTANCE HELP -
Hunud - 25.07.2016
Hello Guys,
How should i get a distance in player stats of top headshots distance! here is codes in stats
Код:
new Float:x, Float:y, Float:z, Float:fDistance;
Код:
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(playerid, x, y, z);
Код:
Top distance Headshot |{FFFFFF} %0.2f",fDistance
When I Headshots player from 100 meters there is nothing in /stats top distance headshot: 0.00
everything is under /stats cmd
Re: HEADSHOT DISTANCE HELP -
Deadpoop - 25.07.2016
PHP код:
GetPlayerPos(target, x, y, z);
fDistance = GetPlayerDistanceFromPoint(playerid, x, y, z);
You get distance from yourself not from the player you shot!
Re: HEADSHOT DISTANCE HELP -
Hunud - 25.07.2016
Quote:
Originally Posted by Deadpoop
PHP код:
GetPlayerPos(target, x, y, z);
fDistance = GetPlayerDistanceFromPoint(playerid, x, y, z);
You get distance from yourself not from the player you shot!
|
I did it but no work ;/
Re: HEADSHOT DISTANCE HELP -
DRIFT_HUNTER - 25.07.2016
You are checking player distance from himself.
You need to know target and killer/issuer
So something like these:
pawn Код:
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(killerid, x, y, z);
Re: HEADSHOT DISTANCE HELP -
PrO.GameR - 25.07.2016
You are checking a player's distance with his own position? and expect it to be more than 0?
Re: HEADSHOT DISTANCE HELP -
Logic_ - 26.07.2016
Nice work copying xd from my release that got removed xd
anyways, heres my code.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
// Headshot System
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(playerid, "~r~HEADSHOT", 3000, 3);
GameTextForPlayer(issuerid, "~g~HEADSHOT", 3000, 3);
new Float:x, Float:y, Float:z, Float:fDistance, hsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(issuerid, x, y, z);
GetPlayerName(issuerid, KName, MAX_PLAYER_NAME);
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
format(hsMessage, sizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f", KName, PName, fDistance);
SendClientMessageToAll(0xFCFC18AA, hsMessage);
EDIT: This is a out-dated version, I have optimized my script very much.
Re: HEADSHOT DISTANCE HELP -
Bolex_ - 26.07.2016
Quote:
Originally Posted by ALiScripter
Nice work copying xd from my release that got removed xd
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
// Headshot System
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(playerid, "~r~HEADSHOT", 3000, 3);
GameTextForPlayer(issuerid, "~g~HEADSHOT", 3000, 3);
new Float:x, Float:y, Float:z, Float:fDistance, hsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(issuerid, x, y, z);
GetPlayerName(issuerid, KName, MAX_PLAYER_NAME);
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
format(hsMessage, sizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f", KName, PName, fDistance);
SendClientMessageToAll(0xFCFC18AA, hsMessage);
|
So whats the problem ? So you are just posted this useless shit to prove to someone thats your ? Everyone copy someone same like me
xd
Re: HEADSHOT DISTANCE HELP -
GhostHacker - 26.07.2016
Quote:
Originally Posted by ALiScripter
Nice work copying xd from my release that got removed xd
anyways, heres my code. *pussyman*
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
// Headshot System
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
SetPlayerHealth(playerid, 0.0);
GameTextForPlayer(playerid, "~r~HEADSHOT", 3000, 3);
GameTextForPlayer(issuerid, "~g~HEADSHOT", 3000, 3);
new Float:x, Float:y, Float:z, Float:fDistance, hsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME];
GetPlayerPos(playerid, x, y, z);
fDistance = GetPlayerDistanceFromPoint(issuerid, x, y, z);
GetPlayerName(issuerid, KName, MAX_PLAYER_NAME);
GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
format(hsMessage, sizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f", KName, PName, fDistance);
SendClientMessageToAll(0xFCFC18AA, hsMessage);
|
Lol this guy make small and noobish things and consider them as great thing any kid can do it and no need to copy paste lol.