Question

Всем привет, у меня есть команда респавна авто, тобишь пишешь ее (( /car )), вылезает меню, где тебе показан список твоих автомобилей, и ты выбираешь какой заспавнить.

Проблема в том, что при спавне - авто открыто, даже если ввести команду /lock, при респавне авто будет открытым.

Так-же при респавне у автомобиля восстанавливается бензин, тобишь было 40, я зареспавнил и стало 50 ((  макс.кол-во ))

Команда:

CMD:car(playerid)
{
    if(antiflood[playerid] > 0) return SendClientMessage(playerid, COLOR_WARNING,"Не флуди!");
    antiflood[playerid]++;
    if(PLAYER_DATA[playerid][data_LOGGED] == false) return SendClientMessage(playerid,COLOR_WARNING,"Вы не авторизованы на сервере!");
	if(PLAYER_DATA[playerid][data_HOUSE] == INVALID_HOUSE_ID && PLAYER_DATA[playerid][data_KV] == INVALID_KV_ID) return SendClientMessage(playerid,COLOR_WARNING,"У Вас нет дома/квартиры!");

	new string[256];
	for(new c = 0; c < 3; c++)
	{
	    if(PLAYER_DATA[playerid][data_CAR][c] == 0)
	    {
	    	format(string,sizeof(string),"%s{FFFFFF}[%d] cвободно\n",string, c+1);
		}
		else
		{
		    format(string,sizeof(string),"%s{FFFFFF}[%d] Модель:%d\n",string, c+1, PLAYER_DATA[playerid][data_CAR][c]);
		}
	}
	ShowPlayerDialogFix(playerid,dialog_FIXCAR, DIALOG_STYLE_LIST, "{FFCC00}Гараж", string, "Выбрать", "Отмена");
	return true;
}

 

Share this post


Link to post

7 answers to this question

  • 0

Покажи enum data_CAR

Share this post


Link to post
  • 0

@MAXIMDELAET    Не нашел такого, и похожего тоже. Возможно вот он:

enum C_DATA
{
	Text3D:data_TEXT,
	data_RENT,
	data_ENG,
	data_LAMP,
	data_LOCK,
	data_ODOM,
	data_FUEL,
	Float:data_PosX,
	Float:data_PosY,
	Float:data_PosZ,
	data_ASH_TEST,
	data_GRUZ,
	data_KOLVO,
	data_PATR,
	data_MET,
	data_CREATE,
	data_RIGHT_B,
	data_LEFT_B,
	data_BLICK[4],
}

 

Share this post


Link to post
  • 0

Скинь case dialog_FIXCAR

Share this post


Link to post
  • 0
4 минуты назад, MAXIMDELAET сказал:

Скинь case dialog_FIXCAR

case dialog_FIXCAR:
	    {
	        if(!response) return true;
	        if(response)
	        {
	            new c = listitem;
             	if(PLAYER_DATA[playerid][data_CAR][c] == 0) return SendClientMessage(playerid,COLOR_WARNING,"Данный слот пуст!");

				if(PLAYER_DATA[playerid][data_VIP] == 0)
				{
					if(get_player_money(playerid) < 300) return SendClientMessage(playerid,COLOR_WARNING,"У Вас недостаточно денег на руках (300 рублей)");
	                give_player_money(playerid,-300,"#77");
                }
                
				new h = PLAYER_DATA[playerid][data_HOUSE],kv = PLAYER_DATA[playerid][data_PADIK];

				if(PLAYER_DATA[playerid][data_VEH] != INVALID_VEHICLE_ID) DestroyVehicle(PLAYER_DATA[playerid][data_VEH]);
			   	if(PLAYER_DATA[playerid][data_HOUSE] != INVALID_HOUSE_ID)
			   	{
			    	PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], HOUSE_DATA[h][data_CARX], HOUSE_DATA[h][data_CARY], HOUSE_DATA[h][data_CARZ],  HOUSE_DATA[h][data_CARANGLE], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
					ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
			    }
			    else if(PLAYER_DATA[playerid][data_KV] != INVALID_KV_ID)
			   	{
			   	    PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], KV_DATA[kv][data_CAR_POSX],  KV_DATA[kv][data_CAR_POSY],  KV_DATA[kv][data_CAR_POSZ],   KV_DATA[kv][data_CAR_POSA], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
			        ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
			   	}
				SendClientMessage(playerid,-1,"Транспорт был доставлен к дому");
	        }
	    }

 

Share this post


Link to post
  • 0
