Hi,
How can I get string data from a number variable?
For example, I want to analyze from a number (for example 2047):
if (first number == 2)
{
something happens
}
etc etc
sprintf(text, "%d", number);
if(text[0] == '2')
{
...
}
sprintf(text, "%d", numero);
if(text[0] == '2')
{
CreateActor("numero", "icon", "no parent", "no path", rand(10), rand(10), false);
}
sprintf(text, "%d", your_input_number);
...
char temp[10];
sprintf(temp, "%d"...
if (temp[0] == '2')
...
luku -> key down (a, Atleast one key is pressed), line 4: READ attempted beyond allowed access area
if(text[0] == '2')
numero = rand(1000);
sprintf(Text, "%d", numero);
if(Text[0] == '2')
{
CreateActor("tuloste", "shot", "no parent", "no path", rand(100), rand(100), false);
}
char Text[20];
tekdino wrote:I know I could do this easier with many variables instead of one but my project has too many variables to be displayed in the script window.
Text[0] = rand(9) + '0';
Text[1] = rand(9) + '0';
Text[last pos] = 0;
Users browsing this forum: No registered users and 1 guest