[Pomoc] s komandom /kupimats

Započeo 𝓒𝓪𝓼𝓮𝔂, Jun 11, 2013, 15:57:26 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Citat: [EM] Casey poslato Jun 11, 2013, 16:47:05 POSLE PODNE
Citat: [LX] BocaBajrovic (Bocilinjo!) poslato Jun 11, 2013, 16:45:11 POSLE PODNE
Posalji linije

27953       if(sscanf(inputtext, "i", kolicina))
27954       if(kolicina < 1 || kolicina > 250)
       {
Posalji taj ceo kod ovde ne vidim gresku

   if(dialogid == 1111)
   {
   if(response)
   {
    //    new kolicina, string[128];
       if(sscanf(inputtext, "i", kolicina))
       if(kolicina < 1 || kolicina > 250)
       {
           SPD(playerid, 1111, DIALOG_STYLE_INPUT, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");
           return 1;
       }
       PlayerInfo[playerid][pMats] += kolicina;
       GivePlayerMoney(playerid, kolicina*10);//npr kupis pet materi.. i to se mnozi sa deset i cijena je 50, sam postavi koliko zelis
       format(string, sizeof(string), "Kupio si %d materiala za $%d", kolicina, kolicina*10);
       SCM(playerid, -1, string);
       PlayerInfo[playerid][pMatsVrijeme] = 30*60;
   }
   }
Heaven Community [IN PROGRESS]

Aj probaj sad if(dialogid == 1111)
   {
   if(response)
   {
       new string[128];
       new kolicina = strval(inputtext);
       if(kolicina < 1 || kolicina > 250) { SPD(playerid, 1111, DIALOG_STYLE_INPUT, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");
           return 1;
       }
       PlayerInfo[playerid][pMats] += kolicina;
       GivePlayerMoney(playerid, kolicina*10);//npr kupis pet materi.. i to se mnozi sa deset i cijena je 50, sam postavi koliko zelis
       format(string, sizeof(string), "Kupio si %d materiala za $%d", kolicina, kolicina*10);
       SCM(playerid, -1, string);
       PlayerInfo[playerid][pMatsVrijeme] = 30*60;
   }
   }

C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27971) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 001: expected token: "-identifier-", but found "="
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : warning 215: expression has no effect
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.


znam resiti sam ovaj prvi ali ovo ne
Heaven Community [IN PROGRESS]


ne znam zasto toliko spamati kad su non stop iste linije boca


       new string[128];
       new kolicina = strval(inputtext);
       if(kolicina < 1 || kolicina > 250) { SPD(playerid, 1111, DIALOG_STYLE_INPUT, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");
           return 1;
       }
       PlayerInfo[playerid][pMats] += kolicina;
       GivePlayerMoney(playerid, kolicina*10);//npr kupis pet materi.. i to se mnozi sa deset i cijena je 50, sam postavi koliko zelis
       format(string, sizeof(string), "Kupio si %d materiala za $%d", kolicina, kolicina*10);
       SCM(playerid, -1, string);
       PlayerInfo[playerid][pMatsVrijeme] = 30*60;
   }
   }
Heaven Community [IN PROGRESS]

ovaj kod je dobar, jesi li siguran da ti tu daje erorre koje si naveo ?

da u tokm i jest stvar neznam kako
Heaven Community [IN PROGRESS]

aj daj ceo kod, ovo i nije bas ceo, daj ceo kod i errore uz taj kod, i tacno kazi koja linija je koj error

Citat: Blaeks poslato Jun 11, 2013, 17:43:37 POSLE PODNE
aj daj ceo kod, ovo i nije bas ceo, daj ceo kod i errore uz taj kod, i tacno kazi koja linija je koj error

Kodovi :

if(dialogid == 1111)
   {
   if(response)
   {
       new string[128];   // 27970
       new kolicina = strval(inputtext);  // 27971
       if(kolicina < 1 || kolicina > 250) { SPD(playerid, 1111, 1, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");       /27972
           return 1;
       }
       PlayerInfo[playerid][pMats] += kolicina;
       GivePlayerMoney(playerid, kolicina*10);//npr kupis pet materi.. i to se mnozi sa deset i cijena je 50, sam postavi koliko zelis
       format(string, sizeof(string), "Kupio si %d materiala za $%d", kolicina, kolicina*10);
       SCM(playerid, -1, string);
       PlayerInfo[playerid][pMatsVrijeme] = 30*60;
   }
   return 1;
}

////////////////////////////////////////////////////////////////////////////////////////////
errori ;

C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27970) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27971) : error 001: expected token: "-identifier-", but found "="
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : warning 215: expression has no effect
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.

Heaven Community [IN PROGRESS]

new kolicina; vako stavi za kolicinu
if(kolicina < 1 || kolicina > 250) { SPD(playerid, 1111, 1, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");       /27972
           return 1;
       }

umjesto toga ovo
if(kolicina < 1 || kolicina > 250)
{

SPD(playerid, 1111, DIALOG_STYLE_INPUT, "kupnja materiala", "upisi koliko zelis kupit materiala", "Kupi", "Odustani");       /27972
           return 1;
       }

if(dialogid == 1111)
   {
   if(response)
   {
       new nesto[128];   // 27970
       new kolicina;
if(sscanf(inputtext, "u", kolicina)) return SPD(playerid,1111,DIALOG_STYLE_INPUT,"kupnja matsa","upisi kolicinu za kupiti","Kupi","Odustani");
       PlayerInfo[playerid][pMats] += kolicina;
       GivePlayerMoney(playerid, kolicina*10);//npr kupis pet materi.. i to se mnozi sa deset i cijena je 50, sam postavi koliko zelis
       format(nesto, sizeof(nesto), "Kupio si %d materiala za $%d", kolicina, kolicina*10);
       SCM(playerid, -1, nesto);
       PlayerInfo[playerid][pMatsVrijeme] = 30*60;
   }
   return 1;
}


@benny: imas vec opomenu



C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27971) : error 001: expected token: "-identifier-", but found ";"
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27972) : error 001: expected token: ")", but found "return"
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27973) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27974) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27974) : warning 215: expression has no effect
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27974) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27974) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BEN\Desktop\sranje2.pwn(27974) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Heaven Community [IN PROGRESS]

iskoristi moj kod, tu neces naci gresaka

tvoj sam i koristio
hmm nezznam ni sam vise
Heaven Community [IN PROGRESS]