[pomoc]komanda /fill

Započeo Aldin Begovic, Decembar 29, 2011, 01:45:44 PRE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

mod koji koristim:GF
opis problema: Neznam da prebacim komandu iz zcmd u cmd ! moze li neko da mi prebaci! ja prebacim al ne radi !
Hvala
CMD:fill(playerid, params[])
   {
      if(IsPlayerInAnyVehicle(playerid))
      {
         if(IsAtGasStation(playerid))
         {

            new
            aFuel;

            if(sscanf(params, "i", aFuel)) return SendClientMessage(playerid, 0xEFEFF7AA, "{FFFFFF}Koristi:{AADD00} /fill <koliko litara>");
            else
            {
                  new fPrice = aFuel * 5 ;

               if(GetPlayerCash(playerid) >= fPrice)
               {
                  new
                  FuelLimit,
                  vID = GetPlayerVehicleID(playerid);

                  if(IsACar(vID)) FuelLimit = 40;
                  else if(IsABike(vID)) FuelLimit = 15;
                  else FuelLimit = 35;

                  if(FuelLimit >= (aFuel + vFuel[vID]))
                  {

                     GivePlayerCash(playerid, -fPrice);
                     vFuel[vID] = vFuel[vID] + aFuel;
                  }
                  else
                  {
                     new
                     pMsg[69];
                     format(pMsg, sizeof(pMsg), "U vase vozilo ne stane toliko goriva. U vase vozila stane max.: %i L", FuelLimit);
                     SendClientMessage(playerid, COLOR_RED, pMsg);
                  }
               }
               else SendClientMessage(playerid, COLOR_RED, "Nemas dovoljno novaca da kupis toliko litara goriva.");
            }

         }
         else
         {
            SCM( playerid, WHITE, "Nisi kod benzinske pumpe!" );
         }
      }
      else
      {
         SendClientMessage(playerid, 0xFF0000AA, "Moras biti u vozilu da koristis ovu komandu.");
      }

         return 1;
   }

poznaticovik


nezz dzo ! treba mi da bude ovako  if(!strcmp(cmdtext, "/fill", true))

poznaticovik

if(strcmp(cmd, "/fill", true) == 0)

to staviš u OnPlayerCommandText

   if(strcmp(cmd, "/fill", true) == 0)
     {
      if(IsPlayerInAnyVehicle(playerid))
      {
         if(IsAtGasStation(playerid))
         {

            new
            aFuel;

            if(sscanf(params, "i", aFuel)) return SendClientMessage(playerid, 0xEFEFF7AA, "{FFFFFF}Koristi:{AADD00} /fill <koliko litara>");
            else
            {
                  new fPrice = aFuel * 5 ;

               if(GetPlayerCash(playerid) >= fPrice)
               {
                  new
                  FuelLimit,
                  vID = GetPlayerVehicleID(playerid);

                  if(IsACar(vID)) FuelLimit = 40;
                  else if(IsABike(vID)) FuelLimit = 15;
                  else FuelLimit = 35;

                  if(FuelLimit >= (aFuel + vFuel[vID]))
                  {

                     GivePlayerCash(playerid, -fPrice);
                     vFuel[vID] = vFuel[vID] + aFuel;
                  }
                  else
                  {
                     new
                     pMsg[69];
                     format(pMsg, sizeof(pMsg), "U vase vozilo ne stane toliko goriva. U vase vozila stane max.: %i L", FuelLimit);
                     SendClientMessage(playerid, COLOR_RED, pMsg);
                  }
               }
               else SendClientMessage(playerid, COLOR_RED, "Nemas dovoljno novaca da kupis toliko litara goriva.");
            }

         }
         else
         {
            SCM( playerid, WHITE, "Nisi kod benzinske pumpe!" );
         }
      }
      else
      {
         SendClientMessage(playerid, 0xFF0000AA, "Moras biti u vozilu da koristis ovu komandu.");
      }

         return 1;
   }

C:\Documents and Settings\Administrator.C1F2B76B9\Desktop\New Folder\ST4lL V1.1\nov imod\gamemodes\ad.pwn(32485) : error 017: undefined symbol "cmd"
C:\Documents and Settings\Administrator.C1F2B76B9\Desktop\New Folder\ST4lL V1.1\nov imod\gamemodes\ad.pwn(32495) : error 017: undefined symbol "params"

Mr.Gagi

   if(strcmp(cmdtext, "/fill", true) == 0)
     {
      if(IsPlayerInAnyVehicle(playerid))
      {
         if(IsAtGasStation(playerid))
         {

            new
            aFuel;

            if(sscanf(cmdtext, "i", aFuel)) return SendClientMessage(playerid, 0xEFEFF7AA, "{FFFFFF}Koristi:{AADD00} /fill <koliko litara>");
            else
            {
                  new fPrice = aFuel * 5 ;

               if(GetPlayerCash(playerid) >= fPrice)
               {
                  new
                  FuelLimit,
                  vID = GetPlayerVehicleID(playerid);

                  if(IsACar(vID)) FuelLimit = 40;
                  else if(IsABike(vID)) FuelLimit = 15;
                  else FuelLimit = 35;

                  if(FuelLimit >= (aFuel + vFuel[vID]))
                  {

                     GivePlayerCash(playerid, -fPrice);
                     vFuel[vID] = vFuel[vID] + aFuel;
                  }
                  else
                  {
                     new
                     pMsg[69];
                     format(pMsg, sizeof(pMsg), "U vase vozilo ne stane toliko goriva. U vase vozila stane max.: %i L", FuelLimit);
                     SendClientMessage(playerid, COLOR_RED, pMsg);
                  }
               }
               else SendClientMessage(playerid, COLOR_RED, "Nemas dovoljno novaca da kupis toliko litara goriva.");
            }

         }
         else
         {
            SCM( playerid, WHITE, "Nisi kod benzinske pumpe!" );
         }
      }
      else
      {
         SendClientMessage(playerid, 0xFF0000AA, "Moras biti u vozilu da koristis ovu komandu.");
      }

         return 1;
   }

Umesto params mislim da moze da se koristi cmdtext probaj pa ces znati.

kada kucam /fill izbaci mi ovako /fill koliko litara !
cim ukucam /fill 10 pise nepoznata komanda ! :/