[Pomoc] Posao Kamiondzija


Započeo Zeljko26, Maj 20, 2012, 00:03:40 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: nesto ja i drug poksuavamo :D
Opis problema: e ovkao stalno mi stoji za produkte 0/0 kad kucam /buyprods 50 npr opet 0/0 pokusao sam svasta al nisam usepo
Deo skripte: ako treba nesto stavicu
Slika: http: http://ultraphoto.org/viewer.php?file=9ur99utnn4h7e7dzk3aq.png

Unapred Hvala  :D
Poslednja Izmena: Maj 20, 2012, 10:07:48 PRE PODNE od Zeljko26

Kucaj /buyprods i onda broj produkata i onda ćes ih imati....!


daj vamo komandu /buyprods
Respect: Gagi, Maki187, Phillips, TerminuS, Neno, Lepotic, [AL] K4[Я]!K3â,,¢, Gotti747

Evo
if(strcmp(cmd, "/buyprods", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new tmpcar = GetPlayerVehicleID(playerid);
			new compcost = 20;
			if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469))
			{
				if(IsATruck(tmpcar))
				{
					if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
					{
					    new amount;
					    tmp = strtok(cmdtext, idx);
						if(!strlen(tmp))
						{
							SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /buyprods [amount]");
							return 1;
						}
						amount = strval(tmp);
						if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete kupiti manje od 1 ni vise od 500 produkata!"); return 1; }
						new check= PlayerHaul[tmpcar][pLoad] + amount;
						if(check > PlayerHaul[tmpcar][pCapasity])
						{
						    format(string, sizeof(string), "   Presli ste preko limita za kamion od %d, sada vozite %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
						    SendClientMessage(playerid, COLOR_GREY, string);
						    return 1;
						}
						new cost = amount*compcost;
						if(GetPlayerMoney(playerid) >= cost)
						{
							PlayerHaul[tmpcar][pLoad] += amount;
							format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							format(string, sizeof(string), "Kupili ste %d Produkte za $%d.", amount,cost);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							SafeGivePlayerMoney(playerid,-cost);
							PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
							return 1;
						}
						else
						{
							format(string, sizeof(string), "Ne mozete da priustite %d Produkata za $%d!", amount,cost);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							return 1;
						}
					}
					else
					{
							format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
							SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
							return 1;
					}
				}
				else
				{
					SendClientMessage(playerid, TEAM_GROVE_COLOR, "Ne mozete vrsiti dostavu produkata sa ovim vozilom.");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place.");
				return 1;
			}
		}
		return 1;
	}

Niko ne zna ??? ?
Poslednja Izmena: Maj 20, 2012, 12:15:43 POSLE PODNE od Zeljko26

Saljem ti na PM od mog gm sto je kod mene i meni sve radi...
Poslednja Izmena: Maj 20, 2012, 12:21:24 POSLE PODNE od Boki_Bokic

ne vredi ne razumem zasto.. kad kucam npr /buyprods 50 izadje Produkti:0/0 kucam /buyprods 100 isto kolko god da upisem isto
http://www.zaslike.com/viewer.php?file=mtwpnbo844b8ue507w3j.png



edit...radilo je to sve samo mi smo preuredili mod i tek sad sam video taj bug i ne znam kako da resim
Poslednja Izmena: Maj 20, 2012, 23:34:53 POSLE PODNE od Zeljko26



if(strcmp(cmd, "/buyprods", true) == 0)
   {
       if(IsPlayerConnected(playerid))
      {
         new tmpcar = GetPlayerVehicleID(playerid);
         new compcost = 20;
         if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469))
         {
            if(IsATruck(tmpcar))
            {
               if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
               {
                   new amount;
                   tmp = strtok(cmdtext, idx);
                  if(!strlen(tmp))
                  {
                     SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /buyprods [amount]");
                     return 1;
                  }
                  amount = strval(tmp);
                  if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "   Ne mozete kupiti manje od 1 ni vise od 500 produkata!"); return 1; }
                  new check= PlayerHaul[tmpcar][pLoad] + amount;
                  if(check > PlayerHaul[tmpcar][pCapasity])
                  {
                      format(string, sizeof(string), "   Presli ste preko limita za kamion od %d, sada vozite %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
                      SendClientMessage(playerid, COLOR_GREY, string);
                      return 1;
                  }
                  new cost = amount*compcost;
                  if(GetPlayerMoney(playerid) >= cost)
                  {
                     PlayerHaul[tmpcar][pLoad] += amount;
                     format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                     SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                     format(string, sizeof(string), "Kupili ste %d Produkte za $%d.", amount,cost);
                     SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                     SafeGivePlayerMoney(playerid,-cost);
                     PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                     return 1;
                  }
                  else
                  {
                     format(string, sizeof(string), "Ne mozete da priustite %d Produkata za $%d!", amount,cost);
                     SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                     return 1;
                  }
               }
               else
               {
                     format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
                     SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
                     return 1;
               }
            }
            else
            {
               SendClientMessage(playerid, TEAM_GROVE_COLOR, "Ne mozete vrsiti dostavu produkata sa ovim vozilom.");
               return 1;
            }
         }
         else
         {
            SendClientMessage(playerid, COLOR_GREY, "You are not in trucker place.");
            return 1;
         }
      }
      return 1;
   }