15.07.2010, 00:07
Код:
static _PackPlayerAccInfo(pid) { new tut = 1 /*GetPlayerFlag1(pid, f1_Tutorial)*/, sex = gPA[pid][paSex], origin = gPA[pid][paOrigin], day = gPA[pid][paBirthDate][0], mon = gPA[pid][paBirthDate][1], year = gPA[pid][paBirthDate][2], reg = 1, res; res = ((sex & 1) | ((tut & 1) << 1) | ((reg & 1) << 2) | ((origin & 15) << 3) | ((day & 31) << 7) | ((mon & 15) << 12) | ((year & 2047) << 16)); return res; } static _UnPackPlayerAccInfo(pid, data) { new tut, sex, origin, day, mon, year, reg; sex = (data & 1); tut = ((data >> 1) & 1); reg = ((data >> 2) & 1); origin = ((data >> 3) & 15); day = ((data >> 7) & 31); mon = ((data >> 12) & 15); year = ((data >> 16) & 2047); gPA[pid][paSex] = sex; gPA[pid][paOrigin] = origin; gPA[pid][paBirthDate][0] = day; gPA[pid][paBirthDate][1] = mon; gPA[pid][paBirthDate][2] = year; //if (tut) // SetPlayerFlag1(pid, f1_Tutorial); //else // ResetPlayerFlag1(pid, f1_Tutorial); return 1; }