Jump to content
  • 0

Problema TextDraw


BRAGA03

Question

Problema intalnita (descriere):Am incercat sa fac un DealerShip cu niste TextDraw-uri, si am 5 TextDraw-uri selectabile, dar cand apasam pe butonul "Anuleaza" nu functiona cum vroiam eu. Asa ca am facut o verificare simpla:

public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
	if(playertextid  == PlayerText:ButonPrecedentul[playerid])
	{
		SCM(playerid, -1, "Buton precedentul.");
	}
	if(playertextid  == PlayerText:ButonUrmatorul[playerid])
	{
        SCM(playerid, -1, "Buton urmatorul.");
	}
	if(playertextid  == PlayerText:ButonCumpara[playerid])
	{
        SCM(playerid, -1, "Buton cumpara.");
	}
	if(playertextid  == PlayerText:ButonAnuleaza[playerid])
	{
		TextDrawHideForPlayer(playerid,DealerShipTextDraw0);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw1);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw2);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw3);
		PlayerTextDrawHide(playerid,PlayerText:DScModel[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:DScPrice[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonPrecedentul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonUrmatorul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonCumpara[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonAnuleaza[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonTesteaza[playerid]);
        CancelSelectTextDraw(playerid);
		TogglePlayerControllable(playerid, true);
		SetCameraBehindPlayer(playerid);
	}
	if(playertextid  == PlayerText:ButonTesteaza[playerid])
	{
        SCM(playerid, -1, "Buton testeaza.");
	}
	return 1;
}

Si atunci cand incerc sa apas pe butonul "Anuleaza" imi arata ca as fi apasat pe butonul "Testeaza", la fel si cu butonul "Cumpara". La butoanele "Urmatrul" si "Precedentul" nu mai stiu sigur cum era, dar nici ele nu functionau corect.
 

Ero(area / rile) / warning-(ul / urile): Nu am.


Liniile de cod / sursa / script-ul(obligatoriu):

		new Text:DealerShipTextDraw0;
		new Text:DealerShipTextDraw1;
		new Text:DealerShipTextDraw2;
		new Text:DealerShipTextDraw3;
		new PlayerText:DScModel[MAX_PLAYERS];
		new PlayerText:DScPrice[MAX_PLAYERS];
		new PlayerText:ButonPrecedentul[MAX_PLAYERS];
		new PlayerText:ButonUrmatorul[MAX_PLAYERS];
		new PlayerText:ButonCumpara[MAX_PLAYERS];
		new PlayerText:ButonAnuleaza[MAX_PLAYERS];
		new PlayerText:ButonTesteaza[MAX_PLAYERS];
		new IDDS[MAX_PLAYERS];
		new IDmasina[MAX_PLAYERS];

 

new DSModels[4][3] ={
{0, 411, 50000000},
{1, 541, 35000000},
{2, 560, 20000000},
{3, 522, 19000000}
};

 

	//OnGamemodeInit()
	
	DealerShipTextDraw0 = TextDrawCreate(707.000000, 303.666625, "usebox");
	TextDrawLetterSize(DealerShipTextDraw0, 0.000000, 5.806015);
	TextDrawTextSize(DealerShipTextDraw0, -5.125000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw0, 1);
	TextDrawColor(DealerShipTextDraw0, 0);
	TextDrawUseBox(DealerShipTextDraw0, true);
	TextDrawBoxColor(DealerShipTextDraw0, 150);
	TextDrawSetShadow(DealerShipTextDraw0, 0);
	TextDrawSetOutline(DealerShipTextDraw0, 0);
	TextDrawFont(DealerShipTextDraw0, 0);

	DealerShipTextDraw1 = TextDrawCreate(655.750000, 329.333343, "usebox");
	TextDrawLetterSize(DealerShipTextDraw1, 0.000000, 0.134722);
	TextDrawTextSize(DealerShipTextDraw1, -4.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw1, 1);
	TextDrawColor(DealerShipTextDraw1, 0);
	TextDrawUseBox(DealerShipTextDraw1, true);
	TextDrawBoxColor(DealerShipTextDraw1, 16843263);
	TextDrawSetShadow(DealerShipTextDraw1, 0);
	TextDrawSetOutline(DealerShipTextDraw1, 0);
	TextDrawFont(DealerShipTextDraw1, 0);

	DealerShipTextDraw2 = TextDrawCreate(118.875000, 304.249969, "usebox");
	TextDrawLetterSize(DealerShipTextDraw2, 0.000000, 5.711111);
	TextDrawTextSize(DealerShipTextDraw2, 105.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw2, 1);
	TextDrawColor(DealerShipTextDraw2, 0);
	TextDrawUseBox(DealerShipTextDraw2, true);
	TextDrawBoxColor(DealerShipTextDraw2, 16843263);
	TextDrawSetShadow(DealerShipTextDraw2, 0);
	TextDrawSetOutline(DealerShipTextDraw2, 0);
	TextDrawFont(DealerShipTextDraw2, 0);

	DealerShipTextDraw3 = TextDrawCreate(537.625000, 304.250030, "usebox");
	TextDrawLetterSize(DealerShipTextDraw3, 0.000000, 5.715735);
	TextDrawTextSize(DealerShipTextDraw3, 524.250000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw3, 1);
	TextDrawColor(DealerShipTextDraw3, 0);
	TextDrawUseBox(DealerShipTextDraw3, true);
	TextDrawBoxColor(DealerShipTextDraw3, 255);
	TextDrawSetShadow(DealerShipTextDraw3, 0);
	TextDrawSetOutline(DealerShipTextDraw3, 0);
	TextDrawFont(DealerShipTextDraw3, 0);

 

	//OnPlayerConnect(playerid)

	ButonPrecedentul[playerid] = CreatePlayerTextDraw(playerid, 52.500000, 307.416595, "Precedentul");
	PlayerTextDrawLetterSize(playerid, ButonPrecedentul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonPrecedentul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonPrecedentul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonPrecedentul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonPrecedentul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonPrecedentul[playerid], true);

	ButonUrmatorul[playerid] = CreatePlayerTextDraw(playerid, 593.125000, 307.416809, "Urmatorul");
	PlayerTextDrawLetterSize(playerid, ButonUrmatorul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonUrmatorul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonUrmatorul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonUrmatorul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonUrmatorul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonUrmatorul[playerid], true);

	ButonCumpara[playerid] = CreatePlayerTextDraw(playerid, 50.000000, 336.583404, "Cumpara");
	PlayerTextDrawLetterSize(playerid, ButonCumpara[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonCumpara[playerid], 2);
	PlayerTextDrawColor(playerid, ButonCumpara[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonCumpara[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonCumpara[playerid], 51);
	PlayerTextDrawFont(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonCumpara[playerid], true);

	ButonAnuleaza[playerid] = CreatePlayerTextDraw(playerid, 593.750000, 338.333374, "Anuleaza");
	PlayerTextDrawLetterSize(playerid, ButonAnuleaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonAnuleaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonAnuleaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonAnuleaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonAnuleaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonAnuleaza[playerid], true);

	ButonTesteaza[playerid] = CreatePlayerTextDraw(playerid, 322.500000, 336.583312, "Testeaza");
	PlayerTextDrawLetterSize(playerid, ButonTesteaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonTesteaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonTesteaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonTesteaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonTesteaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonTesteaza[playerid], true);
	
	DScModel[playerid] = CreatePlayerTextDraw(playerid, 191.250000, 307.416717, "Masina: Infernus");
	PlayerTextDrawLetterSize(playerid, DScModel[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScModel[playerid], 2);
	PlayerTextDrawColor(playerid, DScModel[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScModel[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScModel[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScModel[playerid], 51);
	PlayerTextDrawFont(playerid, DScModel[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScModel[playerid], 1);

	DScPrice[playerid] = CreatePlayerTextDraw(playerid, 407.500000, 307.416656, "Pret: 100.000.000$");
	PlayerTextDrawLetterSize(playerid, DScPrice[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScPrice[playerid], 2);
	PlayerTextDrawColor(playerid, DScPrice[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScPrice[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScPrice[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScPrice[playerid], 51);
	PlayerTextDrawFont(playerid, DScPrice[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScPrice[playerid], 1);

 

 

CMD:buycar(playerid, params[])
{
	if(!IsPlayerInRangeOfPoint(playerid, 5.0,1242.8345,-1606.5917,13.7763))return true;
	new string[69];
	TogglePlayerControllable(playerid, false);
	SelectTextDraw(playerid, 0xFFFF00FF);
	/*SetPlayerCameraPos(playerid, -1642.1613,1414.8063,9.9705);
	SetPlayerCameraLookAt(playerid, 1640.9843,1415.7528,7.1875);*/
	TextDrawShowForPlayer(playerid,DealerShipTextDraw0);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw1);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw2);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw3);
	PlayerTextDrawShow(playerid,PlayerText:ButonPrecedentul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonUrmatorul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonCumpara[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonAnuleaza[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonTesteaza[playerid]);
	SetPlayerCameraPos(playerid, -1645.5028,1413.0542,11.5885);
	SetPlayerCameraLookAt(playerid, -1642.4170,1415.8367,7.1875);
	SetPlayerVirtualWorld(playerid, playerid+1);

	IDDS[playerid] = 0;
	IDmasina[playerid] = CreateVehicle(DSModels[IDDS[playerid]][1],-1636.1674,1419.9601,6.9153,97.3060, 1, 1, -1);
	SetVehicleVirtualWorld(IDmasina[playerid], playerid+1);

	format(string, sizeof(string), "Model: %s",VehNames[DSModels[IDDS[playerid]][1]-400]);
	PlayerTextDrawSetString(playerid, PlayerText:DScModel[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScModel[playerid]);

	format(string, sizeof(string), "Pret: %s",DSModels[IDDS[playerid]][2]);
	PlayerTextDrawSetString(playerid, PlayerText:DScPrice[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScPrice[playerid]);

	return 1;
}

 


	Restul am pus mai sus.


Imagini / Video (optional): Pun si poze daca imi cereti.
 

Ati incercat sa rezolvati singur?: Incerc de 4 ore si nu stiu ce sa mai fac...

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 1
13 hours ago, BRAGA03 said:

Problema intalnita (descriere):Am incercat sa fac un DealerShip cu niste TextDraw-uri, si am 5 TextDraw-uri selectabile, dar cand apasam pe butonul "Anuleaza" nu functiona cum vroiam eu. Asa ca am facut o verificare simpla:


public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
	if(playertextid  == PlayerText:ButonPrecedentul[playerid])
	{
		SCM(playerid, -1, "Buton precedentul.");
	}
	if(playertextid  == PlayerText:ButonUrmatorul[playerid])
	{
        SCM(playerid, -1, "Buton urmatorul.");
	}
	if(playertextid  == PlayerText:ButonCumpara[playerid])
	{
        SCM(playerid, -1, "Buton cumpara.");
	}
	if(playertextid  == PlayerText:ButonAnuleaza[playerid])
	{
		TextDrawHideForPlayer(playerid,DealerShipTextDraw0);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw1);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw2);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw3);
		PlayerTextDrawHide(playerid,PlayerText:DScModel[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:DScPrice[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonPrecedentul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonUrmatorul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonCumpara[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonAnuleaza[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonTesteaza[playerid]);
        CancelSelectTextDraw(playerid);
		TogglePlayerControllable(playerid, true);
		SetCameraBehindPlayer(playerid);
	}
	if(playertextid  == PlayerText:ButonTesteaza[playerid])
	{
        SCM(playerid, -1, "Buton testeaza.");
	}
	return 1;
}

Si atunci cand incerc sa apas pe butonul "Anuleaza" imi arata ca as fi apasat pe butonul "Testeaza", la fel si cu butonul "Cumpara". La butoanele "Urmatrul" si "Precedentul" nu mai stiu sigur cum era, dar nici ele nu functionau corect.
 

Ero(area / rile) / warning-(ul / urile): Nu am.


Liniile de cod / sursa / script-ul(obligatoriu):


		new Text:DealerShipTextDraw0;
		new Text:DealerShipTextDraw1;
		new Text:DealerShipTextDraw2;
		new Text:DealerShipTextDraw3;
		new PlayerText:DScModel[MAX_PLAYERS];
		new PlayerText:DScPrice[MAX_PLAYERS];
		new PlayerText:ButonPrecedentul[MAX_PLAYERS];
		new PlayerText:ButonUrmatorul[MAX_PLAYERS];
		new PlayerText:ButonCumpara[MAX_PLAYERS];
		new PlayerText:ButonAnuleaza[MAX_PLAYERS];
		new PlayerText:ButonTesteaza[MAX_PLAYERS];
		new IDDS[MAX_PLAYERS];
		new IDmasina[MAX_PLAYERS];

 


new DSModels[4][3] ={
{0, 411, 50000000},
{1, 541, 35000000},
{2, 560, 20000000},
{3, 522, 19000000}
};

 


	//OnGamemodeInit()
	
	DealerShipTextDraw0 = TextDrawCreate(707.000000, 303.666625, "usebox");
	TextDrawLetterSize(DealerShipTextDraw0, 0.000000, 5.806015);
	TextDrawTextSize(DealerShipTextDraw0, -5.125000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw0, 1);
	TextDrawColor(DealerShipTextDraw0, 0);
	TextDrawUseBox(DealerShipTextDraw0, true);
	TextDrawBoxColor(DealerShipTextDraw0, 150);
	TextDrawSetShadow(DealerShipTextDraw0, 0);
	TextDrawSetOutline(DealerShipTextDraw0, 0);
	TextDrawFont(DealerShipTextDraw0, 0);

	DealerShipTextDraw1 = TextDrawCreate(655.750000, 329.333343, "usebox");
	TextDrawLetterSize(DealerShipTextDraw1, 0.000000, 0.134722);
	TextDrawTextSize(DealerShipTextDraw1, -4.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw1, 1);
	TextDrawColor(DealerShipTextDraw1, 0);
	TextDrawUseBox(DealerShipTextDraw1, true);
	TextDrawBoxColor(DealerShipTextDraw1, 16843263);
	TextDrawSetShadow(DealerShipTextDraw1, 0);
	TextDrawSetOutline(DealerShipTextDraw1, 0);
	TextDrawFont(DealerShipTextDraw1, 0);

	DealerShipTextDraw2 = TextDrawCreate(118.875000, 304.249969, "usebox");
	TextDrawLetterSize(DealerShipTextDraw2, 0.000000, 5.711111);
	TextDrawTextSize(DealerShipTextDraw2, 105.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw2, 1);
	TextDrawColor(DealerShipTextDraw2, 0);
	TextDrawUseBox(DealerShipTextDraw2, true);
	TextDrawBoxColor(DealerShipTextDraw2, 16843263);
	TextDrawSetShadow(DealerShipTextDraw2, 0);
	TextDrawSetOutline(DealerShipTextDraw2, 0);
	TextDrawFont(DealerShipTextDraw2, 0);

	DealerShipTextDraw3 = TextDrawCreate(537.625000, 304.250030, "usebox");
	TextDrawLetterSize(DealerShipTextDraw3, 0.000000, 5.715735);
	TextDrawTextSize(DealerShipTextDraw3, 524.250000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw3, 1);
	TextDrawColor(DealerShipTextDraw3, 0);
	TextDrawUseBox(DealerShipTextDraw3, true);
	TextDrawBoxColor(DealerShipTextDraw3, 255);
	TextDrawSetShadow(DealerShipTextDraw3, 0);
	TextDrawSetOutline(DealerShipTextDraw3, 0);
	TextDrawFont(DealerShipTextDraw3, 0);

 


	//OnPlayerConnect(playerid)

	ButonPrecedentul[playerid] = CreatePlayerTextDraw(playerid, 52.500000, 307.416595, "Precedentul");
	PlayerTextDrawLetterSize(playerid, ButonPrecedentul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonPrecedentul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonPrecedentul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonPrecedentul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonPrecedentul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonPrecedentul[playerid], true);

	ButonUrmatorul[playerid] = CreatePlayerTextDraw(playerid, 593.125000, 307.416809, "Urmatorul");
	PlayerTextDrawLetterSize(playerid, ButonUrmatorul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonUrmatorul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonUrmatorul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonUrmatorul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonUrmatorul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonUrmatorul[playerid], true);

	ButonCumpara[playerid] = CreatePlayerTextDraw(playerid, 50.000000, 336.583404, "Cumpara");
	PlayerTextDrawLetterSize(playerid, ButonCumpara[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonCumpara[playerid], 2);
	PlayerTextDrawColor(playerid, ButonCumpara[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonCumpara[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonCumpara[playerid], 51);
	PlayerTextDrawFont(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonCumpara[playerid], true);

	ButonAnuleaza[playerid] = CreatePlayerTextDraw(playerid, 593.750000, 338.333374, "Anuleaza");
	PlayerTextDrawLetterSize(playerid, ButonAnuleaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonAnuleaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonAnuleaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonAnuleaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonAnuleaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonAnuleaza[playerid], true);

	ButonTesteaza[playerid] = CreatePlayerTextDraw(playerid, 322.500000, 336.583312, "Testeaza");
	PlayerTextDrawLetterSize(playerid, ButonTesteaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonTesteaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonTesteaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonTesteaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonTesteaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonTesteaza[playerid], true);
	
	DScModel[playerid] = CreatePlayerTextDraw(playerid, 191.250000, 307.416717, "Masina: Infernus");
	PlayerTextDrawLetterSize(playerid, DScModel[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScModel[playerid], 2);
	PlayerTextDrawColor(playerid, DScModel[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScModel[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScModel[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScModel[playerid], 51);
	PlayerTextDrawFont(playerid, DScModel[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScModel[playerid], 1);

	DScPrice[playerid] = CreatePlayerTextDraw(playerid, 407.500000, 307.416656, "Pret: 100.000.000$");
	PlayerTextDrawLetterSize(playerid, DScPrice[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScPrice[playerid], 2);
	PlayerTextDrawColor(playerid, DScPrice[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScPrice[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScPrice[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScPrice[playerid], 51);
	PlayerTextDrawFont(playerid, DScPrice[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScPrice[playerid], 1);

 

 


CMD:buycar(playerid, params[])
{
	if(!IsPlayerInRangeOfPoint(playerid, 5.0,1242.8345,-1606.5917,13.7763))return true;
	new string[69];
	TogglePlayerControllable(playerid, false);
	SelectTextDraw(playerid, 0xFFFF00FF);
	/*SetPlayerCameraPos(playerid, -1642.1613,1414.8063,9.9705);
	SetPlayerCameraLookAt(playerid, 1640.9843,1415.7528,7.1875);*/
	TextDrawShowForPlayer(playerid,DealerShipTextDraw0);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw1);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw2);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw3);
	PlayerTextDrawShow(playerid,PlayerText:ButonPrecedentul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonUrmatorul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonCumpara[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonAnuleaza[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonTesteaza[playerid]);
	SetPlayerCameraPos(playerid, -1645.5028,1413.0542,11.5885);
	SetPlayerCameraLookAt(playerid, -1642.4170,1415.8367,7.1875);
	SetPlayerVirtualWorld(playerid, playerid+1);

	IDDS[playerid] = 0;
	IDmasina[playerid] = CreateVehicle(DSModels[IDDS[playerid]][1],-1636.1674,1419.9601,6.9153,97.3060, 1, 1, -1);
	SetVehicleVirtualWorld(IDmasina[playerid], playerid+1);

	format(string, sizeof(string), "Model: %s",VehNames[DSModels[IDDS[playerid]][1]-400]);
	PlayerTextDrawSetString(playerid, PlayerText:DScModel[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScModel[playerid]);

	format(string, sizeof(string), "Pret: %s",DSModels[IDDS[playerid]][2]);
	PlayerTextDrawSetString(playerid, PlayerText:DScPrice[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScPrice[playerid]);

	return 1;
}

 



	Restul am pus mai sus.


Imagini / Video (optional): Pun si poze daca imi cereti.
 

Ati incercat sa rezolvati singur?: Incerc de 4 ore si nu stiu ce sa mai fac...

 

 

 

 

Dacă eu ti.am zis că astea trebuie să le folosești ca să remediezi problema , folosește.te, dacă nu,du.te frate si da.te cu capu de pereți ca nu.ti iese, nu mai veniți aici si cereți ajutor dacă nu vreți să.l luați în considerare!

 

 

 

  • Upvote 1

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 1
1 hour ago, BRAGA03 said:

Problema intalnita (descriere):Am incercat sa fac un DealerShip cu niste TextDraw-uri, si am 5 TextDraw-uri selectabile, dar cand apasam pe butonul "Anuleaza" nu functiona cum vroiam eu. Asa ca am facut o verificare simpla:


public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
	if(playertextid  == PlayerText:ButonPrecedentul[playerid])
	{
		SCM(playerid, -1, "Buton precedentul.");
	}
	if(playertextid  == PlayerText:ButonUrmatorul[playerid])
	{
        SCM(playerid, -1, "Buton urmatorul.");
	}
	if(playertextid  == PlayerText:ButonCumpara[playerid])
	{
        SCM(playerid, -1, "Buton cumpara.");
	}
	if(playertextid  == PlayerText:ButonAnuleaza[playerid])
	{
		TextDrawHideForPlayer(playerid,DealerShipTextDraw0);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw1);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw2);
		TextDrawHideForPlayer(playerid,DealerShipTextDraw3);
		PlayerTextDrawHide(playerid,PlayerText:DScModel[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:DScPrice[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonPrecedentul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonUrmatorul[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonCumpara[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonAnuleaza[playerid]);
		PlayerTextDrawHide(playerid,PlayerText:ButonTesteaza[playerid]);
        CancelSelectTextDraw(playerid);
		TogglePlayerControllable(playerid, true);
		SetCameraBehindPlayer(playerid);
	}
	if(playertextid  == PlayerText:ButonTesteaza[playerid])
	{
        SCM(playerid, -1, "Buton testeaza.");
	}
	return 1;
}

Si atunci cand incerc sa apas pe butonul "Anuleaza" imi arata ca as fi apasat pe butonul "Testeaza", la fel si cu butonul "Cumpara". La butoanele "Urmatrul" si "Precedentul" nu mai stiu sigur cum era, dar nici ele nu functionau corect.
 

Ero(area / rile) / warning-(ul / urile): Nu am.


Liniile de cod / sursa / script-ul(obligatoriu):


		new Text:DealerShipTextDraw0;
		new Text:DealerShipTextDraw1;
		new Text:DealerShipTextDraw2;
		new Text:DealerShipTextDraw3;
		new PlayerText:DScModel[MAX_PLAYERS];
		new PlayerText:DScPrice[MAX_PLAYERS];
		new PlayerText:ButonPrecedentul[MAX_PLAYERS];
		new PlayerText:ButonUrmatorul[MAX_PLAYERS];
		new PlayerText:ButonCumpara[MAX_PLAYERS];
		new PlayerText:ButonAnuleaza[MAX_PLAYERS];
		new PlayerText:ButonTesteaza[MAX_PLAYERS];
		new IDDS[MAX_PLAYERS];
		new IDmasina[MAX_PLAYERS];

 


new DSModels[4][3] ={
{0, 411, 50000000},
{1, 541, 35000000},
{2, 560, 20000000},
{3, 522, 19000000}
};

 


	//OnGamemodeInit()
	
	DealerShipTextDraw0 = TextDrawCreate(707.000000, 303.666625, "usebox");
	TextDrawLetterSize(DealerShipTextDraw0, 0.000000, 5.806015);
	TextDrawTextSize(DealerShipTextDraw0, -5.125000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw0, 1);
	TextDrawColor(DealerShipTextDraw0, 0);
	TextDrawUseBox(DealerShipTextDraw0, true);
	TextDrawBoxColor(DealerShipTextDraw0, 150);
	TextDrawSetShadow(DealerShipTextDraw0, 0);
	TextDrawSetOutline(DealerShipTextDraw0, 0);
	TextDrawFont(DealerShipTextDraw0, 0);

	DealerShipTextDraw1 = TextDrawCreate(655.750000, 329.333343, "usebox");
	TextDrawLetterSize(DealerShipTextDraw1, 0.000000, 0.134722);
	TextDrawTextSize(DealerShipTextDraw1, -4.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw1, 1);
	TextDrawColor(DealerShipTextDraw1, 0);
	TextDrawUseBox(DealerShipTextDraw1, true);
	TextDrawBoxColor(DealerShipTextDraw1, 16843263);
	TextDrawSetShadow(DealerShipTextDraw1, 0);
	TextDrawSetOutline(DealerShipTextDraw1, 0);
	TextDrawFont(DealerShipTextDraw1, 0);

	DealerShipTextDraw2 = TextDrawCreate(118.875000, 304.249969, "usebox");
	TextDrawLetterSize(DealerShipTextDraw2, 0.000000, 5.711111);
	TextDrawTextSize(DealerShipTextDraw2, 105.500000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw2, 1);
	TextDrawColor(DealerShipTextDraw2, 0);
	TextDrawUseBox(DealerShipTextDraw2, true);
	TextDrawBoxColor(DealerShipTextDraw2, 16843263);
	TextDrawSetShadow(DealerShipTextDraw2, 0);
	TextDrawSetOutline(DealerShipTextDraw2, 0);
	TextDrawFont(DealerShipTextDraw2, 0);

	DealerShipTextDraw3 = TextDrawCreate(537.625000, 304.250030, "usebox");
	TextDrawLetterSize(DealerShipTextDraw3, 0.000000, 5.715735);
	TextDrawTextSize(DealerShipTextDraw3, 524.250000, 0.000000);
	TextDrawAlignment(DealerShipTextDraw3, 1);
	TextDrawColor(DealerShipTextDraw3, 0);
	TextDrawUseBox(DealerShipTextDraw3, true);
	TextDrawBoxColor(DealerShipTextDraw3, 255);
	TextDrawSetShadow(DealerShipTextDraw3, 0);
	TextDrawSetOutline(DealerShipTextDraw3, 0);
	TextDrawFont(DealerShipTextDraw3, 0);

 


	//OnPlayerConnect(playerid)

	ButonPrecedentul[playerid] = CreatePlayerTextDraw(playerid, 52.500000, 307.416595, "Precedentul");
	PlayerTextDrawLetterSize(playerid, ButonPrecedentul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonPrecedentul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonPrecedentul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonPrecedentul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonPrecedentul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonPrecedentul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonPrecedentul[playerid], true);

	ButonUrmatorul[playerid] = CreatePlayerTextDraw(playerid, 593.125000, 307.416809, "Urmatorul");
	PlayerTextDrawLetterSize(playerid, ButonUrmatorul[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonUrmatorul[playerid], 2);
	PlayerTextDrawColor(playerid, ButonUrmatorul[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonUrmatorul[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonUrmatorul[playerid], 51);
	PlayerTextDrawFont(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonUrmatorul[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonUrmatorul[playerid], true);

	ButonCumpara[playerid] = CreatePlayerTextDraw(playerid, 50.000000, 336.583404, "Cumpara");
	PlayerTextDrawLetterSize(playerid, ButonCumpara[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonCumpara[playerid], 2);
	PlayerTextDrawColor(playerid, ButonCumpara[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonCumpara[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonCumpara[playerid], 51);
	PlayerTextDrawFont(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonCumpara[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonCumpara[playerid], true);

	ButonAnuleaza[playerid] = CreatePlayerTextDraw(playerid, 593.750000, 338.333374, "Anuleaza");
	PlayerTextDrawLetterSize(playerid, ButonAnuleaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonAnuleaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonAnuleaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonAnuleaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonAnuleaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonAnuleaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonAnuleaza[playerid], true);

	ButonTesteaza[playerid] = CreatePlayerTextDraw(playerid, 322.500000, 336.583312, "Testeaza");
	PlayerTextDrawLetterSize(playerid, ButonTesteaza[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, ButonTesteaza[playerid], 2);
	PlayerTextDrawColor(playerid, ButonTesteaza[playerid], -1);
	PlayerTextDrawSetShadow(playerid, ButonTesteaza[playerid], 0);
	PlayerTextDrawSetOutline(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, ButonTesteaza[playerid], 51);
	PlayerTextDrawFont(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetProportional(playerid, ButonTesteaza[playerid], 1);
	PlayerTextDrawSetSelectable(playerid, ButonTesteaza[playerid], true);
	
	DScModel[playerid] = CreatePlayerTextDraw(playerid, 191.250000, 307.416717, "Masina: Infernus");
	PlayerTextDrawLetterSize(playerid, DScModel[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScModel[playerid], 2);
	PlayerTextDrawColor(playerid, DScModel[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScModel[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScModel[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScModel[playerid], 51);
	PlayerTextDrawFont(playerid, DScModel[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScModel[playerid], 1);

	DScPrice[playerid] = CreatePlayerTextDraw(playerid, 407.500000, 307.416656, "Pret: 100.000.000$");
	PlayerTextDrawLetterSize(playerid, DScPrice[playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid, DScPrice[playerid], 2);
	PlayerTextDrawColor(playerid, DScPrice[playerid], -1);
	PlayerTextDrawSetShadow(playerid, DScPrice[playerid], 0);
	PlayerTextDrawSetOutline(playerid, DScPrice[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, DScPrice[playerid], 51);
	PlayerTextDrawFont(playerid, DScPrice[playerid], 1);
	PlayerTextDrawSetProportional(playerid, DScPrice[playerid], 1);

 

 


CMD:buycar(playerid, params[])
{
	if(!IsPlayerInRangeOfPoint(playerid, 5.0,1242.8345,-1606.5917,13.7763))return true;
	new string[69];
	TogglePlayerControllable(playerid, false);
	SelectTextDraw(playerid, 0xFFFF00FF);
	/*SetPlayerCameraPos(playerid, -1642.1613,1414.8063,9.9705);
	SetPlayerCameraLookAt(playerid, 1640.9843,1415.7528,7.1875);*/
	TextDrawShowForPlayer(playerid,DealerShipTextDraw0);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw1);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw2);
	TextDrawShowForPlayer(playerid,DealerShipTextDraw3);
	PlayerTextDrawShow(playerid,PlayerText:ButonPrecedentul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonUrmatorul[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonCumpara[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonAnuleaza[playerid]);
	PlayerTextDrawShow(playerid,PlayerText:ButonTesteaza[playerid]);
	SetPlayerCameraPos(playerid, -1645.5028,1413.0542,11.5885);
	SetPlayerCameraLookAt(playerid, -1642.4170,1415.8367,7.1875);
	SetPlayerVirtualWorld(playerid, playerid+1);

	IDDS[playerid] = 0;
	IDmasina[playerid] = CreateVehicle(DSModels[IDDS[playerid]][1],-1636.1674,1419.9601,6.9153,97.3060, 1, 1, -1);
	SetVehicleVirtualWorld(IDmasina[playerid], playerid+1);

	format(string, sizeof(string), "Model: %s",VehNames[DSModels[IDDS[playerid]][1]-400]);
	PlayerTextDrawSetString(playerid, PlayerText:DScModel[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScModel[playerid]);

	format(string, sizeof(string), "Pret: %s",DSModels[IDDS[playerid]][2]);
	PlayerTextDrawSetString(playerid, PlayerText:DScPrice[playerid], string);
	PlayerTextDrawShow(playerid,PlayerText:DScPrice[playerid]);

	return 1;
}

 



	Restul am pus mai sus.


Imagini / Video (optional): Pun si poze daca imi cereti.
 

Ati incercat sa rezolvati singur?: Incerc de 4 ore si nu stiu ce sa mai fac...

Folosește te de TextDrawTextSize respectiv PlayerTextDrawTextSize

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

  • 0

Ce rezultat da la fiecare textdraw accesat ? tu ai spus doar la cele 2. O alta chestie care am mai vazut-o este ca atunci cand creezi textdraw-urile folosesti si functia PlayerTextDrawSetSelectable si din cate stiu trebuie folosita atunci cand vrei ca textdraw sa fie salectabil, adica atunci cand folosesti /buy in cazul tau. Si arata-ne o imagine cu asezarea textdraw-urilor.

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

  • 0
Acum 16 ore, BRAGA03 a spus:

Pai cu ce m-ar ajuta? Mie imi apar textdraw-urile bine, asa cum vreau eu, problema e cand apas pe ele.

Multumesc @DaEdRiC-FoX , ai avut dreptate, asta era problema.

Se poate da T/C.

 

2c4AJX1.png

Link to comment
Share on other sites

  • -1
Acum 15 ore, DaEdRiC-FoX a spus:

Folosește te de TextDrawTextSize respectiv PlayerTextDrawTextSize

Pai cu ce m-ar ajuta? Mie imi apar textdraw-urile bine, asa cum vreau eu, problema e cand apas pe ele.

Multumesc @DaEdRiC-FoX , ai avut dreptate, asta era problema.

Se poate da T/C.

Edited by BRAGA03
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.