lebed
Умник
Доброго времени суток пользователи п-и. У меня не сохраняются продукты в бизе после доставки их в бизнес развозчиком продуктов или бензовозчиком.
Мод MySQL
if(GetPVarInt(playerid, "FuelID") > 0)
{
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_GREY, "Вы должны прицепить трейлер!");
new i = FuelInfo[GetPVarInt(playerid, "FuelID")][pBizzid], playerd;
DestroyObject(GPSObject[playerid]);
Delete3DTextLabel(FuelInfo[GetPVarInt(playerid, "FuelID")][pText3D]);
BizzInfo[bProduct] += FuelInfo[GetPVarInt(playerid, "FuelID")][pTill];
PlayerInfo[playerid][pCash] += FuelInfo[GetPVarInt(playerid, "FuelID")][pPrice] / 2;
SendMes(playerid, TEAM_BLUE_COLOR, "Вы доставили %i продуктов для %s (%s)", FuelInfo[GetPVarInt(playerid, "FuelID")][pTill], BizzInfo[bName], FuelInfo[GetPVarInt(playerid, "FuelID")][pNamesss]);
sscanf(FuelInfo[GetPVarInt(playerid, "FuelID")][pNamesss], "u", playerd);
if(IsPlayerConnected(playerd))
{
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
SendMes(playerd, 0x006699FF, "Развозчик топлива {ffffff}%s {006699}выполнил ваш заказ", Name(playerid));
SendMes(playerd, 0x006699FF, "Кол-во: {ffffff}%i {006699}литров", FuelInfo[GetPVarInt(playerid, "FuelID")][pTill]);
SendMes(playerd, 0x006699FF, "Оплата: {ffffff}%i {006699}долларов", FuelInfo[GetPVarInt(playerid, "FuelID")][pPrice]);
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
}
for(new p = 0; p <= GetMaxPlayers(); p++)
{
if(!IsPlayerConnected(p) || GetPVarInt(p, "FuelID") == 0) continue;
if(GetPVarInt(p, "FuelID") > GetPVarInt(playerid, "FuelID")) SetPVarInt(p, "FuelID", GetPVarInt(p, "FuelID") - 1);
}
for(new p = GetPVarInt(playerid, "FuelID"); p <= TOTALPRODUCT - 1; p++)
{
strmid(FuelInfo[p][pNamesss],FuelInfo[p+1][pNamesss],0,strlen(FuelInfo[p+1][pNamesss]),MAX_PLAYER_NAME);
FuelInfo[p][pBizzid] = FuelInfo[p+1][pBizzid];
FuelInfo[p][pPrice] = FuelInfo[p+1][pPrice];
FuelInfo[p][pTill] = FuelInfo[p+1][pTill];
FuelInfo[p][pStatus] = FuelInfo[p+1][pStatus];
FuelInfo[p][pText3D] = FuelInfo[p+1][pText3D];
}
TOTALFUEL--;
DeletePVar(playerid, "FuelID");
DisablePlayerRaceCheckpoint(playerid);
}
if(GetPVarInt(playerid, "ProductID") > 0)
{
new i = ProductInfo[GetPVarInt(playerid, "ProductID")][pBizzid], playerd;
DestroyObject(GPSObject[playerid]);
Delete3DTextLabel(ProductInfo[GetPVarInt(playerid, "ProductID")][pText3D]);
BizzInfo[bProduct] += ProductInfo[GetPVarInt(playerid, "ProductID")][pTill];
PlayerInfo[playerid][pCash] += ProductInfo[GetPVarInt(playerid, "ProductID")][pPrice];
SendMes(playerid, TEAM_BLUE_COLOR, "Au ainoaaeee %i i?iaoeoia aey %s (%s)", ProductInfo[GetPVarInt(playerid, "ProductID")][pTill], BizzInfo[bName], ProductInfo[GetPVarInt(playerid, "ProductID")][pNamesss]);
sscanf(ProductInfo[GetPVarInt(playerid, "ProductID")][pNamesss], "u", playerd);
if(IsPlayerConnected(playerd))
{
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
SendMes(playerd, 0x006699FF, "?acaic?ee i?iaoeoia {ffffff}%s {006699}auiieiee aao caeac", Name(playerid));
SendMes(playerd, 0x006699FF, "Eie-ai: {ffffff}%i {006699}i?iaoeoia", ProductInfo[GetPVarInt(playerid, "ProductID")][pTill]);
SendMes(playerd, 0x006699FF, "Iieaoa: {ffffff}%i {006699}aieea?ia", ProductInfo[GetPVarInt(playerid, "ProductID")][pPrice]);
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
}
for(new p = 0; p <= GetMaxPlayers(); p++)
{
if(!IsPlayerConnected(p) || GetPVarInt(p, "ProductID") == 0) continue;
if(GetPVarInt(p, "ProductID") > GetPVarInt(playerid, "ProductID")) SetPVarInt(p, "ProductID", GetPVarInt(p, "ProductID") - 1);
}
for(new p = GetPVarInt(playerid, "ProductID"); p <= TOTALPRODUCT - 1; p++)
{
strmid(ProductInfo[p][pNamesss],ProductInfo[p+1][pNamesss],0,strlen(ProductInfo[p+1][pNamesss]),MAX_PLAYER_NAME);
ProductInfo[p][pBizzid] = ProductInfo[p+1][pBizzid];
ProductInfo[p][pPrice] = ProductInfo[p+1][pPrice];
ProductInfo[p][pTill] = ProductInfo[p+1][pTill];
ProductInfo[p][pStatus] = ProductInfo[p+1][pStatus];
ProductInfo[p][pText3D] = ProductInfo[p+1][pText3D];
}
for(new idx = 1; idx <= TOTALBIZZ; idx++)
{
UpdateBizz(idx);
TOTALPRODUCT--;
DeletePVar(playerid, "ProductID");
DisablePlayerRaceCheckpoint(playerid);
}
}
}
{
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, COLOR_GREY, "Вы должны прицепить трейлер!");
new i = FuelInfo[GetPVarInt(playerid, "FuelID")][pBizzid], playerd;
DestroyObject(GPSObject[playerid]);
Delete3DTextLabel(FuelInfo[GetPVarInt(playerid, "FuelID")][pText3D]);
BizzInfo[bProduct] += FuelInfo[GetPVarInt(playerid, "FuelID")][pTill];
PlayerInfo[playerid][pCash] += FuelInfo[GetPVarInt(playerid, "FuelID")][pPrice] / 2;
SendMes(playerid, TEAM_BLUE_COLOR, "Вы доставили %i продуктов для %s (%s)", FuelInfo[GetPVarInt(playerid, "FuelID")][pTill], BizzInfo[bName], FuelInfo[GetPVarInt(playerid, "FuelID")][pNamesss]);
sscanf(FuelInfo[GetPVarInt(playerid, "FuelID")][pNamesss], "u", playerd);
if(IsPlayerConnected(playerd))
{
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
SendMes(playerd, 0x006699FF, "Развозчик топлива {ffffff}%s {006699}выполнил ваш заказ", Name(playerid));
SendMes(playerd, 0x006699FF, "Кол-во: {ffffff}%i {006699}литров", FuelInfo[GetPVarInt(playerid, "FuelID")][pTill]);
SendMes(playerd, 0x006699FF, "Оплата: {ffffff}%i {006699}долларов", FuelInfo[GetPVarInt(playerid, "FuelID")][pPrice]);
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
}
for(new p = 0; p <= GetMaxPlayers(); p++)
{
if(!IsPlayerConnected(p) || GetPVarInt(p, "FuelID") == 0) continue;
if(GetPVarInt(p, "FuelID") > GetPVarInt(playerid, "FuelID")) SetPVarInt(p, "FuelID", GetPVarInt(p, "FuelID") - 1);
}
for(new p = GetPVarInt(playerid, "FuelID"); p <= TOTALPRODUCT - 1; p++)
{
strmid(FuelInfo[p][pNamesss],FuelInfo[p+1][pNamesss],0,strlen(FuelInfo[p+1][pNamesss]),MAX_PLAYER_NAME);
FuelInfo[p][pBizzid] = FuelInfo[p+1][pBizzid];
FuelInfo[p][pPrice] = FuelInfo[p+1][pPrice];
FuelInfo[p][pTill] = FuelInfo[p+1][pTill];
FuelInfo[p][pStatus] = FuelInfo[p+1][pStatus];
FuelInfo[p][pText3D] = FuelInfo[p+1][pText3D];
}
TOTALFUEL--;
DeletePVar(playerid, "FuelID");
DisablePlayerRaceCheckpoint(playerid);
}
if(GetPVarInt(playerid, "ProductID") > 0)
{
new i = ProductInfo[GetPVarInt(playerid, "ProductID")][pBizzid], playerd;
DestroyObject(GPSObject[playerid]);
Delete3DTextLabel(ProductInfo[GetPVarInt(playerid, "ProductID")][pText3D]);
BizzInfo[bProduct] += ProductInfo[GetPVarInt(playerid, "ProductID")][pTill];
PlayerInfo[playerid][pCash] += ProductInfo[GetPVarInt(playerid, "ProductID")][pPrice];
SendMes(playerid, TEAM_BLUE_COLOR, "Au ainoaaeee %i i?iaoeoia aey %s (%s)", ProductInfo[GetPVarInt(playerid, "ProductID")][pTill], BizzInfo[bName], ProductInfo[GetPVarInt(playerid, "ProductID")][pNamesss]);
sscanf(ProductInfo[GetPVarInt(playerid, "ProductID")][pNamesss], "u", playerd);
if(IsPlayerConnected(playerd))
{
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
SendMes(playerd, 0x006699FF, "?acaic?ee i?iaoeoia {ffffff}%s {006699}auiieiee aao caeac", Name(playerid));
SendMes(playerd, 0x006699FF, "Eie-ai: {ffffff}%i {006699}i?iaoeoia", ProductInfo[GetPVarInt(playerid, "ProductID")][pTill]);
SendMes(playerd, 0x006699FF, "Iieaoa: {ffffff}%i {006699}aieea?ia", ProductInfo[GetPVarInt(playerid, "ProductID")][pPrice]);
SendClientMessage(playerd, 0x006699FF, "[ - - - - - - - - - - - - - - - - - - - - - ]");
}
for(new p = 0; p <= GetMaxPlayers(); p++)
{
if(!IsPlayerConnected(p) || GetPVarInt(p, "ProductID") == 0) continue;
if(GetPVarInt(p, "ProductID") > GetPVarInt(playerid, "ProductID")) SetPVarInt(p, "ProductID", GetPVarInt(p, "ProductID") - 1);
}
for(new p = GetPVarInt(playerid, "ProductID"); p <= TOTALPRODUCT - 1; p++)
{
strmid(ProductInfo[p][pNamesss],ProductInfo[p+1][pNamesss],0,strlen(ProductInfo[p+1][pNamesss]),MAX_PLAYER_NAME);
ProductInfo[p][pBizzid] = ProductInfo[p+1][pBizzid];
ProductInfo[p][pPrice] = ProductInfo[p+1][pPrice];
ProductInfo[p][pTill] = ProductInfo[p+1][pTill];
ProductInfo[p][pStatus] = ProductInfo[p+1][pStatus];
ProductInfo[p][pText3D] = ProductInfo[p+1][pText3D];
}
for(new idx = 1; idx <= TOTALBIZZ; idx++)
{
UpdateBizz(idx);
TOTALPRODUCT--;
DeletePVar(playerid, "ProductID");
DisablePlayerRaceCheckpoint(playerid);
}
}
}
Мод MySQL
Последнее редактирование:
