InputText in variabile.
#1

Hi , how to put inputtext intro variabile , my code :

Код:
       if(dialogid == 1997)
        {
        if(response)
            {
              if(!strlen(inputtext))
            {
                SendClientMessage(playerid,-1,"ERROR: Not write in the box text. !");
                ShowPlayerDialog(playerid, 1997, DIALOG_STYLE_INPUT, "Graffity System", "Scrie in aceasta casuta cu ce nume vrei sa fie tatuaju.", "Ok", "");
                return 1;
            }
                                    new Float:X, Float:Y, Float:Z, Float:A;
                        GetPlayerFacingAngle(playerid, A);
						GetPlayerPos(playerid, X, Y, Z);
SetObjectMaterialText(graffity, inputtext,0,OBJECT_MATERIAL_SIZE_256x256,"Italic",24,1,0xFFFFFFFF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
GrafText[playerid] = strval(inputtext);
ShowPlayerDialog(playerid, 1996, DIALOG_STYLE_LIST, "Color Graffity", "Red\nYellow\nGreen", "Select", "Close");
}
}
inputtext defined of GrafText[playerid] = strval(inputtext);. I want using inputtext in next dialog:

Код:
           if(dialogid == 1996)
    {
        if(response)
        {
            if(listitem == 0) 
            {
                SetObjectMaterialText(graffity, GrafText,0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,0xFF0005FF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            }
            if(listitem == 1) 
            {
                SetObjectMaterialText(graffity, GrafText,0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,0xEBFF00FF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            }
            if(listitem == 2) 
            {
                SetObjectMaterialText(graffity, GrafText,0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,0x00FF1EFF,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
            }
        }
    }
GrafText defined in:
Код:
new GrafText[MAX_PLAYERS]
Compiled , no errors bad when enter in the game not work...

P.S : Sorry for my bad english , i`m Romain.
Reply
#2

Better worry about your code indentation.

pawn Код:
//Change
new GrafText[MAX_PLAYERS];
//to
#define MAX_GRAFTEXT (64)
new GrafText[MAX_PLAYERS][MAX_GRAFTEXT];

//Change
GrafText[playerid] = strval(inputtext);
//to
strcat(GrafText[playerid], inputtext, MAX_GRAFTEXT);

//Change each
SetObjectMaterialText(graffity, GrafText,0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,0xXXXXXXXX,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
//to
SetObjectMaterialText(graffity, GrafText[playerid],0,OBJECT_MATERIAL_SIZE_256x256,"Arial",24,1,0xXXXXXXXX,0,OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
Reply
#3

Thankz , it`s work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)