SA-MP Forums Archive
Making a /flip command - 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: Making a /flip command (/showthread.php?tid=488837)



Making a /flip command - TheJoseph98 - 19.01.2014

Hello guys and girls,
I'm having a really hard time making a /flip command which flips vehicle on it's wheels.
I'm new to server scripting and I'd really like some help.
Thanks


Re: Making a /flip command - Nourdin - 19.01.2014

Try this:

pawn Код:
if(strcmp(cmdtext, "/flip", true) == 0)
  {
  if(IsPlayerInAnyVehicle(playerid))
  {
    new currentveh;
    new Float:angle;
    currentveh = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(currentveh, angle);
    SetVehicleZAngle(currentveh, angle);
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been flipped.");
  }
  else
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
  }
  return 1;
And if you use ZCMD:
pawn Код:
CMD:flip(player, params[])
{

  if(IsPlayerInAnyVehicle(playerid))
  {
    new currentveh;
    new Float:angle;
    currentveh = GetPlayerVehicleID(playerid);
    GetVehicleZAngle(currentveh, angle);
    SetVehicleZAngle(currentveh, angle);
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been flipped.");
  }
  else
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle.");
  }
  return 1;



Re: Making a /flip command - TheJoseph98 - 19.01.2014

It works! Thanks