Help TextDraw Number - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help TextDraw Number (
/showthread.php?tid=609018)
Help TextDraw Number -
Savana221 - 07.06.2016
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
Re: Help TextDraw Number -
Onfroi - 07.06.2016
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.
Re: Help TextDraw Number -
F1N4L - 07.06.2016
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;
}
Re: Help TextDraw Number -
Savana221 - 07.06.2016
Thankssss