19.07.2015, 14:20
What does this loop means?
1)
2)
Can anyone tell me that what does these both loops mean?
as I'm not able to understand them.
1)
PHP код:
enum USER_DATA
{
USER_ID,
USER_NAME[ MAX_PLAYER_NAME ],
USER_PASSWORD[ 129 ],
USER_ADMIN,
bool: USER_LOGGED_IN
};
new User[ MAX_PLAYERS ][ USER_DATA ];
public OnPlayerConnect( playerid )
{
for( new i; i < _: USER_DATA; ++i ) User[ playerid ][ USER_DATA: i ] = 0;
// ...
return 1;
}
PHP код:
stock DB_Escape(text[])
{
new
ret[80* 2],
ch,
i,
j;
while ((ch = text[i++]) && j < sizeof (ret))
{
if (ch == '\'')
{
if (j < sizeof (ret) - 2)
{
ret[j++] = '\'';
ret[j++] = '\'';
}
}
else if (j < sizeof (ret))
{
ret[j++] = ch;
}
else
{
j++;
}
}
ret[sizeof (ret) - 1] = '\0';
return ret;
}
as I'm not able to understand them.