enum & string - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: enum & string (
/showthread.php?tid=218625)
enum & string -
Mike Garber - 30.01.2011
How do I get a string from file to enum info?
I've got;
pawn Код:
enum GroupData
{
gExample[16],
}
new gData[PLAYERS][GroupData];
and using MXIni to get a string is; (ofcourse opening the file first,
as all the integers are taken correctly)
(This is done in a loop, yes)
pawn Код:
ini_getString(file,"Example",gData[i][gExample]);
But the string isn't stored, what is wrong?
Note that this works with normal strings, but not in enum data...
Also note that all other data is stored, but not strings.
Re: enum & string -
Mauzen - 30.01.2011
Hm, maybe its size isnt read correctly, try giving it to the function (dont know if it is possible with MXIni)
ini_getString(file,"Example",gData[i][gExample], 16);
Re: enum & string -
Mike Garber - 30.01.2011
Quote:
Originally Posted by Mauzen
Hm, maybe its size isnt read correctly, try giving it to the function (dont know if it is possible with MXIni)
ini_getString(file,"Example",gData[i][gExample], 16);
|
Thank you very, very much. This is the kind of help that makes this section awesome
Re: enum & string -
Mauzen - 30.01.2011
No problem, I like helping more experienced people with more advanced questions. Helping you also helped me, as I now know that you cant get the length from enums, wasnt sure
Those 'How do I set a players position?' questions are lame