[Pomoc]Produkti

31. Avg. 2012.
386
pregleda
8
postova
SEJFO
5
Godfather
31. Avg. 2012.
Skripta koju koristim: BURPG (edit: Raven's)
Opis problema: Ako uzmes posao kamiondzije i sjednes u kamion da uzmes produkte znaci odmah cim sjedes pise Products: 0/0,ne znam nikako u cemu je problem,vec vise od pola sata probam rijesiti bug,isto tako i kada se kuca /buyprods
Dio skripte: Ako je potrebno dat cu

Hitno mi je potrebna pomoc za ovo,hvala unaprijed
The Woozie
5
Kingpin
31. Avg. 2012.
Mozda ti moze pomoci ova komanda iz mog ravens edit, probaj ovako:
if(strcmp(cmd, "/kupiprodukte", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
if(PlayerInfo == 16)
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 20;
if(IsPlayerInRangeOfPoint(playerid, 70, 2468.4919,-2092.9902,13.5469))
{
if(IsATruck(tmpcar) || IsATrucks(tmpcar))
{
if(PlayerHaul < PlayerHaul)
{
new amount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koriscenje: /buyprods ");
return 1;
}
amount = strval(tmp);
if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "  Ne mozete kupiti manje od jednog produkta!"); return 1; }
new check= PlayerHaul + amount;
if(check > PlayerHaul)
{
format(string, sizeof(string), "  To je vise nego sto moze da stane u vas kamion %d, trenutno nostite %d.",PlayerHaul,PlayerHaul);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new cost = amount*compcost;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul += amount;
format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Kupili ste %d produkata 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), "Nemate dovoljno novca za %d produkata po cijeni od $%d!", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Ovo vozilo ne dostavlja produkte.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Niste kod skladista.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Nemate posao kamiondzije!");
return 1;
}
}
return 1;
}

tu ti stavi svoj id posla itd..
SEJFO
5
Godfather
31. Avg. 2012.
S tom tvojom mi dodje 26 errora nesto ne stima,a isto sve

Evo ko zna pomoc moja komanda:
  	}

if(strcmp(cmd, "/buyprods", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 20;
if(IsPlayerInRangeOfPoint(playerid, 70, 2468.4919,-2092.9902,13.5469))
{
if(IsATruck(tmpcar))
{
if(PlayerHaul < PlayerHaul)
{
    new amount;
    tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "KUCAJ: /buyprods ");
return 1;
}
amount = strval(tmp);
if(amount < 1 || amount > 500) { SendClientMessage(playerid, COLOR_GREY, "  Ne mozete kupiti manje od 1,a vise od 500 produkata!"); return 1; }
new check= PlayerHaul + amount;
if(check > PlayerHaul)
{
    format(string, sizeof(string), "  Dostigao si Limit na utovaru %d, trenutno utovareno %d.",PlayerHaul,PlayerHaul);
    SendClientMessage(playerid, COLOR_GREY, string);
    return 1;
}
new cost = amount*compcost;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul += amount;
format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Kupio si %d Produkata za $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeJBC_GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "Ne mozete priustiti %d To kosta $%d!", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Produkti: %d/%d.", PlayerHaul,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Ne mozete Dostavljati produkte s ovim vozilom.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Niste na skladistu.");
return 1;
}
}
return 1;


A evo kad tek sjednem u kamion pise Products 0/0,evo taj dio:
}
  else if(IsATruck(newcar))
{
    if(PlayerInfo == 16)
{
format(string, sizeof(string), "Produkti: %d/%d", PlayerHaul,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SendClientMessage(playerid, COLOR_WHITE, "INFO: Dostavite produkte u gradske Firme.");
SendClientMessage(playerid, COLOR_WHITE, "INFO: Dostupne komande /load /buyprods /sellprods");
}
The Woozie
5
Kingpin
31. Avg. 2012.
Pri kraju ongamemodeinit u ravensu imas ovakvo nesto:
for(new i = 0; i < MAX_VEHICLES; i ++)
    {
    if(IsATruck(i))
    {
PlayerHaul = 100;
}
}

koliko je kod tebe capasity? ako je ovako i nije 0 onda nisi dobro vozila( tj kamion u tvom slucaju)
SEJFO
5
Godfather
31. Avg. 2012.
Opet isto
SEJFO
5
Godfather
31. Avg. 2012.
Sry za DP,zna li iko ovo rjesiti,stvarno mi je to bitno
Je li moguc problem ,jer sam prebacivao sa onih ID-ova na array?
Deleted User
Obrisan korisnik
31. Avg. 2012.
Naravno da jeste..
SEJFO
5
Godfather
31. Avg. 2012.
Quote from August 31, 2012, 4:47 pm:
Naravno da jeste..


Pa koji djavo trebam uradit' onda da bi radilo kako treba?

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha