31.05.2014, 04:28
Alright. Here's lines 124300 - 124400
Код:
db_get_field_assoc(result, "PostBoxPickupZ", field, sizeof(field)); PostBoxInfo[i][PostBoxPickupZ] = floatstr(field); db_get_field_assoc(result, "PostBoxVirtual", field, sizeof(field)); PostBoxInfo[i][PostBoxVirtual] = strval(field); PostBoxInfo[i][PostBoxPickup] = CreateDynamicPickup(1239, 23, PostBoxInfo[i][PostBoxPickupX], PostBoxInfo[i][PostBoxPickupY], PostBoxInfo[i][PostBoxPickupZ], PostBoxInfo[i][PostBoxVirtual]); format(query, sizeof(query), "Post Box (ID: %d)\n\nType /sendmail to send your letters.", i); PostBoxInfo[i][PostBoxLabel] = CreateStreamed3DTextLabel(query, GREEN, PostBoxInfo[i][PostBoxPickupX], PostBoxInfo[i][PostBoxPickupY], PostBoxInfo[i][PostBoxPickupZ], 10.0, PostBoxInfo[i][PostBoxVirtual]); PostBoxInfo[i][PostBoxObject] = CreateDynamicObject(1258, PostBoxInfo[i][PostBoxX], PostBoxInfo[i][PostBoxY], PostBoxInfo[i][PostBoxZ], 0.0, 0.0, PostBoxInfo[i][PostBoxAngle], PostBoxInfo[i][PostBoxVirtual]); PostBoxInfo[i][PostBoxSQL] = i; db_next_row(result); } } db_free_result(result); return 1; } stock SavePostBoxes() { new query[256]; for (new i = 0; i < MAX_POSTBOXES; i ++) { if (!PostBoxInfo[i][PostBoxActive]) continue; format(query, sizeof(query), "UPDATE `PostBoxes` SET `PostBoxX` = '%f', `PostBoxY` = '%f', `PostBoxZ` = '%f', `PostBoxAngle` = '%f', `PostBoxPickupX` = '%f', `PostBoxPickupY` = '%f', `PostBoxPickupZ` = '%f', `PostBoxVirtual` = '%d' WHERE `PostBoxID` = '%d'", PostBoxInfo[i][PostBoxX], PostBoxInfo[i][PostBoxY], PostBoxInfo[i][PostBoxZ], PostBoxInfo[i][PostBoxAngle], PostBoxInfo[i][PostBoxPickupX], PostBoxInfo[i][PostBoxPickupY], PostBoxInfo[i][PostBoxPickupZ], PostBoxInfo[i][PostBoxVirtual], PostBoxInfo[i][PostBoxSQL] ); db_query(MailDB, query); } return 1; } stock LoadLetters() { new query[128], field[256], DBResult:result; result = db_query(MailDB, "SELECT * FROM `Letters`"); if (db_num_rows(result) != 0) { for (new i = 0, rows = db_num_rows(result); i < rows; i ++) { LetterInfo[i][LetterActive] = true; db_get_field_assoc(result, "LetterUnread", field, sizeof(field)); LetterInfo[i][LetterUnread] = (strval(field) == 1) ? (true) : (false); db_get_field_assoc(result, "LetterSent", field, sizeof(field)); LetterInfo[i][LetterSent] = (strval(field) == 1) ? (true) : (false); db_get_field_assoc(result, "LetterAddress", field, sizeof(field)); format(LetterInfo[i][LetterAddress], 128, "%s", field); db_get_field_assoc(result, "LetterSender", field, sizeof(field)); format(LetterInfo[i][LetterSender], 24, "%s", field); db_get_field_assoc(result, "LetterRecipient", field, sizeof(field)); format(LetterInfo[i][LetterRecipient], 24, "%s", field); db_get_field_assoc(result, "LetterMessage", field, sizeof(field)); format(LetterInfo[i][LetterMessage], 256, "%s", field); LetterInfo[i][LetterSQL] = i; db_next_row(result); } } db_free_result(result); return 1; } stock SaveLetters() { new query[768]; for (new i = 0; i < MAX_LETTERS; i ++) { if (!LetterInfo[i][LetterActive]) continue; format(query, sizeof(query), "UPDATE `Letters` SET `LetterUnread` = '%d', `LetterSent` = '%d', `LetterAddress` = '%s', `LetterSender` = '%s', `LetterRecipient` = '%s', `LetterMessage` = '%s' WHERE `LetterID` = '%d'", (LetterInfo[i][LetterUnread]) ? (1) : (0), (LetterInfo[i][LetterSent]) ? (1) : (0), LetterInfo[i][LetterAddress], LetterInfo[i][LetterSender], LetterInfo[i][LetterRecipient], LetterInfo[i][LetterMessage], LetterInfo[i][LetterSQL]); db_query(MailDB, query); } return 1; } stock ShowLetters(playerid, bool:message = true) { if (GetPlayerVirtualWorld(playerid) == PlayerInfo[playerid][pHouseKey] || GetPlayerVirtualWorld(playerid) == PlayerInfo[playerid][pHouseKey2] || GetPlayerVirtualWorld(playerid) == PlayerInfo[playerid][pHouseKey3] || GetPlayerVirtualWorld(playerid) == PlayerInfo[playerid][pHouseKey4]) { new letters, str[128], string[2800] ; strdel(string, 0, strlen(string)); for (new i = 0; i < MAX_LETTERS; i ++) {