creating an explosion in front of player in all sides?
#10

pawn Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
new Float:a;
GetPlayerPos(playerid, x, y, a);
GetPlayerFacingAngle(playerid, a);
if (GetPlayerVehicleID(playerid))
{
  GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
Usage:

pawn Код:
new Float:X, Float:Y, Float:Z;
GetXYInFrontOfPlayer(playerid, X, Y, Z);
CreateExplosion(X, Y, Z, 11, 10.0);
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 8 Guest(s)