Ayuda, OnPlayerClickTextDraw
#1

Hola, bueno la cosa es que no puedo clickear en el TextDraw como deberia ser, Hago click y no pasa nada, he visto tutoriales pero tampoco funciona, les dejo el Fs para que puedan ver si pueden ver que pasa...

Код:
#include <a_samp>


new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;

public OnFilterScriptInit()
{
	print("Textdraw file generated by");
	print("    Zamaroht's textdraw editor was loaded.");

	// Create the textdraws:
	Textdraw0 = TextDrawCreate(242.000000, 106.000000, "Hombre");
	TextDrawBackgroundColor(Textdraw0, 255);
	TextDrawFont(Textdraw0, 5);
	TextDrawLetterSize(Textdraw0, 0.830000, 16.500000);
	TextDrawColor(Textdraw0, -1);
	TextDrawSetOutline(Textdraw0, 0);
	TextDrawSetProportional(Textdraw0, 1);
	TextDrawSetShadow(Textdraw0, 1);
	TextDrawUseBox(Textdraw0, 1);
	TextDrawBoxColor(Textdraw0, 255);
	TextDrawTextSize(Textdraw0, -129.000000, 198.000000);
	TextDrawSetPreviewModel(Textdraw0, 60);
	TextDrawSetPreviewRot(Textdraw0, 0.000000, 0.000000, 0.000000, 1.000000);
	TextDrawSetSelectable(Textdraw0, 1);

	Textdraw1 = TextDrawCreate(521.000000, 106.000000, "Mujer");
	TextDrawBackgroundColor(Textdraw1, 255);
	TextDrawFont(Textdraw1, 5);
	TextDrawLetterSize(Textdraw1, 0.830000, 16.500000);
	TextDrawColor(Textdraw1, -1);
	TextDrawSetOutline(Textdraw1, 0);
	TextDrawSetProportional(Textdraw1, 1);
	TextDrawSetShadow(Textdraw1, 1);
	TextDrawUseBox(Textdraw1, 1);
	TextDrawBoxColor(Textdraw1, 255);
	TextDrawTextSize(Textdraw1, -129.000000, 198.000000);
	TextDrawSetPreviewModel(Textdraw1, 193);
	TextDrawSetPreviewRot(Textdraw1, 0.000000, 0.000000, 0.000000, 1.000000);
	TextDrawSetSelectable(Textdraw1, 1);

	Textdraw2 = TextDrawCreate(142.000000, 302.000000, "HOMBRE");
	TextDrawBackgroundColor(Textdraw2, 255);
	TextDrawFont(Textdraw2, 1);
	TextDrawLetterSize(Textdraw2, 0.509999, 1.800000);
	TextDrawColor(Textdraw2, 16777215);
	TextDrawSetOutline(Textdraw2, 1);
	TextDrawSetProportional(Textdraw2, 1);
	TextDrawSetSelectable(Textdraw2, 0);

	Textdraw3 = TextDrawCreate(431.000000, 302.000000, "MUJER");
	TextDrawBackgroundColor(Textdraw3, 255);
	TextDrawFont(Textdraw3, 1);
	TextDrawLetterSize(Textdraw3, 0.509999, 1.800000);
	TextDrawColor(Textdraw3, -16711681);
	TextDrawSetOutline(Textdraw3, 1);
	TextDrawSetProportional(Textdraw3, 1);
	TextDrawSetSelectable(Textdraw3, 0);

	Textdraw4 = TextDrawCreate(317.000000, 192.000000, "ERES?...");
	TextDrawAlignment(Textdraw4, 2);
	TextDrawBackgroundColor(Textdraw4, 255);
	TextDrawFont(Textdraw4, 1);
	TextDrawLetterSize(Textdraw4, 0.420000, 2.200000);
	TextDrawColor(Textdraw4, -1);
	TextDrawSetOutline(Textdraw4, 1);
	TextDrawSetProportional(Textdraw4, 0);
	TextDrawSetSelectable(Textdraw4, 0);

	return 1;
}

