Rent Sitem


Započeo SanelPandzic, Maj 14, 2020, 18:55:59 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Nparavio sam rent sistem, u textdrawu,kada se pojai textdraw,igrac mora kliknuti na "IZABERI", i onda izabere koliko ce minuta rent, i onda poslije toga mora pritisnuti RENTAJ, i kada pritisne rentaj,igracu renta vozila na toliko minuta koliko je izabrao,problem je u tome npr igrac izabere na 45. minuta i kada stisne rentaj,njemu uvijek na 5. minuta renta.Ili sam nes zaboravio dodati ili nes nisam dobro uradio.
Dio skripte: Ovo je gdje igrac izabere u dialogu  koliko ce minuta.
if(dialogid == DIALOG_RENT)
		{
		if(!response) {  return 1; }
		if(response)
		{
		   if(listitem == 0)
		   {
		   new sstring[256],sstrall[256];
		   format(sstrall, sizeof(sstrall), "CIJENA RENTA:180.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall);
		   format(sstring, sizeof(sstring), "RENT MINUTA:5");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring);
		   PlayerInfo[playerid][pRentSel] = 1;
		   PlayerInfo[playerid][pRentSel1] = 1;
		   PlayerInfo[playerid][pRentSel2] = 0;
		   PlayerInfo[playerid][pRentSel3] = 0;
		   PlayerInfo[playerid][pRentSel4] = 0;
		   PlayerInfo[playerid][pRentSel5] = 0;
		   PlayerInfo[playerid][pRentSel6] = 0;
		   }
		   if(listitem == 1)
		   {
		   new sstring2[256],sstrall2[256];
		   format(sstrall2, sizeof(sstrall2), "CIJENA RENTA:360.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall2);
		   format(sstring2, sizeof(sstring2), "RENT MINUTA:10");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring2);
		   PlayerInfo[playerid][pRentSel] = 1;
		   PlayerInfo[playerid][pRentSel1] = 0;
		   PlayerInfo[playerid][pRentSel2] = 1;
		   PlayerInfo[playerid][pRentSel3] = 0;
		   PlayerInfo[playerid][pRentSel4] = 0;
		   PlayerInfo[playerid][pRentSel5] = 0;
		   PlayerInfo[playerid][pRentSel6] = 0;
		   }
		   if(listitem == 2)
		   {
  		   new sstring3[256],sstrall3[256];
		   format(sstrall3, sizeof(sstrall3), "CIJENA RENTA:500.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall3);
		   format(sstring3, sizeof(sstring3), "RENT MINUTA:15");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring3);
		   PlayerInfo[playerid][pRentSel] = 1;
		   PlayerInfo[playerid][pRentSel1] = 0;
		   PlayerInfo[playerid][pRentSel2] = 0;
		   PlayerInfo[playerid][pRentSel3] = 1;
		   PlayerInfo[playerid][pRentSel4] = 0;
		   PlayerInfo[playerid][pRentSel5] = 0;
		   PlayerInfo[playerid][pRentSel6] = 0;
		   }
		   if(listitem == 3)
		   {
  		   new sstring4[256],sstrall4[256];
		   format(sstrall4, sizeof(sstrall4), "CIJENA RENTA:750.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall4);
		   format(sstring4, sizeof(sstring4), "RENT MINUTA:30");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring4);
           PlayerInfo[playerid][pRentSel] = 1;
   	       PlayerInfo[playerid][pRentSel1] = 0;
		   PlayerInfo[playerid][pRentSel2] = 0;
		   PlayerInfo[playerid][pRentSel3] = 0;
		   PlayerInfo[playerid][pRentSel4] = 1;
		   PlayerInfo[playerid][pRentSel5] = 0;
		   PlayerInfo[playerid][pRentSel6] = 0;
		   }
		   if(listitem == 4)
		   {
		   new sstring5[256],sstrall5[256];
		   format(sstrall5, sizeof(sstrall5), "CIJENA RENTA:880.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall5);
		   format(sstring5, sizeof(sstring5), "RENT MINUTA:45");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring5);
		   PlayerInfo[playerid][pRentSel] = 1;
           PlayerInfo[playerid][pRentSel1] = 0;
		   PlayerInfo[playerid][pRentSel2] = 0;
		   PlayerInfo[playerid][pRentSel3] = 0;
		   PlayerInfo[playerid][pRentSel4] = 0;
		   PlayerInfo[playerid][pRentSel5] = 1;
		   PlayerInfo[playerid][pRentSel6] = 0;
		   }
		   if(listitem == 5)
		   {
  		   new sstring6[256],sstrall6[256];
		   format(sstrall6, sizeof(sstrall6), "CIJENA RENTA:1000.din");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][10], sstrall6);
		   format(sstring6, sizeof(sstring6), "RENT MINUTA:60");
		   PlayerTextDrawSetString(playerid, RentTD[playerid][7], sstring6);
		   PlayerInfo[playerid][pRentSel] = 1;
           PlayerInfo[playerid][pRentSel1] = 0;
		   PlayerInfo[playerid][pRentSel2] = 0;
		   PlayerInfo[playerid][pRentSel3] = 0;
		   PlayerInfo[playerid][pRentSel4] = 0;
		   PlayerInfo[playerid][pRentSel5] = 0;
		   PlayerInfo[playerid][pRentSel6] = 1;
		   }
		}
	  }r

