Jump to content
  • 0

Problema dealership system


Gawitkkk

Question

Văd că celălalt topic mi-a fost închis, de cine? Nu știu, însă vă mulțumesc că așa "ajutați" voi.

 

Refac încă odată topicul..

 

- Problema intalnita (descriere): Nu este o problemă, ci o întrebare.

În prezent, sistemul meu de dealership (comanda /buyvehicle) funcționeaza pe DIALOG_STYLE_LIST (poza).

Și aș vrea să îl mut pe DIALOG_STYLE_INPUT, și aș vrea să arate ceva de genu(poza). 

- Ero(area / rile) / warning-(ul / urile): -
- Liniile de cod / sursa / script-ul(obligatoriu):

Comanda actuala de cumpărare a mașinii din dealership:

 

 

CMD:buyvehicle(playerid, params[])
{
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Please get out of the car.");
if(IsPlayerInRangeOfPoint(playerid, 7.0, 321.6544,-1521.1111,36.0391))
{
if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You need to be level 3 to buy a vehicle.");
ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Vehicle:", "Low VehiclesnMedium VehiclenSport VehiclesnBikenAir vehiclesnSpecial Vehicles", "Select", "Close");
}
else return SCM(playerid,COLOR_WHITE,"{3850F1}You have to be at a vehicle dealership.");
 return 1;
}

 

Cel mai amplu răspuns a fost acesta:

 

Daca doresti sa faci ca pe B-ZONE, ai nevoie de DIALOG_STYLE_MSGBOX si dupa aceea sa folosesti DIALOG_STYLE_INPUT.

 

Nu e ceva chiar foarte complicat.

#define DIALOG_DSHIP 1

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_DSHIP)
{
if(!response) return 1;

ShowPlayerDialog(playerid, DIALOG_DSHIP + 1, DIALOG_STYLE_INPUT, "DealerShip", "Scrie mai jos ID-ul masinii dorite", "Next", "Cancel");
return 1;
}
if(dialogid == DIALOG_DSHIP + 1)
{
if(!response) return 1;

if(strcmp(params, "411", true) == 0) GiveCar(playerid, Infernus); //Sau cum ai in GM
if(strcmp(params, "412", true) == 0) GiveCar(playerid, Voodoo); //Sau cum ai in GM 
//etc
return 1;
}
return 0;
}

CMD:dealership(playerid, params[])
{
new dship[2048];
strcat(dship, "(411)Infernus 975.000.000$ t| (412)Voodoo 350.000.000$");
//etc
ShowPlayerDialog(playerid, DIALOG_DSHIP, DIALOG_STYLE_MSGBOX, "Buy Vehicle", dship, "Forward", "Cancel");
return 1;
}

 

Dar îmi dă următoarea eroare la compilare: Poza

 
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

In loc de asta:

if(dialogid == DIALOG_DSHIP + 1)
{
if(!response) return 1;

if(strcmp(params, "411", true) == 0) GiveCar(playerid, Infernus); //Sau cum ai in GM
if(strcmp(params, "412", true) == 0) GiveCar(playerid, Voodoo); //Sau cum ai in GM 
//etc
return 1;
}

 

Incearca:

if(dialogid == DIALOG_DSHIP)
{
if(!response) return 1;

if(strcmp(inputtext, "411", true) == 0) GiveCar(playerid, 411); //Sau cum ai in GM
if(strcmp(inputtext, "412", true) == 0) GiveCar(playerid, 412); //Sau cum ai in GM 
//etc
return 1;
}

Ocupation: Youtube, Mined Bitcoin's, Scripting & Mapping SA:MP

Link to comment
Share on other sites

  • 0

Intra pe mess, o sa te ajut eu

Edited by FlOrINn

:P Respecta ca sa fi respectact :P 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Developer in :

C++,PHP,HTML,CSS,JAVASCRIPT,XML,MYSQL

si ceva  Pawno :)

WebDesign,Photoshop

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

/////////////////////////////////////////////////////////////////////////////////////////

=============================================

Steam ~ Kiburici

=============================================

Link to comment
Share on other sites

  • 0

@FlOrINn, ok, aștept buzz.

intra diseara la ora 5:30 ;)

:P Respecta ca sa fi respectact :P 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Developer in :

C++,PHP,HTML,CSS,JAVASCRIPT,XML,MYSQL

si ceva  Pawno :)

WebDesign,Photoshop

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

/////////////////////////////////////////////////////////////////////////////////////////

=============================================

Steam ~ Kiburici

=============================================

Link to comment
Share on other sites

  • 0
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_DSHIP)
	{
		if(response)
		{
			ShowPlayerDialog(playerid, DIALOG_DSHIP + 1, DIALOG_STYLE_INPUT, "DealerShip", "Scrie mai jos ID-ul masinii dorite", "Next", "Cancel");
			if(dialogid == DIALOG_DSHIP + 1)
			{
				if(response)
				{
					if(strcmp(params, "411", true) == 0) GiveCar(playerid, Infernus); //Sau cum ai in GM
					if(strcmp(params, "412", true) == 0) GiveCar(playerid, Voodoo); //Sau cum ai in GM
					//etc
					return 1;
				}
			}
		}
	}

CMD:dealership(playerid, params[])
{
new dship[2048];
strcat(dship, "(411)Infernus 975.000.000$ t| (412)Voodoo 350.000.000$");
//etc
ShowPlayerDialog(playerid, DIALOG_DSHIP, DIALOG_STYLE_MSGBOX, "Buy Vehicle", dship, "Forward", "Cancel");
return 1;
}

Daca ti-am fost de ajutor +1 Respect!Multumesc

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.