12.06.2017, 13:05
PHP код:
new string[200], tstring[30], cstring[360];
if(WorkingTruck[playerid] == false) return SCM(playerid, COLOR_LIGHTRED, "You are not working.");
new choice[50];
new choice2;
if(sscanf(params,"s[50]", choice)) return SCM(playerid, COLOR_GREY,"[Usage:] /trucker [order/info/orders/take_order/deliver/place/cancel].");
{
if(strcmp(choice, "take_order", true) == 0)
{
if(sscanf(params, "i", choice2)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /trucker take_order [page]");//THIS LINE
if(choice2 == -1) return SendClientMessage(playerid, COLOR_LIGHTRED, "/trucker take_order [page]");
if(Delivering[playerid] == true) return SCM(playerid, COLOR_LIGHTRED, "You're in the middle of a delivery");
if(IsBizDelivering[playerid] == true) return SCM(playerid, COLOR_LIGHTRED, "You're in the middle of a business delivery");
new id = choice2;
if(id > 0 && id < 6)
{
new border[50];
format(border, sizeof(border), order[id][business_order]);
new ostring[50];
if(strcmp(border, "Weaponry Stocks", true))
{
productneeded[playerid] = 11;
format(ostring, sizeof(ostring), "Weaponry Stocks");
}
if(strcmp(border, "Vehicle Supplies", true))
{
productneeded[playerid] = 12;
format(ostring, sizeof(ostring), "Vehicle Supplies");
}
if(strcmp(border, "Furniture Parts", true))
{
productneeded[playerid] = 13;
format(ostring, sizeof(ostring), "Furniture Parts");
}
if(strcmp(border, "Grocery Products", true))
{
productneeded[playerid] = 14;
format(ostring, sizeof(ostring), "Grocery Products");
}
for(new i=0; i<17; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingZones[i][Factory_Area][0], TruckingZones[i][Factory_Area][1], TruckingZones[i][Factory_Area][2]))
{
for(new c=1; c<14; c++)
{
if(TruckingZones[i][Factory_Type] == c)
{
cargotype[playerid] = c;
}
}
}
}
format(string, sizeof(string), "You have took the order of %s with the certain product: %s", order[id][business_name], ostring);
SendClientMessage(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "Deliver the products to %s", order[id][business_location]);
SendClientMessage(playerid, COLOR_ORANGE, string);
strdel(order[id][business_name], 0, 50);
strdel(order[id][business_location], 0, 40);
strdel(order[id][business_order], 0, 30);
strdel(order[id][business_type], 0, 30);
order[id][business_id] = 0;
Delivering[playerid] = false;
IsBizDelivering[playerid] = true;
}
Код:
sscanf warning: No default value found.
PHP код:
if(sscanf(params,"s[50]", choice)) return SCM(playerid, COLOR_GREY,"[Usage:] /trucker [order/info/orders/take_order/deliver/place/cancel].");
{
if(strcmp(choice, "take_order", true) == 0)
{
if(sscanf(params, "i", choice2)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /trucker take_order [page]");//THIS LINE