SA-MP Forums Archive
Help ... - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help ... (/showthread.php?tid=69157)



Help ... - Im_BanK - 16.03.2009

i have 1 Warning and i dono how to fix it

Here is the code:

pawn Код:
if(strcmp(cmd,"/tow",true)==0)
{
  if(IsPlayerConnected(playerid))
  {
   if(PlayerInfo[playerid][pJob] == 7)
   {
     if(IsPlayerInAnyVehicle(playerid))
     {
      if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525)
      {
        if(GetPlayerState(playerid)==2)
        {
         new Float:pX,Float:pY,Float:pZ;
         GetPlayerPos(playerid,pX,pY,pZ);
         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(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
           {
            Found=1;
            if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
            {
              DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
            }
            else
            {
              new carid = GetPlayerVehicleID(playerid);
              new Float:x,Float:y,Float:z;
              GetVehiclePos2(carid, x, y, z);
              if(GetVehiclePos2(carid, x, y, z)) HERE IS THE WARNING (D:\Jocuri\GTASAN~1\Server\GAMEMO~1\new1.pwn(17465) : warning 209: function "GetVehiclePos2" should return a value)
              {
               SendClientMessage(playerid, COLOR_YELLOW, "Car is not in need of a tow");
               return 1;
              }
              else
              {
               AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
               SendClientMessage(playerid, COLOR_GRAD2, "Tow the car to the Checkpoint shown on the minimap.");
               CP[playerid] = 22;
               SetPlayerCheckpoint(playerid,2185.7034,-1992.6033,13.4245,6.0);
              }
            }
           }
         }
         if(!Found)
         {
           SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
         }
        }
        else
        {
         SendClientMessage(playerid, COLOR_GRAD2, "You need to be the driver!");
         return 1;
        }
      }
      else
      {
        SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Tow truck to use this!");
        return 1;
      }
     }
     else
     {
       SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a vehicle to do this!");
       return 1;
     }
   }
   else
   {
     SendClientMessage(playerid,COLOR_GRAD2,"You need to be a Mechanic to use this!");
     return 1;
   }
  }
  return 1;
}



Re: Help ... - MenaceX^ - 16.03.2009

The warning is?


Re: Help ... - Im_BanK - 16.03.2009

D:\Jocuri\GTASAN~1\Server\GAMEMO~1\new1.pwn(17465) : warning 209: function "GetVehiclePos2" should return a value


Re: Help ... - [RP]Rav - 16.03.2009

at the end of that function, just before the final } add
Код:
return 1;