Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <streamer>
- #include <dc_cmd>
- #include <a_mysql>
- main(){}
- #define BOX_ENABLED
- #define MAX_PRIZE_COUNT 5
- new area;
- enum E_BOX_STRUCT
- {
- // структура боксов
- Float: BS_POS_X,
- Float: BS_POS_Y,
- Float: BS_POS_Z,
- BS_AREA_ID
- };
- new g_boxes[MAX_BOXES_COUNT][E_BOX_STRUCT] =
- {
- { 1899.2340, 1177.8785, 30.0135, INVALID_STREAMER_ID },
- { 1879.9230, 1168.1254, 30.0106, INVALID_STREAMER_ID },
- { 1886.7753, 1182.9382, 30.0087, INVALID_STREAMER_ID }
- }
- enum E_PRIZE_STRUCT
- {
- PS_ITEM_ID,
- PS_ITEM_NAME[64]
- };
- new g_prizes_list[MAX_PRIZE_COUNT][E_PRIZE_STRUCT] =
- {
- { 24, "Desert Eagle (15 пт.)" },
- { 6, "Лопата" },
- { 10, "Дилдо" },
- { 0, "Деньги в размере 50.000" },
- { 0, "Деньги в размере 100.000" },
- { 0, "Деньги в размере 200.000" }
- };
- stock CreateBox(Float: x, Float: y, Float: z)
- {
- new area_id = CreateDynamicSphere(x, y, z, 3.0, 0, 0);
- CreateDynamicObject(19056, x, y, z, 0, 0, 0, 0, 0);
- CreateDynamic3DTextLabel("Нажмите alt чтобы открыть подарок", -1, x, y, z, 4.0, .worldid = 0, .interiorid = 0, .areaid = area_id);
- return area_id;
- }
- public OnGameModeInit()
- {
- SetGameModeText("Test");
- BoxInit();
- return 1;
- }
- stock BoxInit()
- {
- for (new i = 0; i < MAX_BOXES_COUNT; i++)
- {
- new x = g_boxes[i][BS_POS_X],
- y = g_boxes[i][BS_POS_Y],
- z = g_boxes[i][BS_POS_Z];
- new area_id = CreateBox(x, y, z);
- g_boxes[i][BS_AREA_ID] = area_id;
- printf("[Boxes] Box Init coord x: %f, y: %f, z: %f, area: %i", x, y, z, area_id);
- }
- }
- public OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA:areaid)
- {
- area = areaid;
- new string[144];
- format(string, sizeof(string), "Player: %i, Area: %i", playerid, areaid);
- SendClientMessage(playerid, -1, string);
- return 1;
- }
- public OnPlayerLeaveDynamicArea(playerid, STREAMER_TAG_AREA:areaid)
- {
- area = 0;
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (newkeys == 1024 && area != 0){
- new string[36];
- format(string, sizeof(string), "Вы нашли подарок, открыв его Вы обнаружили Desert Eagle (15 пт.)")
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Подарок!", "Вы нашли подарок, открыв его обнаружили ", "Забрать", "Отказаться");
- DestroyDynamicObject(STREAMER_TAG_OBJECT: area);
- DestroyDynamic3DTextLabel(Text3D: area);
- DestroyDynamicArea(STREAMER_TAG_AREA: area);
- }
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerPos(playerid, 1890.6500,1167.9888,29.6750);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (response)
- {
- GivePlayerWeapon(playerid, 24, 15);
- SendClientMessage(playerid, -1, "Вы забрали Desert Eagle (15 патронов)");
- }
- else
- {
- SendClientMessage(playerid, -1, "Вы отказались от приза");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement