Help TextDraw Number
#1

Hi


This is how I work with textdraw , but the first time I'm doing an ATM , and now I would like to compress when the number 2 that he printed up number 2 .. I know it all together, but how do I get a definition that when squeezed 2 he writes 2 .. it is something similar to a calculator in textdraw , but I'm not at that fs managed to do atm ..







I know string bet , but I do not know how to compress when a certain number to him some prints if I disinfect
Reply
#2

Check what button the player presses (OnPlayerClickTextDraw). Once a player pressed it just change the string of the TextDraw (TextDrawSetString) to whatever number the player pressed. Then just keep adding numbers with stringins.
Reply
#3

Only example:

Код:
new GetNumbers[20];
new PlayerText:InputNumbers;
new PlayerText:CleanInput;
new PlayerText:Number_0;
new PlayerText:Number_1;
new PlayerText:Number_2;
new PlayerText:Number_3;
...
Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == Number_0)
    {
        strcat(GetNumbers, "0");
        PlayerTextDrawSetString(playerid, InputNumbers, GetNumbers)
    }
    if(playertextid == Number_1)
    {
        strcat(GetNumbers, "1");
        PlayerTextDrawSetString(playerid, InputNumbers, GetNumbers)
    }
    if(playertextid == Number_2)
    {
        strcat(GetNumbers, "2");
        PlayerTextDrawSetString(playerid, InputNumbers, GetNumbers)
    }
    if(playertextid == Number_3)
    {
        strcat(GetNumbers, "3");
        PlayerTextDrawSetString(playerid, InputNumbers, GetNumbers)
    }
    // ...
    if(playertextid == CleanInput)
    {
        GetNumbers[0] = '\0';
        PlayerTextDrawSetString(playerid, InputNumbers, GetNumbers)
    }
    return 1;
}
Reply
#4

Thankssss
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)