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:
Quote
if(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 < 200)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /buyprods ");
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 += 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,PlayerHaul);
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 == 0)
{
GameTextForPlayer(playerid, "~r~Kamion je prazan, vratite se i kupite produkte", 5000, 1);
format(string, sizeof(string), "Produkti: %d.", PlayerInfo);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10,BizzInfo, BizzInfo, BizzInfo))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul; l > 0; l--)
{
if(BizzInfo == BizzInfo)
{
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);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo > BizzInfo)
{
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);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerInfo--;
BizzInfo++;
cashmade = cashmade+BizzInfo;
//ConsumingMoney = 1;
SafeGivePlayerMoney(playerid,BizzInfo);
BizzInfo -= BizzInfo;
if(PlayerInfo == 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);
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, SBizzInfo, SBizzInfo))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul; l > 0; l--)
{
if(SBizzInfo == SBizzInfo)
{
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,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
if(SBizzInfo > SBizzInfo)
{
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,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
PlayerHaul--;
SBizzInfo++;
cashmade = cashmade+SBizzInfo;
//ConsumingMoney = 1;
SafeGivePlayerMoney(playerid,SBizzInfo);
SBizzInfo -= SBizzInfo;
if(PlayerHaul == 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,PlayerHaul);
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;
}
{
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 < 200)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "INFO: /buyprods ");
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 += 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,PlayerHaul);
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 == 0)
{
GameTextForPlayer(playerid, "~r~Kamion je prazan, vratite se i kupite produkte", 5000, 1);
format(string, sizeof(string), "Produkti: %d.", PlayerInfo);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10,BizzInfo, BizzInfo, BizzInfo))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul; l > 0; l--)
{
if(BizzInfo == BizzInfo)
{
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);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
if(BizzInfo > BizzInfo)
{
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);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
PlayerInfo--;
BizzInfo++;
cashmade = cashmade+BizzInfo;
//ConsumingMoney = 1;
SafeGivePlayerMoney(playerid,BizzInfo);
BizzInfo -= BizzInfo;
if(PlayerInfo == 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);
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, SBizzInfo, SBizzInfo))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul; l > 0; l--)
{
if(SBizzInfo == SBizzInfo)
{
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,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
if(SBizzInfo > SBizzInfo)
{
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,PlayerHaul);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
PlayerHaul--;
SBizzInfo++;
cashmade = cashmade+SBizzInfo;
//ConsumingMoney = 1;
SafeGivePlayerMoney(playerid,SBizzInfo);
SBizzInfo -= SBizzInfo;
if(PlayerHaul == 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,PlayerHaul);
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):