public OnFilterScriptExit()
{
	TextDrawHideForAll(Textdraw0);
	TextDrawDestroy(Textdraw0);
	TextDrawHideForAll(Textdraw1);
	TextDrawDestroy(Textdraw1);
	TextDrawHideForAll(Textdraw2);
	TextDrawDestroy(Textdraw2);
	TextDrawHideForAll(Textdraw3);
	TextDrawDestroy(Textdraw3);
	TextDrawHideForAll(Textdraw4);
	TextDrawDestroy(Textdraw4);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/sexoxd"))
	{
			TextDrawShowForPlayer(playerid, Textdraw0);
			TextDrawShowForPlayer(playerid, Textdraw1);
			TextDrawShowForPlayer(playerid, Textdraw2);
			TextDrawShowForPlayer(playerid, Textdraw3);
			TextDrawShowForPlayer(playerid, Textdraw4);
			SelectTextDraw(playerid, 0xA3B4C5FF);
	}
	return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW)
    {
        if(clickedid == Textdraw0)
        {
            CancelSelectTextDraw(playerid);
        	TextDrawHideForPlayer(playerid, Textdraw0);
			TextDrawHideForPlayer(playerid, Textdraw1);
			TextDrawHideForPlayer(playerid, Textdraw2);
			TextDrawHideForPlayer(playerid, Textdraw3);
			TextDrawHideForPlayer(playerid, Textdraw4);
          	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
			return 1;
  		}
        if(clickedid == Textdraw1)
        {
        CancelSelectTextDraw(playerid);
       	TextDrawHideForPlayer(playerid, Textdraw0);
		TextDrawHideForPlayer(playerid, Textdraw1);
		TextDrawHideForPlayer(playerid, Textdraw2);
		TextDrawHideForPlayer(playerid, Textdraw3);
		TextDrawHideForPlayer(playerid, Textdraw4);
    	return 1;
        }


    } // Everything worked out perfectly, now stop the player to be able to select shizzle.
    return 1;
}
Reply
#2

modifica el TextDrawTextSize de los textdraw clickeable, comprueba quitando el menos a la cordenada x de los textdraw cliabkeable y veras que son clickeable correctamente, osea esta mal el TextDrawTextSize.

saludos.

pawn Код:
#include <a_samp>
new Text:Textdraw[5];

public OnFilterScriptInit(){
    Textdraw[0] = TextDrawCreate(242.000000, 106.000000, "Hombre");
    TextDrawBackgroundColor(Textdraw[0], 255);
    TextDrawFont(Textdraw[0], 5);
    TextDrawLetterSize(Textdraw[0], 0.830000, 16.500000);
    TextDrawColor(Textdraw[0], -1);
    TextDrawSetOutline(Textdraw[0], 0);
    TextDrawSetProportional(Textdraw[0], 1);
    TextDrawSetShadow(Textdraw[0], 1);
    TextDrawUseBox(Textdraw[0], 1);
    TextDrawBoxColor(Textdraw[0], 255);
    TextDrawTextSize(Textdraw[0], 129.000000, 198.000000); // <------ ACA
    TextDrawSetPreviewModel(Textdraw[0], 60);
    TextDrawSetPreviewRot(Textdraw[0], 0.000000, 0.000000, 0.000000, 1.000000);
    TextDrawSetSelectable(Textdraw[0], true);

    Textdraw[1] = TextDrawCreate(521.000000, 106.000000, "Mujer");
    TextDrawBackgroundColor(Textdraw[1], 255);
    TextDrawFont(Textdraw[1], 5);
    TextDrawLetterSize(Textdraw[1], 0.830000, 16.500000);
    TextDrawColor(Textdraw[1], -1);
    TextDrawSetOutline(Textdraw[1], 0);
    TextDrawSetProportional(Textdraw[1], 1);
    TextDrawSetShadow(Textdraw[1], 1);
    TextDrawUseBox(Textdraw[1], 1);
    TextDrawBoxColor(Textdraw[1], 255);
    TextDrawTextSize(Textdraw[1], 129.000000, 198.000000); // <------ ACA
    TextDrawSetPreviewModel(Textdraw[1], 193);
    TextDrawSetPreviewRot(Textdraw[1], 0.000000, 0.000000, 0.000000, 1.000000);
    TextDrawSetSelectable(Textdraw[1], true);

    Textdraw[2] = TextDrawCreate(142.000000, 302.000000, "HOMBRE");
    TextDrawBackgroundColor(Textdraw[2], 255);
    TextDrawFont(Textdraw[2], 1);
    TextDrawLetterSize(Textdraw[2], 0.509999, 1.800000);
    TextDrawColor(Textdraw[2], 16777215);
    TextDrawSetOutline(Textdraw[2], 1);
    TextDrawSetProportional(Textdraw[2], 1);
    TextDrawSetSelectable(Textdraw[2], false);

    Textdraw[3] = TextDrawCreate(431.000000, 302.000000, "MUJER");
    TextDrawBackgroundColor(Textdraw[3], 255);
    TextDrawFont(Textdraw[3], 1);
    TextDrawLetterSize(Textdraw[3], 0.509999, 1.800000);
    TextDrawColor(Textdraw[3], -16711681);
    TextDrawSetOutline(Textdraw[3], 1);
    TextDrawSetProportional(Textdraw[3], 1);
    TextDrawSetSelectable(Textdraw[3], false);

    Textdraw[4] = TextDrawCreate(317.000000, 192.000000, "ERES?...");
    TextDrawAlignment(Textdraw[4], 2);
    TextDrawBackgroundColor(Textdraw[4], 255);
    TextDrawFont(Textdraw[4], 1);
    TextDrawLetterSize(Textdraw[4], 0.420000, 2.200000);
    TextDrawColor(Textdraw[4], -1);
    TextDrawSetOutline(Textdraw[4], 1);
    TextDrawSetProportional(Textdraw[4], 0);
    TextDrawSetSelectable(Textdraw[4], false);
    return true;
}

