Posts: 694
Threads: 2
Joined: Oct 2012
Reputation:
0
You are checking a player's distance with his own position? and expect it to be more than 0?
Posts: 1,506
Threads: 13
Joined: Jun 2015
26.07.2016, 11:19
(
Последний раз редактировалось Logic_; 26.07.2016 в 17:16.
)
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.
Posts: 156
Threads: 12
Joined: Jan 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.