01.03.2016, 19:20
I use this.
There is blood on the ground but not in the wall as supposed to , what is wrong with this code? I have never worked with ColAndreas before any help is appreciated!
Code:
forward DestroyBlood(objectid);
public DestroyBlood(objectid)
{
DestroyDynamicObject(objectid);
}
stock CreateGroundBlood(playerid)
{
new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
GetPlayerPos(playerid, x, y, z);
if(CA_RayCastLineAngle(x, y, z, x, y, z - 2.0, x, y, z, rx, ry, rz))
return SetTimerEx("DestroyBlood", 1500, false, "d", CreateDynamicObject(19836, x, y, z, rx, ry, rz)), 1;
return 0;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER)
{
new Float:sx, Float:sy, Float:sz,
Float:rx, Float:ry, Float:rz;
GetPlayerCameraPos(playerid, sx, sy, sz);
new Float:x = fX - sx,
Float:y = fY - sy,
Float:z = fZ - sz;
new Float:d = VectorSize(x, y, z);
x /= d;
y /= d;
z /= d;
x *= 10.0;
y *= 10.0;
z *= 10.0;
if(CA_RayCastLineAngle(fX, fY, fZ, fX + x, fY + y, fZ + z, x, y, z, rx, ry, rz))
SetTimerEx("DestroyBlood", 1500, false, "d", CreateDynamicObject(19836, x, y, z, rx, ry, rz));
}
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
CreateGroundBlood(playerid);
return 1;
}


