/createExplosion toward a player
#1

Hi i tried to make /createexplosion .
like this
pawn Код:
COMMAND:test(playerid, params[])
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        CreateExplosion(x,y + 1,z,11,10);
        SetTimerEx("First",300,false,"i",playerid);
        }
        forward First(playerid);
        public First(playerid)
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        CreateExplosion(x,y + 5,z,11,10);
        SetTimerEx("Secand",300,false,"i",playerid);
        }
        forward Secand(playerid);
        public Secand(playerid)
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        CreateExplosion(x,y + 10,z,11,10);
        SetTimerEx("Thired",300,false,"i",playerid);
        }
        forward Thired(playerid);
        public Thired(playerid)
        {
        new Float:x,Float:y,Float:z;
        GetPlayerPos(playerid,x,y,z);
        CreateExplosion(x,y + 15,z,11,10);
        }
The Problem that the Explosion move y + 1 and y + 5 ect ..
so that mean i need to make the explosion Get Player Facing Angle and Move into Player face .
Reply
#2

Anyone please ?
Reply
#3

maybe you should use this:

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));
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)