Making a /flip command
#1

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

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

It works! Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)