- 0
Sign in to follow this
Followers
0
Question
Лучший ответ
case dialog_SELLCAR_PLAYER_1:
{
if(response)
{
new id;
new money;
new string[256];
if(sscanf(inputtext, "p<,>ii", id, money)) return SCM(playerid, COLOR_WARNING, "Вы должны ввести ID игрока и цену.");
PLAYER_DATA[id][data_MONEY] = money;
PLAYER_DATA[id][data_Buy] = playerid;
PLAYER_DATA[id][data_Buy1] = id;
SetPVarInt(id, "sellerid", playerid);
format(string, sizeof(string), "Игрок %s хочет продать вам свой транспорт.\n Цена %d",PLAYER_DATA[playerid][data_NAME],money);
ShowPlayerDialogFix(id,dialog_SELLCAR_PLAYER_2,DIALOG_STYLE_MSGBOX,"{FFCC00}Продажа личного транспорта игроку",string,"Ок","Отмена");
printf("Диалог sellcar_player_1 работает");
}
}
case dialog_SELLCAR_PLAYER_2:
{
new id = GetPVarInt(playerid, "sellerid");
if(response)
{
new check = 0;
for (new c = 0; c < 3; ++c)
{
if(PLAYER_DATA[playerid][data_CAR][c])
{
check = 1;
PLAYER_DATA[playerid][data_CAR][c] = PLAYER_DATA[id][data_Buy1];
PLAYER_DATA[playerid][data_CAR][PLAYER_DATA[id][data_Buy1]] = 0;
SendClientMessage(playerid, -1, "Вы успешно купили авто!");
SendClientMessage(id, -1, "Игрок успешно купил авто!");
GivePlayerMoney(playerid, -PLAYER_DATA[playerid][data_MONEY]);
GivePlayerMoney(PLAYER_DATA[playerid][data_Buy],PLAYER_DATA[id][data_MONEY]);
}
}
if (!check)
{
SendClientMessage(id, -1, "Покупка отменена, у игрока нет слота для авто!");
}
}
else SendClientMessage(id, -1, !"Игрок отказался от покупки");
DeletePVar(playerid, "sellerid");
}-
UP, под себя чуток подстроишь там, как те над
This topic is now closed to further replies.
Sign in to follow this
Followers
0
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By vahag
RADMIR RP ORIGINAL MOD
Скачать файл RADMIR
MOD 2025/11/06
Добавил vahag Добавлено 12.11.2025 Категория Моды Автор GAGIK
-
-
By Oki_Doki
C:\Users\Àäìèíèñòðàòîð\Desktop\õç\gamemodes\russia.pwn(32) : fatal error 100: cannot read from file: "nex-ac"
Compilation aborted.
Pawn compiler 3.2.3664 Copyright (c) 1997-2016, ITB CompuPhase
1 Error.
Уже 20 мод я просто меняю название и фд,что делать??
-
DreamHarakiri P React разработчик 26
case dialog_SELLCAR_PLAYER: { if(response) { if(PLAYER_DATA[playerid][data_CAR][listitem] == 0) return SendClientMessage(playerid, COLOR_WARNING, "Данный слот пуст!"); print("1"); for(new i = 0; i < sizeof(autosalon_cars); i++) { print("2"); if(autosalon_cars[i][asModel] == PLAYER_DATA[playerid][data_CAR][listitem]) { print("3"); SetPVarInt(playerid,"sell_car",i); SetPVarInt(playerid, "sell_slot", listitem); ShowPlayerDialogFix(playerid,dialog_SELLCAR_PLAYER_1,DIALOG_STYLE_INPUT,"{FFCC00}Продажа личного транспорта игроку", "Введите ИД игрока и цену через запятую\nПример: 1,1000", "Продать","Отмена"); break; } print("4"); } } } case dialog_SELLCAR_PLAYER_1: { if(response) { new id; new money; new string[256]; if(sscanf(inputtext, "p<,>ii", id, money)) return SCM(playerid, COLOR_WARNING, "Вы должны ввести ID игрока и цену."); PLAYER_DATA[id][data_MONEY] = money; PLAYER_DATA[id][data_Buy] = playerid; PLAYER_DATA[id][data_Buy1] = id; format(string, sizeof(string), "Игрок %s хочет продать вам свой транспорт.\n Цена %d",PLAYER_DATA[playerid][data_NAME],money); ShowPlayerDialogFix(id,dialog_SELLCAR_PLAYER_2,DIALOG_STYLE_MSGBOX,"{FFCC00}Продажа личного транспорта игроку",string,"Ок","Отмена"); printf("Диалог sellcar_player_1 работает"); } } case dialog_SELLCAR_PLAYER_2: { if(response) { new id; GivePlayerMoney(playerid, -PLAYER_DATA[playerid][data_MONEY]); GivePlayerMoney(PLAYER_DATA[playerid][data_Buy],PLAYER_DATA[id][data_MONEY]); printf("Диалог sellcar_player_2 работает"); } } }Машина просто не передается
Share this post
Link to post