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
Kucaj /buyprods i onda broj produkata i onda ćes ih imati....!
ne vredi nece.. dal iko zna?
daj vamo komandu /buyprods
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 ??? ?
Saljem ti na PM od mog gm sto je kod mene i meni sve radi...
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
BUMP
Dali je to tvoj mod ili edit?
edit...radilo je to sve samo mi smo preuredili mod i tek sad sam video taj bug i ne znam kako da resim
Pa kojeg onda se lakše orijentisat?
Brutal Public
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;
}