HEADSHOT DISTANCE HELP
#1

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
Reply
#2

PHP код:
GetPlayerPos(targetxyz);
        
fDistance GetPlayerDistanceFromPoint(playeridxyz); 
You get distance from yourself not from the player you shot!
Reply
#3

Quote:
Originally Posted by Deadpoop
Посмотреть сообщение
PHP код:
GetPlayerPos(targetxyz);
        
fDistance GetPlayerDistanceFromPoint(playeridxyz); 
You get distance from yourself not from the player you shot!
I did it but no work ;/
Reply
#4

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);
Reply
#5

You are checking a player's distance with his own position? and expect it to be more than 0?
Reply
#6

Nice work copying xd from my release that got removed xd

anyways, heres my code.
PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart

// Headshot System 
            
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9
            { 
            
SetPlayerHealth(playerid0.0); 
            
GameTextForPlayer(playerid"~r~HEADSHOT"30003); 
            
GameTextForPlayer(issuerid"~g~HEADSHOT"30003); 
            new 
Float:xFloat:yFloat:zFloat:fDistancehsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME]; 
        
GetPlayerPos(playeridxyz); 
        
fDistance GetPlayerDistanceFromPoint(issueridxyz); 
        
GetPlayerName(issueridKNameMAX_PLAYER_NAME); 
        
GetPlayerName(playeridPNameMAX_PLAYER_NAME); 
            
format(hsMessagesizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f"KNamePNamefDistance); 
            
SendClientMessageToAll(0xFCFC18AAhsMessage); 
EDIT: This is a out-dated version, I have optimized my script very much.
Reply
#7

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
Nice work copying xd from my release that got removed xd

PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart

// Headshot System 
            
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9
            { 
            
SetPlayerHealth(playerid0.0); 
            
GameTextForPlayer(playerid"~r~HEADSHOT"30003); 
            
GameTextForPlayer(issuerid"~g~HEADSHOT"30003); 
            new 
Float:xFloat:yFloat:zFloat:fDistancehsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME]; 
        
GetPlayerPos(playeridxyz); 
        
fDistance GetPlayerDistanceFromPoint(issueridxyz); 
        
GetPlayerName(issueridKNameMAX_PLAYER_NAME); 
        
GetPlayerName(playeridPNameMAX_PLAYER_NAME); 
            
format(hsMessagesizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f"KNamePNamefDistance); 
            
SendClientMessageToAll(0xFCFC18AAhsMessage); 
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
Reply
#8

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
Nice work copying xd from my release that got removed xd

anyways, heres my code. *pussyman*
PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponidbodypart

// Headshot System 
            
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9
            { 
            
SetPlayerHealth(playerid0.0); 
            
GameTextForPlayer(playerid"~r~HEADSHOT"30003); 
            
GameTextForPlayer(issuerid"~g~HEADSHOT"30003); 
            new 
Float:xFloat:yFloat:zFloat:fDistancehsMessage[90], KName[MAX_PLAYER_NAME], PName[MAX_PLAYER_NAME]; 
        
GetPlayerPos(playeridxyz); 
        
fDistance GetPlayerDistanceFromPoint(issueridxyz); 
        
GetPlayerName(issueridKNameMAX_PLAYER_NAME); 
        
GetPlayerName(playeridPNameMAX_PLAYER_NAME); 
            
format(hsMessagesizeof(hsMessage), "%s has Headshotted %s from the distance of %0.2f"KNamePNamefDistance); 
            
SendClientMessageToAll(0xFCFC18AAhsMessage); 
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.
Reply


Forum Jump:


Users browsing this thread: