Need help with /tow command.
#1

I found this command on the forum but it doesn't work:

pawn Код:
cmd(tow, playerid, params[])
{
  new vehicle = GetPlayerVehicleID(playerid);
  if(IsPlayerConnected(playerid) && PlayerLoggedIn[playerid])
  {
    if(PlayerInfo[playerid][pJob] == 1)
    {
      if(GetVehicleModel(vehicle) == 525)
      {
        new Float:pXa, Float:pYa, Float:pZa;
        GetPlayerPos(playerid,pXa,pYa,pZa);
        new Float:vX, Float:vY, Float:vZ;
        new Found = 0;
        new vid = 0;
        while((vid < MAX_VEHICLES) && (!Found))
        {
          vid++;
          GetVehiclePos(vid,vX,vY,vZ);
          if((floatabs(pXa-vX) < 7.0) && (floatabs(pYa-vY) < 7.0) && (floatabs(pZa-vZ) < 7.0) && (vid != vehicle))
          {
            Found = 1;
            if(IsTrailerAttachedToVehicle(vehicle))
            {
              DetachTrailerFromVehicle(vehicle);
            }
            AttachTrailerToVehicle(vid,vehicle);
          }
        }
      }
    }
  }
  return 1;
}
The idea is to type /tow to attach and type /tow to detach but the detach part doesn't work so could you help me fix it ?

Thank you.
Reply


Messages In This Thread
Need help with /tow command. - by Zeromanster - 14.02.2010, 00:32
Re: Need help with /tow command. - by RoneyRemington - 14.02.2010, 00:39
Re: Need help with /tow command. - by RoneyRemington - 14.02.2010, 00:40
Re: Need help with /tow command. - by Zeromanster - 14.02.2010, 00:45
Re: Need help with /tow command. - by RoneyRemington - 14.02.2010, 01:04
Re: Need help with /tow command. - by mansonh - 14.02.2010, 07:06
Re: Need help with /tow command. - by Zeromanster - 14.02.2010, 12:59

Forum Jump:


Users browsing this thread: 2 Guest(s)