Balkan SA:MP

PAWN skriptanje, gamemodovi, filterskripte, include fajlovi, mape, pluginovi => Razgovor u vezi PAWN - skriptanja => Temu započeo: Risticc poslato Februar 07, 2024, 18:30:22 POSLE PODNE

Naslov: Pomoc oko auto skola test
Poruka od: Risticc poslato Februar 07, 2024, 18:30:22 POSLE PODNE
E ovako, napravio sam sistem pismenog dela auto skole, medjutim sada mi nije jasno kako da fiksam bug da ne moze vise puta da se klikne na isto( jer bukvalno spamujes koliko bodova zelis da dobijes )... Ako stavim neke druge provere onda se sjebe zbog nekih drugih pitanja, ostavicu ovde prva 2 pitanja da bih znao kako da nastavim... Mozda je ocigledno ali ja to ne vidim, hvala svima

[pawn]      if (clickedid == ASTestTD[8]) {
          if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1 ) {
              if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_B") == 1 ) {
                  SetPVarInt(playerid, "kliknuto_A", 1);
                  SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                  if (PolaganjeBodovi[playerid] >= 0) {
                      PolaganjeBodovi[playerid]--;
                  }
                  TextDrawColor(ASTestTD[7], 0x7C7C7CFF);
                TextDrawShowForPlayer(playerid, ASTestTD[7]);
                  TextDrawColor(ASTestTD[8], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[8]);
              }
          }
      }

      if (clickedid == ASTestTD[7]) {
          if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1 ) {
              if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_A") == 1) {
                  SetPVarInt(playerid, "kliknuto_B", 1);
                  SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                  PolaganjeBodovi[playerid]++;
                  TextDrawColor(ASTestTD[8], 0x7C7C7CFF);
                TextDrawShowForPlayer(playerid, ASTestTD[8]);
                  TextDrawColor(ASTestTD[7], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[7]);
              }
          }
      }

      // 2 PITANJE
      if (clickedid == ASTestTD[14]) {
          if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1 ) {
              if (GetPVarInt(playerid, "dialog_POLAGANJE") == 2 || GetPVarInt(playerid, "kliknuto_B") == 1 ) {
                  SetPVarInt(playerid, "kliknuto_A", 1);
                  SetPVarInt(playerid, "dialog_POLAGANJE", 3);
                  if (PolaganjeBodovi[playerid] >= 0) {
                      PolaganjeBodovi[playerid]--;
                  }
                  TextDrawColor(ASTestTD[15], 0x7C7C7CFF);
                TextDrawShowForPlayer(playerid, ASTestTD[15]);
                  TextDrawColor(ASTestTD[14], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[14]);
              }
          }
      }

      if (clickedid == ASTestTD[15]) {
          if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1 ) {
              if (GetPVarInt(playerid, "dialog_POLAGANJE") == 2 || GetPVarInt(playerid, "kliknuto_A") == 1) {
                  SetPVarInt(playerid, "kliknuto_B", 1);
                  SetPVarInt(playerid, "dialog_POLAGANJE", 3);
                  PolaganjeBodovi[playerid]++;
                  TextDrawColor(ASTestTD[14], 0x7C7C7CFF);
                TextDrawShowForPlayer(playerid, ASTestTD[14]);
                  TextDrawColor(ASTestTD[15], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[15]);
              }
          }
      }
[/pawn]
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Goku ^ poslato Februar 07, 2024, 19:37:10 POSLE PODNE
Zasto ne stavis ako pogodi pitanje bodovi odu ++ ako promasi da nema kontakt sa bodovima stavio si ako promasi bodovi -- ako pogodi bodovi ++ zasto bi to radio?
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Risticc poslato Februar 07, 2024, 19:53:50 POSLE PODNE
To mogu, ali to nije resenje za ovo i dalje, jer i na tacnom odgovoru kad kliknes koliko god zelis puta i doda ti se toliko bodova koliko kliknes
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Bit Frosty poslato Februar 07, 2024, 20:59:41 POSLE PODNE
Stavis za textdraw selectable na false (tako da ne moze kliknuti) ???
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Risticc poslato Februar 08, 2024, 13:26:37 POSLE PODNE
Stavio sam, ali sad imam drugi problem nepoznat, kad kliknem na textdraw 9, pa na textdraw 10, i opet probam na 9, ne da mi znaci kao da je ugasen selectable?

