Consegui fazer, porйm quem estiver com a mesma dъvida futura aqui abaixo estб o cуdigo e obrigado a todos que tentaram ajudar
PHP код:
new Bala[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(GetPlayerAnimationIndex(playerid) && GetPlayerWeapon(playerid) == 34) {
new animlib[32], animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32);
if(!strcmp(animname, "GUN_STAND", true)) PlayerMirando[playerid] = true;
else PlayerMirando[playerid] = false;
}
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new Float:X, Float:Y, Float:Z, Float:Distancia;
GetPlayerPos(playerid, X, Y, Z);
if(PlayerMirando[playerid] == true) {
Bala[playerid] = CreateObject(19574, X-0.1, Y, Z+0.2, 0, 0, 0);
Distancia = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
MoveObject(Bala[playerid], fX, fY, fZ-(Distancia/51), 85.0, 0, 0, 0);
SetTimerEx("Explodir", floatround(Distancia*15, floatround_round), false, "fffd", fX, fY, fZ-(Distancia/51), playerid);
}
return 1;
}
forward Explodir(Float:fireX, Float:fireY, Float:fireZ, playerid);
public Explodir(Float:fireX, Float:fireY, Float:fireZ, playerid) {
CreateExplosion(fireX, fireY, fireZ, 12, 10.0);
DestroyObject(Bala[playerid]);
}