[Ajuda] Vender Veiculo
#1

Bom pessoal tipo muitos players vinheram me falando pra min colocar como fosse uma confirmaзгo para vender o veiculo

tipo tentei mas nn consegui alguem poderia ajudar

vo posta o code de vender o carro

Код:
else if(listitem == 4)
			{
              new vehicleid = GetOwnedVehicleID(playerid);
		      if (vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "[BEL] Vocк nгo Possui Veiculo.");
              new typeid = GetVehicleType(vehicleid);
              new VehPreco;
              if (typeid == VTYPE_CAR)
			  {
                  VehPreco = CAR_SELL_COST;
			      GivePlayerGP(playerid, CAR_SELL_COST);
			  }
              if (typeid == VTYPE_SPORT)
              {
                 VehPreco = SPORT_SELL_COST;
			     GivePlayerGP(playerid, SPORT_SELL_COST);
			  }
              if (typeid == VTYPE_MAV)
              {
                 VehPreco = MAV_SELL_COST;
			     GivePlayerGP(playerid, MAV_SELL_COST);
			  }
          	  if (typeid == VTYPE_HEAVY)
          	  {
                 VehPreco = TRUCK_SELL_COST;
				 GivePlayerGP(playerid, TRUCK_SELL_COST);
			  }
          	  if (typeid == VTYPE_BIKE)
          	  {
                 VehPreco = BIKE_SELL_COST;
				 GivePlayerGP(playerid, BIKE_SELL_COST);
			  }
         	  if (typeid == VTYPE_AIR)
         	  {
                 VehPreco = PLANE_SELL_COST;
			     GivePlayerGP(playerid, PLANE_SELL_COST);
			  }
        	  if (typeid == VTYPE_SEA)
        	  {
                 VehPreco = BOAT_SELL_COST;
			     GivePlayerGP(playerid, BOAT_SELL_COST);
			  }
          	  if (typeid == VTYPE_MOTORBIKE)
          	  {
                 VehPreco = MOTORBIKE_SELL_COST;
				 GivePlayerGP(playerid, MOTORBIKE_SELL_COST);
			  }
              if (typeid == VTYPE_MISC)
              {
                 VehPreco = MISC_SELL_COST;
			     GivePlayerGP(playerid, MISC_SELL_COST);
			  }
              format(string, sizeof string, "[BEL] Vocк vendeu seu carro e Ganhou R$ %d (Seu veiculo nгo era 0 KM).", VehPreco);
              SendClientMessage(playerid, COLOR_YELLOW, string);
	          VehicleInfo[vehicleid][vLock] = 0;
			  DeleteVehicle(playerid);
		      TextDrawShowForPlayer(playerid,tGP2[playerid]);
Reply
#2

pawn Код:
else if(listitem == 4) ShowPlayerDialog(playerid, 69, DIALOG_STILE_MSGBOX, "Confirmaзгo", "Silvio Santos Diz: Deseja mesmo vender seu veiculo?","Sim","Nao");

if(dialogid == 69)
{
if(!response) return SendClientMessage(playerid, -1, "Silvio santos ficou triste :'(");
else {
new vehicleid = GetOwnedVehicleID(playerid);
              if (vehicleid == INVALID_VEHICLE_ID) return SendClientMessage(playerid, COLOR_RED, "[BEL] Vocк nгo Possui Veiculo.");
              new typeid = GetVehicleType(vehicleid);
              new VehPreco;
              if (typeid == VTYPE_CAR)
              {
                  VehPreco = CAR_SELL_COST;
                  GivePlayerGP(playerid, CAR_SELL_COST);
              }
              if (typeid == VTYPE_SPORT)
              {
                 VehPreco = SPORT_SELL_COST;
                 GivePlayerGP(playerid, SPORT_SELL_COST);
              }
              if (typeid == VTYPE_MAV)
              {
                 VehPreco = MAV_SELL_COST;
                 GivePlayerGP(playerid, MAV_SELL_COST);
              }
              if (typeid == VTYPE_HEAVY)
              {
                 VehPreco = TRUCK_SELL_COST;
                 GivePlayerGP(playerid, TRUCK_SELL_COST);
              }
              if (typeid == VTYPE_BIKE)
              {
                 VehPreco = BIKE_SELL_COST;
                 GivePlayerGP(playerid, BIKE_SELL_COST);
              }
              if (typeid == VTYPE_AIR)
              {
                 VehPreco = PLANE_SELL_COST;
                 GivePlayerGP(playerid, PLANE_SELL_COST);
              }
              if (typeid == VTYPE_SEA)
              {
                 VehPreco = BOAT_SELL_COST;
                 GivePlayerGP(playerid, BOAT_SELL_COST);
              }
              if (typeid == VTYPE_MOTORBIKE)
              {
                 VehPreco = MOTORBIKE_SELL_COST;
                 GivePlayerGP(playerid, MOTORBIKE_SELL_COST);
              }
              if (typeid == VTYPE_MISC)
              {
                 VehPreco = MISC_SELL_COST;
                 GivePlayerGP(playerid, MISC_SELL_COST);
              }
              format(string, sizeof string, "[BEL] Vocк vendeu seu carro e Ganhou R$ %d (Seu veiculo nгo era 0 KM).", VehPreco);
              SendClientMessage(playerid, COLOR_YELLOW, string);
              VehicleInfo[vehicleid][vLock] = 0;
              DeleteVehicle(playerid);
              TextDrawShowForPlayer(playerid,tGP2[playerid]);
}
}
Reply
#3

Coloque esse cуdigo atual aliado ao ShowPlayerDialog

Ex:

Coloque isso no lugar desse cуdigo que vocк mandou

pawn Код:
ShowPlayerDialog(playerid,101,DIALOG_STYLE_MSGBOX,"Concessionбria","Vocк realmente deseja vender o seu veнculo?","Sim","Nгo");
E esse cуdigo que vocк mandou, vocк coloca em outro ID de OnPlayerDialogResponse.

Faзa as adaptaзхes necessбrias e pronto.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)