Command Problem
#4

take the else out
pawn Код:
if(strcmp(cmd,"/tanken",true)==0)
{
  if(TankStation(playerid))
  {
   if(IsPlayerInAnyVehicle(playerid))
    {
      tmp = strtok(cmdtext, idx);
      new setin = strval(tmp);
      if(GetPlayerMoney(playerid) < 2*setin){
        SendClientMessage(playerid,FARBE_WEIЯ,"Du brauchst mindestens 2$ um zu tanken!"); //2 bucks a liter
        return 1;
          }
      if(!strlen(tmp))
       {
         SendClientMessage(playerid,FARBE_WEIЯ,"Benutzung: Benutze /tanken [menge]");
          return 1;
       }
      if(setin >= 101 || setin =< 0)
      {
        SendClientMessage(playerid,FARBE_WEIЯ,"Du kanntst nicht ьber 100 Liter tanken!"); //more or less than 1-100
        TogglePlayerControllable(playerid,1);
        return 1;
      }
      new summe = strval(tmp);
      new tString[64];
      TogglePlayerControllable(playerid,0);
      GivePlayerMoney(playerid,-setin*2);
      format(tString,sizeof(tString),"Du Tankst %d Liter und bezahlst dafьr $%d.",setin,summe*2);
      SendClientMessage(playerid,FARBE_GRЬN,tString); //give x amount of petrol
      SetTimerEx("TankZeit",2000,0, "dd", playerid, setin);
      return 1;
      }
     
     
     }
     else
     {
       SendClientMessage(playerid,FARBE_WEIЯ,"Du sitz nicht in einem Fahrzeug!");//not in car?
       return 1;
     }
   }
   else
   {
     SendClientMessage(playerid,FARBE_WEIЯ,"Du bist nicht an einer Tankstelle oder nicht nah genug dran!");//not at station
     return 1;
   }
  }
  return 1
}
how about that?
Reply


Messages In This Thread
Command Problem - by wofka13 - 05.06.2010, 21:42
Re: Command Problem - by (SF)Noobanatior - 05.06.2010, 22:18
Re: Command Problem - by wofka13 - 05.06.2010, 22:27
Re: Command Problem - by (SF)Noobanatior - 05.06.2010, 22:41
Re: Command Problem - by wofka13 - 05.06.2010, 22:58
Re: Command Problem - by (SF)Noobanatior - 05.06.2010, 23:03
Re: Command Problem - by wofka13 - 05.06.2010, 23:13
Re: Command Problem - by (SF)Noobanatior - 05.06.2010, 23:16
Re: Command Problem - by wofka13 - 05.06.2010, 23:17
Re: Command Problem - by (SF)Noobanatior - 05.06.2010, 23:22

Forum Jump:


Users browsing this thread: 1 Guest(s)