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.