case dialog_FIXCAR:
	    {
	        if(!response) return true;
	        if(response)
	        {
	            new c = listitem;
             	if(PLAYER_DATA[playerid][data_CAR][c] == 0) return SendClientMessage(playerid,COLOR_WARNING,"Данный слот пуст!");

				if(PLAYER_DATA[playerid][data_VIP] == 0)
				{
					if(get_player_money(playerid) < 300) return SendClientMessage(playerid,COLOR_WARNING,"У Вас недостаточно денег на руках (300 рублей)");
	                give_player_money(playerid,-300,"#77");
                }
                
				new h = PLAYER_DATA[playerid][data_HOUSE],kv = PLAYER_DATA[playerid][data_PADIK];

				if(PLAYER_DATA[playerid][data_VEH] != INVALID_VEHICLE_ID) DestroyVehicle(PLAYER_DATA[playerid][data_VEH]);
			   	if(PLAYER_DATA[playerid][data_HOUSE] != INVALID_HOUSE_ID)
			   	{
			    	PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], HOUSE_DATA[h][data_CARX], HOUSE_DATA[h][data_CARY], HOUSE_DATA[h][data_CARZ],  HOUSE_DATA[h][data_CARANGLE], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
					ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
			    }
			    else if(PLAYER_DATA[playerid][data_KV] != INVALID_KV_ID)
			   	{
			   	    PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], KV_DATA[kv][data_CAR_POSX],  KV_DATA[kv][data_CAR_POSY],  KV_DATA[kv][data_CAR_POSZ],   KV_DATA[kv][data_CAR_POSA], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
			        ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
                  	CAR_DATA[car][data_LOCK] = 1;
			   	}
				SendClientMessage(playerid,-1,"Транспорт был доставлен к дому");
	        }
	    }

 

По поводу бензина, у тебя есть его сохранение?

Share this post


Link to post
  • 0
6 минут назад, MAXIMDELAET сказал:

case dialog_FIXCAR:
	    {
	        if(!response) return true;
	        if(response)
	        {
	            new c = listitem;
             	if(PLAYER_DATA[playerid][data_CAR][c] == 0) return SendClientMessage(playerid,COLOR_WARNING,"Данный слот пуст!");

				if(PLAYER_DATA[playerid][data_VIP] == 0)
				{
					if(get_player_money(playerid) < 300) return SendClientMessage(playerid,COLOR_WARNING,"У Вас недостаточно денег на руках (300 рублей)");
	                give_player_money(playerid,-300,"#77");
                }
                
				new h = PLAYER_DATA[playerid][data_HOUSE],kv = PLAYER_DATA[playerid][data_PADIK];

				if(PLAYER_DATA[playerid][data_VEH] != INVALID_VEHICLE_ID) DestroyVehicle(PLAYER_DATA[playerid][data_VEH]);
			   	if(PLAYER_DATA[playerid][data_HOUSE] != INVALID_HOUSE_ID)
			   	{
			    	PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], HOUSE_DATA[h][data_CARX], HOUSE_DATA[h][data_CARY], HOUSE_DATA[h][data_CARZ],  HOUSE_DATA[h][data_CARANGLE], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
					ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
			    }
			    else if(PLAYER_DATA[playerid][data_KV] != INVALID_KV_ID)
			   	{
			   	    PLAYER_DATA[playerid][data_VEH] = CreateVehicle(PLAYER_DATA[playerid][data_CAR][c], KV_DATA[kv][data_CAR_POSX],  KV_DATA[kv][data_CAR_POSY],  KV_DATA[kv][data_CAR_POSZ],   KV_DATA[kv][data_CAR_POSA], PLAYER_DATA[playerid][data_CAR_COLOR1][c], PLAYER_DATA[playerid][data_CAR_COLOR2][c], 360000);
					new car = PLAYER_DATA[playerid][data_VEH];
			        ClearCarData(car);
					CAR_DATA[car][data_FUEL] = 50;
                  	CAR_DATA[car][data_LOCK] = 1;
			   	}
				SendClientMessage(playerid,-1,"Транспорт был доставлен к дому");
	        }
	    }

 

По поводу бензина, у тебя есть его сохранение?

В БД?

Share this post


Link to post
  • 0
Только что, HAPKOMAH сказал:

В БД?

Да

Ты команду-то попробуй, должна спавнится закрытой.

Edited by MAXIMDELAET

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

    • nazikUA
      By nazikUA
      Добрый вечер, перевел мод на 0.3.7 и сервер крашит когда я подхожу к какому либо маппингу, можно ли как то это исправить?