07.11.2015, 12:17
Bom, eu tenho um sistema de HS e ele nao quer tirar todo o dano.
eu acerto na cabeзa e ele tira apenas 99 de dano.
ele й um FS, eu pensei em mudar os danos no meu GM, porem se eu mexer neles, qualquer tiro vai usar esse valor.
me ajudem?
FS abaixo.
quem puder, obrigado ai
eu acerto na cabeзa e ele tira apenas 99 de dano.
ele й um FS, eu pensei em mudar os danos no meu GM, porem se eu mexer neles, qualquer tiro vai usar esse valor.
me ajudem?
FS abaixo.
PHP Code:
#include <a_samp>
#define CAMERA_MOVE_TIME 5000
#define BODY_PART_HEAD 101
PHP Code:
public OnFilterScriptInit()
{
return 1;
}
PHP Code:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
if(weaponid == 34 && bodypart == BODY_PART_HEAD)
{
SetPlayerArmedWeapon(playerid, 0);
TogglePlayerControllable(playerid, 0);
new
Float:fOPos[3],
Float:fHPos[3],
Float:Angle,
Float:Speed,
object,
time
;
GetPlayerLastShotVectors(playerid, fOPos[0], fOPos[1], fOPos[2], fHPos[0], fHPos[1], fHPos[2]);
GetPlayerFacingAngle(playerid, Angle);
Speed = VectorSize(fOPos[0]-fHPos[0], fOPos[1]-fHPos[1], fOPos[2]-fHPos[2]) / ( CAMERA_MOVE_TIME / 1000 );
object = CreatePlayerObject(playerid, 1636, fOPos[0], fOPos[1], fOPos[2], 0.0, 0.0, 0.0);
SetObjectFacePoint(playerid, object, fHPos[0], fHPos[1]);
MovePlayerObject(playerid, object, fHPos[0], fHPos[1], fHPos[2], Speed);
SetTimerEx("CameraEnd", CAMERA_MOVE_TIME, false, "i", playerid);
SetTimerEx("SparkCreate", CAMERA_MOVE_TIME-500, false, "ifffi", playerid, fHPos[0], fHPos[1], fHPos[2], object);
fHPos[0] -= (1 * floatsin(-Angle, degrees));
fHPos[1] -= (1 * floatcos(-Angle, degrees));
fOPos[0] += (1 * floatsin(-Angle, degrees));
fOPos[1] += (1 * floatcos(-Angle, degrees));
time = CAMERA_MOVE_TIME + floatround(CAMERA_MOVE_TIME * 0.15, floatround_round);
InterpolateCameraPos(playerid, fOPos[0], fOPos[1], fOPos[2], fHPos[0], fHPos[1], fHPos[2], time, CAMERA_MOVE);
}
return 1;
}
PHP Code:
forward CameraEnd(playerid);
public CameraEnd(playerid)
{
SetPlayerArmedWeapon(playerid, 34);
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
}
forward SparkCreate(playerid, Float:X, Float:Y, Float:Z, objectid);
public SparkCreate(playerid, Float:X, Float:Y, Float:Z, objectid)
{
SetTimerEx("Spark", 100, false, "i", CreateObject(18717, X, Y, Z - 1.6, 0.0, 0.0, 0.0) );
DestroyPlayerObject(playerid, objectid);
}
forward Spark(objectid);
public Spark(objectid) DestroyObject(objectid);
stock SetObjectFacePoint(playerid, objectid, Float: X, Float: Y)
{
static
Float: pX, Float: oX,
Float: pY, Float: oY,
Float: oZ
;
GetPlayerObjectRot(playerid, objectid, oX, oY, oZ);
GetPlayerObjectPos(playerid, objectid, pX, pY, oZ);
oZ = ( floatadd(atan2(floatsub(Y, pY), floatsub(X, pX)), 270.0) );
SetPlayerObjectRot(playerid, objectid, oX, oY, oZ);
}