facing angle
#1

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?
Reply
#2

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;
}
Reply
#3

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

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
Reply
#5

Nope had no effect at all thanks for tring
Reply
#6

Bump
Reply
#7

Try removing SetVehiclePos.
Reply
#8

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?
Reply
#9

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

Thanks both of you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)