Trucker job problem
#1

How do I make this work? I mean the part of the script on wich u can only pick up fuel when u carring a trailer, also the vehid that I have to put next to getvehicle have to be the veh modle or the id of the veh in server?
Код:
if(strcmp(cmd, "/buyfuel", true) == 0)
{
	if(PlayerInfo[playerid][pJob] != 16)
	{
		SendClientMessage(playerid, COLOR_GREY, "You are not a trucker.");
		return 1;
 	}
  else if(PlayerToPoint(25.0, playerid, 999.6520,-897.9469,42.2462))
  {
  	new oil;
  	oil = strval(tmp);
  	 new tmpcar = GetPlayerVehicleID(playerid)
     if(PlayerInfo[playerid][pOil] >= 100)
     {
     SendClientMessage(playerid, COLOR_GREY, "Your truck is filled up.");
     return 1;
     }
     else
     {
       if(GetPlayerMoney(playerid) < 499)
 		   {
       SendClientMessage(playerid, COLOR_GREY, "You dont have enought money ($500).");
       return 1;
       }
      else
      {
		  if (IsATruck(tmpcar))
       {
       if(GetVehicleTrailer(GetPlayerVehicleID(playerid) == 121))
       {
        SafeGivePlayerMoney(playerid, - 500);
	      PlayerInfo[playerid][pOil] = 100;
        format(string, sizeof(string), "You have filled your truck with fuel!", oil, oil * 150);
	      SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
 	  	  SaveOilSystem();
        return 1;
        }
      else 
        {
        format(string, sizeof(string), "You are not in a trailer.", oil, oil * 150);
	      SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        return 1;
        }
        }
       else
        {
        format(string, sizeof(string), "You are not in a truck.", oil, oil * 150);
	      SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	      }
	      }
	      }
	 }
	 return 1;
	 }
Reply


Messages In This Thread
Trucker job problem - by Amoken - 07.04.2009, 17:39
Re: Trucker job problem - by Amoken - 07.04.2009, 19:00
Re: Trucker job problem - by Amoken - 07.04.2009, 20:11
Re: Trucker job problem - by Amoken - 07.04.2009, 20:37

Forum Jump:


Users browsing this thread: 1 Guest(s)