[pawn]if (PolaganjePoceo[playerid] != 0) {
    if (clickedid == ASTestTD[9]) {
        if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1) {
            if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_B") == 1) {
                SetPVarInt(playerid, "kliknuto_A", 1);
                SetPVarInt(playerid, "kliknuto_B", 0); // Reset kliknuto_B
                SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                PolaganjeBodovi[playerid]++;
                TextDrawColor(ASTestTD[10], 0x808080FF);
                TextDrawShowForPlayer(playerid, ASTestTD[10]);
                TextDrawColor(ASTestTD[9], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[9]);
                TextDrawSetSelectable(ASTestTD[9], false);
                TextDrawSetSelectable(ASTestTD[10], true);
                SendInfoMessage(playerid, "Dodat bod");
            }
        }
    } else if (clickedid == ASTestTD[10]) {
        if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1) {
            if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_A") == 1) {
                SetPVarInt(playerid, "kliknuto_A", 0); // Reset kliknuto_A
                SetPVarInt(playerid, "kliknuto_B", 1);
                SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                TextDrawColor(ASTestTD[9], 0x808080FF);
                TextDrawShowForPlayer(playerid, ASTestTD[9]);
                TextDrawColor(ASTestTD[10], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[10]);
                TextDrawSetSelectable(ASTestTD[9], true);
                TextDrawSetSelectable(ASTestTD[10], false);
                SendInfoMessage(playerid, "Skinut bod");
            }
        }
    }
[/pawn]
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Bit Frosty poslato Februar 09, 2024, 22:57:41 POSLE PODNE
Citat: Risticc poslato Februar 08, 2024, 13:26:37 POSLE PODNE
Stavio sam, ali sad imam drugi problem nepoznat, kad kliknem na textdraw 9, pa na textdraw 10, i opet probam na 9, ne da mi znaci kao da je ugasen selectable?

[pawn]if (PolaganjePoceo[playerid] != 0) {
    if (clickedid == ASTestTD[9]) {
        if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1) {
            if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_B") == 1) {
                SetPVarInt(playerid, "kliknuto_A", 1);
                SetPVarInt(playerid, "kliknuto_B", 0); // Reset kliknuto_B
                SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                PolaganjeBodovi[playerid]++;
                TextDrawColor(ASTestTD[10], 0x808080FF);
                TextDrawShowForPlayer(playerid, ASTestTD[10]);
                TextDrawColor(ASTestTD[9], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[9]);
                TextDrawSetSelectable(ASTestTD[9], false);
                TextDrawSetSelectable(ASTestTD[10], true);
                SendInfoMessage(playerid, "Dodat bod");
            }
        }
    } else if (clickedid == ASTestTD[10]) {
        if (GetPVarInt(playerid, "dialog_POKRENUTTEST") == 1) {
            if (GetPVarInt(playerid, "dialog_POLAGANJE") == 1 || GetPVarInt(playerid, "kliknuto_A") == 1) {
                SetPVarInt(playerid, "kliknuto_A", 0); // Reset kliknuto_A
                SetPVarInt(playerid, "kliknuto_B", 1);
                SetPVarInt(playerid, "dialog_POLAGANJE", 2);
                TextDrawColor(ASTestTD[9], 0x808080FF);
                TextDrawShowForPlayer(playerid, ASTestTD[9]);
                TextDrawColor(ASTestTD[10], 0xE7204EFF);
                TextDrawShowForPlayer(playerid, ASTestTD[10]);
                TextDrawSetSelectable(ASTestTD[9], true);
                TextDrawSetSelectable(ASTestTD[10], false);
                SendInfoMessage(playerid, "Skinut bod");
            }
        }
    }
[/pawn]
O.O Pa sta je problem ako ti je poenta da ne mozes kliknuti 2x na isto??? :D
Naslov: Odg: Pomoc oko auto skola test
Poruka od: Risticc poslato Februar 10, 2024, 15:11:45 POSLE PODNE
reseno je,  lock.