Question

Remmi_Jefferson
Скриптер проекта Revin RP
Спойлер

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

4 answers to this question

  • 0
HAZZY
Свой человек
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, под себя чуток подстроишь там, как те над

Edited by HAZZY

Share this post


Link to post
  • 0
MuhammadPawn
Великий Гуру

так у тебя в диалоге dialog_SELLCAR_PLAYER_2 нету передачи авто -_-
За тебя тту не кто не будет писать код (как не кто не знает как работает твоя система) 

Edited by MuhammadPawn

Share this post


Link to post
  • 0
Remmi_Jefferson
Скриптер проекта Revin RP

@JustCup

Спойлер

if(PLAYER_DATA[playerid][data_CAR][c] == 0)
				    {
						PLAYER_DATA[playerid][data_CAR][c] = autosalon_cars[PLAYER_DATA[playerid][data_CHANGECAR]][asModel];
						PLAYER_DATA[playerid][data_CAR_COLOR1][c] = PLAYER_DATA[playerid][data_ONECOLOR_AS];
						PLAYER_DATA[playerid][data_CAR_COLOR2][c] = PLAYER_DATA[playerid][data_TWOCOLOR_AS];
					 	PLAYER_DATA[playerid][data_KOLESA][c] = 0;
						
						DestroyVehicle(PLAYER_DATA[playerid][data_AUTOSALON_CAR]);
						PLAYER_DATA[playerid][data_AUTOSALON_CAR] = INVALID_VEHICLE_ID;
						
						HideAutoSalonMenu(playerid);

						if(PLAYER_DATA[playerid][data_VEH] != INVALID_VEHICLE_ID) DestroyVehicle(PLAYER_DATA[playerid][data_VEH]), 		  Delete3DTextLabel(numbertext[PLAYER_DATA[playerid][data_VEH]]);
						PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], 418.539215, 340.131256, 11.812386, 324.069152, PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 36000);
						ClearCarData(PLAYER_DATA[playerid][data_VEH]);
                        PLAYER_DATA[playerid][data_CARFUEL][c] = 50;

 

При покупке нашел только это. Но не могу найти где здесь нужная строка с передачей транспорта 

@MuhammadPawn 

Share this post


Link to post
Guest
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

    • grizly57a
      By grizly57a
      1 захожу на сервер и не мой хост хотя в сервер коннекте я указал все свое
      2 выкидывает через секунду
      3 пишет Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.

      ----------
      Loaded log file: "server_log.txt".
      ----------
      SA-MP Dedicated Server
      ----------------------
      v0.3.7-R2, (C)2005-2015 SA-MP Team
      [15:50:16] weburl = "www.sa-mp.com"  (string)
      [15:50:16] 
      [15:50:16] Server Plugins
      [15:50:16] --------------
      [15:50:16]  Loading plugin: crashdetect.so
      [15:50:16]   CrashDetect plugin 4.19.4
      [15:50:16]   Loaded.
      [15:50:16]  Loading plugin: pawncmd.so
      [15:50:17] Pawn.CMD plugin v3.2.0 by urShadow has been loaded
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: pawnraknet.so
      [15:50:17] [Pawn.RakNet] plugin v1.6.0 loading...
      [15:50:17] [Pawn.RakNet] 
          | Pawn.RakNet 1.6.0 | 2016 - 2023
          |--------------------------------
          | Author and maintainer: katursis

          | Compiled: Feb 12 2023 at 19:35:06
          |--------------------------------------------------------------
          | Repository: https://github.com/katursis/Pawn.RakNet
          |--------------------------------------------------------------
          | Wiki: https://github.com/katursis/Pawn.RakNet/wiki
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: sscanf.so
      [15:50:17] 
      [15:50:17]  ===============================
      [15:50:17]       sscanf plugin loaded.     
      [15:50:17]          Version:  2.8.3        
      [15:50:17]   (c) 2018 Alex "Y_Less" Cole  
      [15:50:17]  ===============================
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: streamer.so
      [15:50:17] 
      *** Streamer Plugin v2.9.6 by Incognito loaded ***
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: mysql_static.so
      [15:50:17]  >> plugin.mysql: R39-6 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: profiler.so
      [15:50:17]   Profiler plugin 2.15.1
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: timerfix.so
      [15:50:17]   >> TimerFix v1.5 successfully loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: UTuning.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: housecar.so
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: TOTP.so
      [15:50:17] TOTP plugin v1.0.1 by Games loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loading plugin: FCNPC.so
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]      FCNPC - Fully Controllable NPC v2.0.11
      [15:50:17]             GNU/Linux SA-MP 0.3.7 R2
      [15:50:17]            Aug 23 2024 at 16:35:48
      [15:50:17] 
      [15:50:17]   Author:       OrMisicL (2013 - 2015)
      [15:50:17]   Continued by: ziggi    (2016 - present)
      [15:50:17] 
      [15:50:17]   See full credits in the README.md file
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] 
      [15:50:17] -------------------------------------------------
      [15:50:17]    ColAndreasv1.4.0
      [15:50:17] 
      [15:50:17]    Created By:
      [15:50:17]      [uL]Chris42O
      [15:50:17]      [uL]Slice
      [15:50:17]      [uL]Pottus
      [15:50:17] -------------------------------------------------
      [15:50:17] 
      [15:50:17] Loading...
      [15:50:17] ColAndreas v1.4.0 Loaded.
      [15:50:17]   Loaded.
      [15:50:17]  Loaded 13 plugins.
      [15:50:17] 
      [15:50:17] Filterscripts
      [15:50:17] ---------------
      [15:50:17]   Loading filterscript 'voice.amx'...
      [15:50:18] No collision data found.
      [15:50:18] 
      --------------------------------------
      [15:50:18]    VOICE COPY RADMIR BY Маттео dev.    
      [15:50:18] --------------------------------------
      [15:50:18]   Loaded 1 filterscripts.
      [15:50:20] ------------------------------------------
      [15:50:20]                  MELONITY AC                 
      [15:50:20] ------------------------------------------
      [15:50:20] weburl = "www.sa-mp.com"  (string)
      [15:50:20] [Vehicle]: Все транспортные средства созданы
      [15:50:20] [TP]: Все входы/выходы созданы
      [15:50:20] [ATM]: Все банкоматы созданы
      [15:50:20] Подключение к базе данных не удалось [Неизвестная ошибка. Код ошибки: -1]
      [15:50:20] -----------------------------------------
      [15:50:20]                                          
      [15:50:20]        CanVas Dev
      [15:50:20]                                          
      [15:50:20] -----------------------------------------
      [15:50:20] Number of vehicle models: 38
      [16:00:35] [connection] 93.159.241.195:1523 requests connection cookie.
      [16:00:36] [connection] incoming connection: 93.159.241.195:1523 id: 0
      [16:00:36] [join] Whoole_Daadadw has joined the server (0:93.159.241.195)
      [16:00:36] [part] Whoole_Daadadw has left the server (0:2)