Why does this not work? Simple Text
#3

Quote:
Originally Posted by Phil_Cutcliffe
Посмотреть сообщение
pawn Код:
ObjectInfo[i][oName] = example;
When doing it like this I am unable to save the text to a file or collect it and use it else where for example

pawn Код:
Object ID %d's Name is %s i, ObjectInfo[i][oName]
How can I achieve what I'm trying to do?
I am not so sure but I guess you can try using

pawn Код:
format(ObjectInfo[i][oName], 100, example);
Let me explain if you didn't get it (not that good at explaining...) on that line it's like setting the name to that var/enum as the name is a string right? %s? (hope you can follow lol) so technically you would use format

the "100" is the size of the characters used for example when you "new string[120];" you have made space for 119 chars

The "example" part might not work as "example" must also be formatted like this

pawn Код:
format(example, 100, "example");
Now you set a string for 'example' and you set that string for the object name... (I failed I think)

But instead I would advise using (if you want to save what the player types)
pawn Код:
format(ObjectInfo[i][oName], 100, "your text for the object name here.");
If you didn't quite get it, post something of the code and few details of what you want to do.. Like edit the name, save name/load name such things.
Reply


Messages In This Thread
Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 18:58
Re: Why does this not work? Simple Text - by Konstantinos - 20.02.2014, 19:02
Re: Why does this not work? Simple Text - by MattTucker - 20.02.2014, 19:15
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 19:22
Re: Why does this not work? Simple Text - by Konstantinos - 20.02.2014, 19:27
Re: Why does this not work? Simple Text - by Vince - 20.02.2014, 19:36
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 20.02.2014, 20:02
Re: Why does this not work? Simple Text - by Phil_Cutcliffe - 21.02.2014, 16:07

Forum Jump:


Users browsing this thread: 1 Guest(s)