Перейти к содержанию
Авторизация  
АвгустКоваль

Баг с продажей авто игроку

Рекомендуемые сообщения

АвгустКоваль

У меня есть проблема с командой /sellmycar 
При продаже авто, покупатель не может согласиться на покупку. Пишет то "Игрок слишком далеко" То "Вам нечего не предлагают" То "у игрока уже есть в этом слоте авто"

post-39465-0-73976600-1550074127_thumb.jpg

post-39465-0-76955400-1550074132_thumb.jpg

post-39465-0-17105300-1550074140_thumb.jpg

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
timch

Скидывайте команду/диалог.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Aleksey_Pronchenko
CMD:yes(playerid, params[])
{
new proposition_id = proposition_info[playerid][P_ING_ID];
new offer_type = proposition_info[playerid][P_INCOMING_TYPE];
 
new value_1 = proposition_info[playerid][P_INCOMING_VALUE];
//new value_2 = proposition_info[playerid][P_INCOMING_VALUE][1];
 
if(proposition_id != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(proposition_id))
{
if(proposition_info[proposition_id][P_OUT_ID] == playerid)
{
proposition_info[proposition_id] = g_proposition_default_values;
}
else offer_type = -1;
 
new Float: x, Float: y, Float: z;
new Float: dist;
 
GetPlayerPos(proposition_id, x, y, z);
dist = GetPlayerDistanceFromPoint(playerid, x, y, z);
 
if(dist <= 10.0)
{
new fmt_str[144];
 
switch(offer_type)
{
case PROPOSITION_TYPE_KISS:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 1.5)
{
new Float: to_x, Float: to_y;
new Float: angle;
 
GetPlayerPos(playerid, to_x, to_y, z);
angle = _GetAngleToPoint(x, y, to_x, to_y);
 
SetPlayerFacingAngle(playerid, angle);
SetPlayerFacingAngle(proposition_id, angle + 180.0);
 
format(fmt_str, sizeof fmt_str, "?????????(?) %s", GetName(proposition_id));
 
MeAction(playerid, fmt_str);
 
ApplyAnimation(proposition_id, "BD_FIRE","GRLFRD_KISS_03",4.0,0,0,0,0,0,1);
ApplyAnimation(playerid, "BD_FIRE","PLAYA_KISS_03",4.0,0,0,0,0,0,1);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_HUG:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 1.5)
{
new Float: to_x, Float: to_y;
new Float: angle;
 
GetPlayerPos(playerid, to_x, to_y, z);
angle = _GetAngleToPoint(x, y, to_x, to_y);
 
SetPlayerFacingAngle(playerid, angle);
SetPlayerFacingAngle(proposition_id, angle + 180.0);
 
format(fmt_str, sizeof fmt_str, "?????(?) %s", GetName(proposition_id));
 
MeAction(playerid, fmt_str);
 
ApplyAnimation(proposition_id, "BD_FIRE","GRLFRD_KISS_03",4.0,0,0,0,0,0,1);
ApplyAnimation(playerid, "BD_FIRE","PLAYA_KISS_03",4.0,0,0,0,0,0,1);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_HI:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 1.5)
{
new Float: to_x, Float: to_y;
new Float: angle;
 
GetPlayerPos(playerid, to_x, to_y, z);
angle = _GetAngleToPoint(x, y, to_x, to_y);
 
SetPlayerFacingAngle(playerid, angle);
SetPlayerFacingAngle(proposition_id, angle + 180.0);
 
format(fmt_str, sizeof fmt_str, "?????(?) ???? %s", GetName(proposition_id));
 
MeAction(playerid, fmt_str);
 
ApplyAnimation(proposition_id,"GANGS","hndshkfa",4.0,0,0,0,0,0);
ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_SELL_CAR:
{
if(0.5 <= dist <= 1.5)
{
new fmt_query[70+MAX_PLAYER_NAME], rows;
new Cache: result;
format(fmt_query, sizeof fmt_query, "SELECT * FROM ownable_cars WHERE owner_name='%s' AND slot=%d", GetName(playerid), ownable_car[PI[playerid][pOwnableCar]][v_slot]);
result = mysql_query(dbHandle, fmt_query);
 
                            rows = cache_num_rows();
 
if(rows) return SendClientMessage(proposition_id, C_RED, "? ?????? ??? ???? ?????????? ? ???? ?????"), cache_delete(result);
        cache_delete(result);
new  Float: car_x, Float: car_y, Float: car_z;
GetVehiclePos(PI[proposition_id][pOwnableCar], car_x, car_y, car_z);
 
if(!(IsPlayerInRangeOfPoint(playerid, 10.0, car_x, car_y, car_z) && IsPlayerInRangeOfPoint(proposition_id, 10.0, car_x, car_y, car_z)))
return SendClientMessage(proposition_id, 0xCECECEFF, "?? ? ???????? ?????? ?????????? ????? ??");
 
if(GetMoney(playerid) < value_1)
return SendClientMessage(playerid, C_RED, "? ??? ???????????? ?????");
 
                            GiveMoney(playerid, -value_1);
GiveMoney(proposition_id, value_1);
 
format(fmt_query, sizeof fmt_query, "%s ??????? ?????? ??? %s (%d) ?? %d ??????", GetName(proposition_id), GetCarName(GetVehicleModel(PI[proposition_id][pOwnableCar])), GetVehicleModel(PI[proposition_id][pOwnableCar]));
SendClientMessage(playerid, 0x66CC00FF, fmt_query);
 
format(fmt_query, sizeof fmt_query, "UPDATE ownable_cars SET `owner_name` = '%s' WHERE `id` = '%d'", GetName(playerid), ownable_car[PI[proposition_id][pOwnableCar]][v_sql]);
mysql_query(dbHandle, fmt_query);
 
if(IsValidDynamic3DTextLabel(ownable_car[PI[proposition_id][pOwnableCar]][v_label])) DestroyDynamic3DTextLabel(ownable_car[PI[proposition_id][pOwnableCar]][v_label]);
 
ownable_car[PI[proposition_id][pOwnableCar]][v_lock] =
ownable_car[PI[proposition_id][pOwnableCar]][v_virtual] =
ownable_car[PI[proposition_id][pOwnableCar]][v_sql] =
ownable_car[PI[proposition_id][pOwnableCar]][v_twinturbo] = 0;
format(ownable_car[PI[proposition_id][pOwnableCar]][v_owner], 32, "None");
ownable_car[PI[proposition_id][pOwnableCar]][v_model] =
ownable_car[PI[proposition_id][pOwnableCar]][v_color_1] =
ownable_car[PI[proposition_id][pOwnableCar]][v_color_2] =
ownable_car[PI[proposition_id][pOwnableCar]][v_fuel] =
ownable_car[PI[proposition_id][pOwnableCar]][v_slot] = -1;
ownable_car[PI[proposition_id][pOwnableCar]][v_pos_x] =
ownable_car[PI[proposition_id][pOwnableCar]][v_pos_y] =
ownable_car[PI[proposition_id][pOwnableCar]][v_pos_z] =
ownable_car[PI[proposition_id][pOwnableCar]][v_pos_r] = 0.0;
 
format(fmt_query, sizeof fmt_query, "?? ??????? ???? ????????? ?????? %s ?? %d ???", GetName(playerid), value_1);
SendClientMessage(proposition_id, 0x66CC00FF, fmt_query);
 
DestroyVehicle(PI[proposition_id][pOwnableCar]);
PI[proposition_id][pOwnableCar] = INVALID_VEHICLE_ID;
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
case PROPOSITION_TYPE_SELL_HOUSE:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 5.0)
{
if(GetMoney(playerid) < value_1)
return SendClientMessage(playerid, C_RED, "? ??? ???????????? ?????");
 
GiveMoney(playerid, -value_1);
GiveMoney(proposition_id, value_1);
 
new fmt_query[60+MAX_PLAYER_NAME];
 
format(fmt_query, sizeof fmt_query, "UPDATE house SET hOwner='%s' WHERE hOwner='%s'", GetName(playerid), GetName(proposition_id));
mysql_query(dbHandle, fmt_query);
 
strmid(HouseInfo[GetPVarInt(proposition_id, "PlayerHouse")][hOwner], GetName(playerid), 0, strlen(GetName(playerid)), MAX_PLAYER_NAME);
HouseInfo[GetPVarInt(proposition_id, "PlayerHouse")][hLock] = 1;
SetPVarInt(playerid, "PlayerHouse", GetPVarInt(proposition_id, "PlayerHouse"));
DeletePVar(proposition_id, "PlayerHouse");
 
format(fmt_query, sizeof fmt_query, "%s ??????? ?????? ??? ???? ??? ?? %d ??????", GetName(proposition_id), value_1);
SendClientMessage(playerid, 0x66CC00FF, fmt_query);
 
format(fmt_query, sizeof fmt_query, "?? ??????? ??????? ???? ??? %s ?? %d ??????", GetName(playerid), value_1);
SendClientMessage(proposition_id, 0x66CC00FF, fmt_query);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_SELL_BUSINESS:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 5.0)
{
if(GetMoney(playerid) < value_1)
return SendClientMessage(playerid, C_RED, "? ??? ???????????? ?????");
 
GiveMoney(playerid, -value_1);
GiveMoney(proposition_id, value_1);
 
new fmt_query[60+MAX_PLAYER_NAME];
 
format(fmt_query, sizeof fmt_query, "UPDATE bizz SET owner='%s' WHERE owner='%s'", GetName(playerid), GetName(proposition_id));
mysql_query(dbHandle, fmt_query);
 
strmid(BizzInfo[GetPVarInt(proposition_id, "PlayerBizz")][bOwner], GetName(playerid), 0, strlen(GetName(playerid)), MAX_PLAYER_NAME);
 
UpdateBizz(GetPVarInt(proposition_id, "PlayerBizz"));
 
SetPVarInt(playerid, "PlayerBizz", GetPVarInt(proposition_id, "PlayerBizz"));
 
format(fmt_query, sizeof fmt_query, "%s ??????? ?????? ??? ???? ?????? ?? %d ??????", GetName(proposition_id), value_1);
SendClientMessage(playerid, 0x66CC00FF, fmt_query);
 
format(fmt_query, sizeof fmt_query, "?? ??????? ??????? ???? ?????? %s ?? %d ??????", GetName(playerid), value_1);
SendClientMessage(proposition_id, 0x66CC00FF, fmt_query);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_SHOW_LIC:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 5.0)
{
new fmt_info[90];
 
format(fmt_info, sizeof fmt_info, "%s~n~%s~n~%s~n~%s",
PI[playerid][pLic][0] == 1 ? ("~r~~h~~h~???????????") : ("~g~~h~~h~???????"),
PI[playerid][pLic][2] == 1 ? ("~r~~h~~h~???????????") : ("~g~~h~~h~???????"),
PI[playerid][pLic][3] == 1 ? ("~r~~h~~h~???????????") : ("~g~~h~~h~???????"),
PI[playerid][pLic][1] == 1 ? ("~r~~h~~h~???????????") : ("~g~~h~~h~???????"));
 
PlayerTextDrawSetString(playerid, TDEditor_LICPLAYER[playerid], fmt_info);
 
//SelectTextDraw(playerid, 0x009900FF);
SelectTextDraw(playerid, 0xFFA500AA);
 
for(new i; i < sizeof TDEditor_LICGLOBAL; i ++) TextDrawShowForPlayer(playerid, TDEditor_LICGLOBAL);
PlayerTextDrawShow(playerid, TDEditor_LICPLAYER[playerid]);
 
if(PI[playerid][pSex] == 1) format(fmt_info, sizeof(fmt_info), "??????? ???? ???????? %s", GetName(playerid));
else format(fmt_info, sizeof(fmt_info), "???????? ???? ???????? %s", GetName(playerid));
MeAction(proposition_id, fmt_info);
 
SetPVarInt(playerid, "show_lic", 1);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
case PROPOSITION_TYPE_SHOW_PASS:
{
if(!(IsPlayerInAnyVehicle(playerid) && IsPlayerInAnyVehicle(proposition_id)))
{
if(0.5 <= dist <= 5.0)
{
new id[3];
 
format(id, sizeof id, "%d", playerid);
 
callcmd::pass(proposition_id, id);
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ??????? ?????? ?? ??????");
}
else SendClientMessage(playerid, 0xCECECEFF, "?? ???? ????? ?? ?????? ?????????? ? ??????????");
}
default:
SendClientMessage(playerid, 0x999999FF, "? ?????? ?????? ??? ?????? ?? ??????????");
}
}
else SendClientMessage(playerid, 0x999999FF, "????? ??????? ??????");
}
else SendClientMessage(playerid, 0x999999FF, "????? ????? ?? ????");
 
proposition_info[playerid] = g_proposition_default_values;
 
PI[proposition_id][pInteractionPlayer] = -1;
PI[playerid][pInteractionPlayer] = -1;
}
else SendClientMessage(playerid, 0x999999FF, "? ?????? ?????? ??? ?????? ?? ??????????");
 
return 1;
}


Или с этой кмд что-то

CMD:sellmycar(playerid, params[])
{
    if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, COLOR_WHITE, "{9ACD32}???????: {FFFFFF} /sellmycar [id ??????]");
else if(!IsPlayerConnected(params[0])) return SendMess(playerid, MSG_PLAYER_OFFLINE);
else if(PlayerLogged{params[0]} == false) return SendMess(playerid, MSG_PLAYER_NOT_LOGGED);
 
new rows, fmt_query[90];
new Cache: result;
mysql_format(dbHandle, fmt_query, sizeof fmt_query, "SELECT * FROM ownable_cars WHERE owner_name='%s'", GetName(playerid));
result = mysql_query(dbHandle, fmt_query);
rows = cache_num_rows();
 
if(!rows) return SendClientMessage(playerid, C_RED, "? ??? ??? ??????? ??????????"), cache_delete(result);
if(PI[playerid][pOwnableCar] == INVALID_VEHICLE_ID) return SendMess(playerid, MSG_NO_PLAYER_CREATE_CAR);
 
PI[playerid][pInteractionPlayer] = params[0];
ShowPlayerDialog(playerid, DIALOG_INTERACTION_SELL_CAR, DIALOG_STYLE_INPUT, "{ffcc00}??????? ??????? ??", "{ffffff}??????? ?????, ?? ??????? ?????? ??????? ???? ??:", "???????", "??????");
return 1;
}

Или с этой.

Если что пиши в вк vk.com/aleksey_pronchenko

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
АвгустКоваль

@#def,CMD:sellmycar(playerid, params[])

{
    if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, COLOR_WHITE, "{9ACD32}???????: {FFFFFF} /sellmycar [id ??????]");
else if(!IsPlayerConnected(params[0])) return SendMess(playerid, MSG_PLAYER_OFFLINE);
else if(PlayerLogged{params[0]} == false) return SendMess(playerid, MSG_PLAYER_NOT_LOGGED);
else if(!IsPlayerInRangeOfPlayer(10.0, playerid, params[0])) return SendClientMessage(playerid, COLOR_GRAY, "????? ??????? ??????!");
else if(GetPlayerState(params[0]) == PLAYER_STATE_SPECTATING) return SendClientMessage(playerid, COLOR_GRAY, "????? ??????? ??????!");
 
new rows, fmt_query[90];
new Cache: result;
mysql_format(dbHandle, fmt_query, sizeof fmt_query, "SELECT * FROM ownable_cars WHERE owner_name='%s'", GetName(playerid));
result = mysql_query(dbHandle, fmt_query);
rows = cache_num_rows();
 
    if(!rows)
    return SendClientMessage(playerid, C_RED, "? ??? ??? ??????? ??????????"), cache_delete(result);
if(PI[playerid][pOwnableCar] == INVALID_VEHICLE_ID) return SendMess(playerid, MSG_NO_PLAYER_CREATE_CAR);
 
PI[playerid][pInteractionPlayer] = params[0];
ShowPlayerDialog(playerid, DIALOG_INTERACTION_SELL_CAR, DIALOG_STYLE_INPUT, "{ffcc00}??????? ??????? ??", "{ffffff}??????? ?????, ?? ??????? ?????? ??????? ???? ??:", "???????", "??????");
return 1;

}

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Aleksey_Pronchenko

Исправил?

 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
timch

@АвгустКоваль, попробуйте увеличить диапазон расстояния ("IsPlayerInRangeOfPlayer" и "dist")

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
АвгустКоваль

@#def,Не работает 

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×

Важная информация

Мы разместили cookie-файлы на ваше устройство, чтобы помочь сделать этот сайт лучше. Вы можете изменить свои настройки cookie-файлов, или продолжить без изменения настроек.