Ovo je gdje igrac kada pritisne rentaj,njemu renta vozilo.
if(playertextid == RentTD[playerid][11])
    {
    	if(PlayerInfo[playerid][pRentSel] < 1) return SendClientMessage(playerid,-1,"Nisi izabrao koliko ces rentati!");
  		if(PlayerInfo[playerid][pRentSel1] < 1)
  		{
	       if(GetPlayerMoney(playerid) < 180) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 180. dinara");
		   NovacMinus(playerid,180);
		   SendClientMessage(playerid,-1,"Rentao si vozilo na 5. minuta, ukoliko zelis unrentovat ukucaj /unrent");
		   TogglePlayerControllable(playerid, 1);
		   Rent[playerid] = GetPlayerVehicleID(playerid);
		   RentVrijeme = 300;
           RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
	   		PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
	        new stringg5[256],strallg5[256];
	        format(strallg5, sizeof(strallg5), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], strallg5);
	        format(stringg5, sizeof(stringg5), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], stringg5);
	        return 1;
		}
  		if(PlayerInfo[playerid][pRentSel2] < 1)
  		{
            if(GetPlayerMoney(playerid) < 360) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 360. dinara");
	        NovacMinus(playerid,360);
	        SendClientMessage(playerid,-1,"Rentao si vozilo na 10. minuta, ukoliko zelis unrentovat ukucaj /unrent");
	        TogglePlayerControllable(playerid, 1);
	        Rent[playerid] = GetPlayerVehicleID(playerid);
	        RentVrijeme = 600;
            RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
   		    PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
            new string5s[256],strall5a[256];
	        format(strall5a, sizeof(strall5a), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], strall5a);
	        format(string5s, sizeof(string5s), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], string5s);
	        return 1;
  		}
  		if(PlayerInfo[playerid][pRentSel3] < 1)
  		{
	       if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 500. dinara");
		   NovacMinus(playerid,500);
		   SendClientMessage(playerid,-1,"Rentao si vozilo na 15. minuta, ukoliko zelis unrentovat ukucaj /unrent");
		   TogglePlayerControllable(playerid, 1);
		   Rent[playerid] = GetPlayerVehicleID(playerid);
		   RentVrijeme = 900;
           RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
	   		PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
	        new tstring5[256],estrall5[256];
	        format(estrall5, sizeof(estrall5), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], estrall5);
	        format(tstring5, sizeof(tstring5), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], tstring5);
	        return 1;
  		}
  		if(PlayerInfo[playerid][pRentSel4] < 1)
  		{
	       if(GetPlayerMoney(playerid) < 750) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 750. dinara");
		   NovacMinus(playerid,750);
		   SendClientMessage(playerid,-1,"Rentao si vozilo na 30. minuta, ukoliko zelis unrentovat ukucaj /unrent");
		   TogglePlayerControllable(playerid, 1);
		   Rent[playerid] = GetPlayerVehicleID(playerid);
		   RentVrijeme = 1800;
           RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
   		    PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
            new sttring5[256],sttrall5[256];
	        format(sttrall5, sizeof(sttrall5), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], sttrall5);
	        format(sttring5, sizeof(sttring5), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], sttring5);
	        return 1;
  		}
  		if(PlayerInfo[playerid][pRentSel5] < 1)
  		{
	       if(GetPlayerMoney(playerid) < 880) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 880. dinara");
		   NovacMinus(playerid,880);
		   SendClientMessage(playerid,-1,"Rentao si vozilo na 45. minuta, ukoliko zelis unrentovat ukucaj /unrent");
		   TogglePlayerControllable(playerid, 1);
		   Rent[playerid] = GetPlayerVehicleID(playerid);
		   RentVrijeme = 2700;
           RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
   		    PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
	   		new strinng5[256],straall5[256];
	        format(straall5, sizeof(straall5), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], straall5);
	        format(strinng5, sizeof(strinng5), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], strinng5);
	        return 1;
	 }
        if(PlayerInfo[playerid][pRentSel6] < 1)
  		{
		   if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid,-1,"Nemate dovoljno novca,potrebno vam je 1000. dinara");
		   NovacMinus(playerid,1000);
		   SendClientMessage(playerid,-1,"Rentao si vozilo na 60. minuta, ukoliko zelis unrentovat ukucaj /unrent");
		   TogglePlayerControllable(playerid, 1);
		   Rent[playerid] = GetPlayerVehicleID(playerid);
		   RentVrijeme = 3600;
           RentTimer[playerid] = SetTimer("UpdateTime", 1000, 1);
   		    PlayerTextDrawHide(playerid, RentTD[playerid][0]);
			PlayerTextDrawHide(playerid, RentTD[playerid][1]);
			PlayerTextDrawHide(playerid, RentTD[playerid][2]);
			PlayerTextDrawHide(playerid, RentTD[playerid][3]);
			PlayerTextDrawHide(playerid, RentTD[playerid][4]);
			PlayerTextDrawHide(playerid, RentTD[playerid][5]);
			PlayerTextDrawHide(playerid, RentTD[playerid][6]);
			PlayerTextDrawHide(playerid, RentTD[playerid][7]);
			PlayerTextDrawHide(playerid, RentTD[playerid][8]);
			PlayerTextDrawHide(playerid, RentTD[playerid][9]);
			PlayerTextDrawHide(playerid, RentTD[playerid][10]);
			PlayerTextDrawHide(playerid, RentTD[playerid][11]);
			PlayerTextDrawHide(playerid, RentTD[playerid][12]);
            new string555[256],strall555[256];
	        format(strall555, sizeof(strall555), "CIJENA RENTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][10], strall555);
	        format(string555, sizeof(string555), "RENT MINUTA:");
	        PlayerTextDrawSetString(playerid, RentTD[playerid][7], string555);
	        SavePlayer(playerid);
	        return 1;
	        }
	 }

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): [ code ]vaš odgovor[ /code ]
Slika/video ingame problema(obavezno ako je ingame problem): link slike