SA-MP Forums Archive
facing angle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: facing angle (/showthread.php?tid=298452)



facing angle - manchestera - 20.11.2011

Ok i got a flip cmd but it set it to 0.0 where i want it to get there faceingangle and use that this is the cmd.

Код:
CMD:flip(playerid, params[])
{
      new VehicleID, Float:X, Float:Y, Float:Z;
      GetPlayerPos(playerid, X, Y, Z);
	  VehicleID = GetPlayerVehicleID(playerid);
      SetVehiclePos(VehicleID, X, Y, Z);
      SetVehicleZAngle(VehicleID, 0);
      return 1;
}
So i know i need to use GetPlayerFacingAngle and then setPlayerfacingAngle but if u look in the cmd ive got Float:X,Y,Z what do i need to put for facingangle?


Re: facing angle - MP2 - 20.11.2011

pawn Код:
CMD:flip(playerid, params[])
{
    if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, 0xFF0000FF, "You are not driving a vehicle.");
    new Float:A;
    new VehicleID = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(VehicleID, A);
    SetVehicleZAngle(VehicleID, A);
    return 1;
}



Re: facing angle - manchestera - 20.11.2011

Didnt work it compiled fine but when i tested it ingame it stil setting it to north (o.o)

Код:
if ((newkeys & KEY_LOOK_RIGHT) && (newkeys & KEY_LOOK_LEFT))
	{
      new VehicleID, Float:X, Float:Y, Float:Z;
      new Float:A;
      GetPlayerPos(playerid, X, Y, Z);
      GetVehicleZAngle(VehicleID, A);
	  VehicleID = GetPlayerVehicleID(playerid);
      SetVehiclePos(VehicleID, X, Y, Z);
      SetVehicleZAngle(VehicleID, A);
      }



Re: facing angle - IceCube! - 20.11.2011

pawn Код:
if ((newkeys & KEY_LOOK_RIGHT) && (newkeys & KEY_LOOK_LEFT))
    {    
                           new VehicleID,Float:A;        
                             VehicleID = GetPlayerVehicleID(playerid);
                              GetVehicleZAngle(VehicleID,A);
                              SetVehicleZAngle(VehicleID,A);
               
          }
[/QUOTE]

Try that


Re: facing angle - manchestera - 20.11.2011

Nope had no effect at all thanks for tring


Re: facing angle - manchestera - 21.11.2011

Bump


Re: facing angle - MP2 - 21.11.2011

Try removing SetVehiclePos.


Re: facing angle - Sinner - 21.11.2011

You don't need all that for a flip command, try this:

pawn Код:
CMD:flip(playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid)) {
        new Float:angle, vehid;
        vehid = GetPlayerVehicleID(playerid);
        GetVehicleZAngle(vehid, angle);
        SetVehicleZAngle(vehid, angle);
    } else {
        SendClientMessage(playerid, 0xFF0000, "You need to be in a vehicle to use this command!");
    }
}
Quote:
Originally Posted by MP2
Посмотреть сообщение
Try removing SetVehiclePos.
What kind of a stupid advise is that?


Re: facing angle - MP2 - 21.11.2011

Thats exactly what you did with that code so shut your mouth.


Re: facing angle - manchestera - 21.11.2011

Thanks both of you