Skripta koju koristim:larp preradeni
Detaljan opis problema:pa komanda nemogu kupiti produkte a ujedno nemogu testirati /sellprods pa bi molio pomoc ako moze,da mi netko rijesi to jer se mucim vec par dana..Hvala
Dio skripte:
Citatif(strcmp(cmd, "/buyprods", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469))
{
if(GetVehicleModel(tmpcar) == 414 || GetVehicleModel(tmpcar) == 456 || GetVehicleModel(tmpcar) == 499)
{
if(PlayerInfo[playerid][pTruckLoad] < 200)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /buyprods [Ammount]");
return 1;
}
new amount = strval(tmp);
if(amount < 1 || amount > 200) { SendClientMessage(playerid, COLOR_GREY, " Can't buy less then 1 Product or more then 200 !"); return 1; }
new cost = amount*50;
if(GetPlayerMoney(playerid) > cost)
{
PlayerInfo[playerid][pTruckLoad] += amount;
format(string, sizeof(string), "You bought %d Products for $%d.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SafeGivePlayerMoney(playerid,-cost);
return 1;
}
else
{
format(string, sizeof(string), "You cant afford %d Products at $%d !", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle does not deliver Products.");
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/sellprods", true) == 0)
{
new cashmade;
new tmpcar;
if(IsPlayerConnected(playerid))
{
tmpcar = GetPlayerVehicleID(playerid);
if(!IsATruck(tmpcar))
{
GameTextForPlayer(playerid, "~r~Niste u vozilu za dostavljanje", 5000, 1);
return 1;
}
if(PlayerInfo[playerid][pTruckLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Kamion je prazan, vratite se i kupite produkte", 5000, 1);
format(string, sizeof(string), "Produkti: %d.", PlayerInfo[playerid][pTruckLoad]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10,BizzInfo[bEntranceX], BizzInfo[bEntranceY], BizzInfo[bEntranceZ]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(BizzInfo[bProducts] == BizzInfo[bMaxProducts])
{
GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo[bPriceProd] > BizzInfo[bTill])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerInfo[playerid][pTruckLoad]--;
BizzInfo[bProducts]++;
cashmade = cashmade+BizzInfo[bPriceProd];
//ConsumingMoney[playerid] = 1;
SafeGivePlayerMoney(playerid,BizzInfo[bPriceProd]);
BizzInfo[bTill] -= BizzInfo[bPriceProd];
if(PlayerInfo[playerid][pTruckLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d.", PlayerInfo[playerid][pTruckLoad]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
}
OnPropUpdate(3,i);
return 1;
}
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10,SBizzInfo[sbEntranceX], SBizzInfo[sbEntranceY], SBizzInfo[sbEntranceZ]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(SBizzInfo[sbProducts] == SBizzInfo[sbMaxProducts])
{
GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
if(SBizzInfo[sbPriceProd] > SBizzInfo[sbTill])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
SBizzInfo[sbProducts]++;
cashmade = cashmade+SBizzInfo[sbPriceProd];
//ConsumingMoney[playerid] = 1;
SafeGivePlayerMoney(playerid,SBizzInfo[sbPriceProd]);
SBizzInfo[sbTill] -= SBizzInfo[sbPriceProd];
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d.", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
OnPropUpdate(3,i);
return 1;
}
}
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
De malo pojasni svoj problem, navodno ove komande sto si postavio nisu uredu, tj. nema efekta kada kucas ove komande?
problem je u tome sto kada ja upisem /buyprods ne izbaci mi nista i kada dodem do ducana i /sellprods opet ne izbaci nista.Komandu sell jos nekako bi i rijesio imam ju ali stvar je u tome kada sam pokusavao komandu napraviti /buyprods uvijek mi pise produkti 0/0 pa ako mi se moze napraviti da igrac kada kuca /buyprods dobije produkte.pa cu poslje rijesavati /sellprods.