Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Aldin Begovic poslato Decembar 29, 2011, 01:45:44 PRE PODNE

Naslov: [pomoc]komanda /fill
Poruka od: Aldin Begovic poslato Decembar 29, 2011, 01:45:44 PRE PODNE
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;
   }
Naslov: Odg: [pomoc]komanda /fill
Poruka od: poznaticovik poslato Decembar 29, 2011, 01:50:56 PRE PODNE
To je zcmd - cmd ? isto  ::)
Naslov: Odg: [pomoc]komanda /fill
Poruka od: Aldin Begovic poslato Decembar 29, 2011, 01:51:45 PRE PODNE
nezz dzo ! treba mi da bude ovako  if(!strcmp(cmdtext, "/fill", true))
Naslov: Odg: [pomoc]komanda /fill
Poruka od: poznaticovik poslato Decembar 29, 2011, 01:54:22 PRE PODNE
if(strcmp(cmd, "/fill", true) == 0)

to staviš u OnPlayerCommandText
Naslov: Odg: [pomoc]komanda /fill
Poruka od: Aldin Begovic poslato Decembar 29, 2011, 02:02:25 PRE PODNE
   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"
Naslov: Odg: [pomoc]komanda /fill
Poruka od: Mr.Gagi poslato Decembar 29, 2011, 10:53:47 PRE PODNE
   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.
Naslov: Odg: [pomoc]komanda /fill
Poruka od: Aldin Begovic poslato Decembar 29, 2011, 23:42:14 POSLE PODNE
kada kucam /fill izbaci mi ovako /fill koliko litara !
cim ukucam /fill 10 pise nepoznata komanda ! :/