Q Is it possible to do it like this?
#1

Well i've been thinking that an array which does not posses enum as a its size can be done very nicely with a loop by doing (for example for palyer stat)
pInfo[playerid][i] = /*get a value which has an index and is a part of a string, using strtok function f.e.*/
now the question is can I still process an array (multi or single dimensional) which had enum using values to represent parts of it? example:
pawn Код:
// in code where I need it
#define MAX_STATS 3
enum stats
{
    Name,
    Password,
    Money
}

new pInfo[MAX_PLAYERS][stats];

for(new i = 0; i < MAX_STATS; i++)
{
        // this code was taken from moderntopia script
        new Data[1024];
        new Field[64];
        new rcnt = 1;
        MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
        samp_mysql_strtok(Field, "|", Data);
        while (samp_mysql_strtok(Field, "|", "")==1)
        {
            pInfo[playerid][rcnt] = strval(Field);
            rcnt++;
        }
        samp_mysql_free_result();
    }
}
i cut this part from moderntopia script and removed what wasn't needed. I want to know whether the while could be done this way. and if it cannot is there any other way without enum to define values of an array?
Reply
#2

Umm, people is it possible?
Reply
#3

ahh, damn... where can i get pawn_lang.pdf?
Reply
#4

Quote:
Originally Posted by Thanatos
ahh, damn... where can i get pawn_lang.pdf?
There ya go buddy

http://forum.sa-mp.com/index.php?topic=139.0
Reply
#5

thanks but no thanks ;]
Reply
#6

Quote:
Originally Posted by Thanatos
thanks but no thanks ;]
You asked for the pawn_lang.pdf, he gave you a link which has the link to it.
Reply
#7

I said thanks for his link and no thaks cuz I found it, so... whatever ;P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)