public OnFilterScriptExit(){
    TextDrawHideForAll(Textdraw[0]);
    TextDrawDestroy(Textdraw[0]);
    TextDrawHideForAll(Textdraw[1]);
    TextDrawDestroy(Textdraw[1]);
    TextDrawHideForAll(Textdraw[2]);
    TextDrawDestroy(Textdraw[2]);
    TextDrawHideForAll(Textdraw[3]);
    TextDrawDestroy(Textdraw[3]);
    TextDrawHideForAll(Textdraw[4]);
    TextDrawDestroy(Textdraw[4]);
    return true;
}

public OnPlayerCommandText(playerid, cmdtext[]){
    if(!strcmp(cmdtext, "/sexoxd")){
        TextDrawShowForPlayer(playerid, Textdraw[0]);
        TextDrawShowForPlayer(playerid, Textdraw[1]);
        TextDrawShowForPlayer(playerid, Textdraw[2]);
        TextDrawShowForPlayer(playerid, Textdraw[3]);
        TextDrawShowForPlayer(playerid, Textdraw[4]);
        SelectTextDraw(playerid, 0xA3B4C5FF);
    }
    return true;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid){
    if(_:clickedid != INVALID_TEXT_DRAW){
        if(clickedid == Textdraw[0]){
            CancelSelectTextDraw(playerid);
            TextDrawHideForPlayer(playerid, Textdraw[0]);
            TextDrawHideForPlayer(playerid, Textdraw[1]);
            TextDrawHideForPlayer(playerid, Textdraw[2]);
            TextDrawHideForPlayer(playerid, Textdraw[3]);
            TextDrawHideForPlayer(playerid, Textdraw[4]);
            PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
        else if(clickedid == Textdraw[1]){
            CancelSelectTextDraw(playerid);
            TextDrawHideForPlayer(playerid, Textdraw[0]);
            TextDrawHideForPlayer(playerid, Textdraw[1]);
            TextDrawHideForPlayer(playerid, Textdraw[2]);
            TextDrawHideForPlayer(playerid, Textdraw[3]);
            TextDrawHideForPlayer(playerid, Textdraw[4]);
            PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
        }
    }
    return true;
}
Reply
#3

Como puedo hacer para que no quede desordenado?

Edit: Ya lo solucione, Gracias Otacon, me has Ambientado mucho
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)