static cell AMX_NATIVE_CALL ToBinary(AMX *amx, cell *params){ char szString[33]; cell *cptr; ConvertBit(params[1],szString); amx_GetAddr(amx,params[2],&cptr); amx_SetString(cptr, szString, 0); return 0;} ...................................void ConvertBit(int bin, char *str){ unsigned int mask; mask = 0x80000000; while (mask) { if (bin & mask) *str = '1'; else *str = '0'; str++; mask >>= 1; } *str = 0;}

SaveDunMap(){ if(GetValue("this",0) == 0) return; new num; if(GetValue("this",0) < 5) num = GetValue("this",0) * 3; else num = (GetValue("this",0) * 3) - 15; new n; new string1[500]; new string2[500]; new string3[500]; new slot,x,y; while(n < 1000) { x = n % 10; y = (n/10); slot = n / 400; if(slot == 0) string1[n] = FloorLayout[x][y] + 48; else if(slot == 1) string2[n - 400] = FloorLayout[x][y] + 48; else if(slot == 2) string3[n - 800] = FloorLayout[x][y] + 48; n++; } SetString("this",num,string1); SetString("this",num + 1,string2); SetString("this",num + 2,string3);}RestoreDunMap(){ if(GetValue("this",0) == 0) return; new num; if(GetValue("this",0) < 5) num = GetValue("this",0) * 3; else num = (GetValue("this",0) * 3) - 15; new n; new string1[500]; new string2[500]; new string3[500]; new slot,x,y; GetString("this",num,string1); GetString("this",num + 1,string2); GetString("this",num + 2,string3); if(isNull(string1) || isNull(string2) || isNull(string3)) return; while(n < 1000) { x = n % 10; y = (n/10); slot = n / 400; if(slot == 0) FloorLayout[x][y] = string1[n] - 48; else if(slot == 1) FloorLayout[x][y] = string2[n - 400] - 48; else if(slot == 2) FloorLayout[x][y] = string3[n - 800] - 48; n++; }}

new string[11];sprintf(string, "%X", Floor4Layout[10][10])

new string[11] = "0xDEADBEEF";Floor4Layout[10][10] = strtol(string, NULL, 16);

stock GetBits( v, p, s )//value, position, size{//(v >> p) shift value left 'p' bits// & see http://en.wikipedia.org/wiki/Bitwise_operation#AND// ((1<<s)-1) then s = 4 it would be 0b10000 so - 1 from that gives use 0b01111 and see above why you need to do that. return (v >> p) & ((1<<s)-1);}new value = 0xDEADBEEF; // F is bit 0,1,2,3 //GetBits( value, 0, 16 ) == 0x0000BEEF // that would be room 1 value//GetBits( value, 16, 16 ) == 0x0000DEAD // that would be room 2 valueprintf("%x\n", GetBits( value, 0, 16 ));printf("%x\n", GetBits( value, 16, 16 ))