pawn Код:
CMD:aexplode(playerid, params[]) {
new Float:X, Float:Y, Float:Z, Float:vX, Float:vY, Float:vZ, Float:oX, Float:oY, Float:oZ; //PlayerPos(3), CameraVectorPos(3), ObjectPos(3)..
const Float:fScale = 100.0; //The max distance
GetPlayerCameraPos(playerid, X, Y, Z); //Gets PlayerCameraPos
GetPlayerCameraFrontVector(playerid, vX, vY, vZ); //Gets PlayerCamerasFrontVector
oX = X + floatmul(vX, fScale); //Dunno D:
oY = Y + floatmul(vY, fScale); //Dunno D:
oZ = Z + floatmul(vZ, fScale); //Dunno D:
CreateExplosion(oX, oY, oZ, 3, 50); //Creates the explosion
return 1;
}
This works kinda the same as Konstantinos i guess xd
EDIT: You can use this, simplified verison or w.e
pawn Код:
CMD:aexplode(playerid, params[]) {
new Float:pPos[3], Float:vPos[3], Float:oPos[3];
const Float:fScale = 250.0; //The max distance
GetPlayerCameraPos(playerid, pPos[0], pPos[1], pPos[2]); //Gets PlayerCameraPos
GetPlayerCameraFrontVector(playerid, vPos[0], vPos[1], vPos[2]);
oPos[0] = pPos[0] + floatmul(vPos[0], fScale); //Dunno D:
oPos[1] = pPos[1] + floatmul(vPos[1], fScale); //Dunno D:
oPos[2] = pPos[2] + floatmul(vPos[2], fScale); //Dunno D:
CreateExplosion(oPos[0], oPos[1], oPos[2], 3, 50); //Creates the explosion
return 1;
}