Sign in to follow this  
Followers 0
Roman4ik

Команда Для Администратора /amusic

5 posts in this topic

ВСЕМ ПРИВЕТ :)

КОМАНДА /AMUSIC для Вашего сервера, берите себе работает проверено

Как работает команда, вы пишите в чат /amusic [радиус] [ссылка на музыку] Например (https://zaycevfm.cdnvideo.ru/ZaycevFM_pop_128.mp3) Не реклама :)

Начинаем

Эту команду добавляем к другим new

Спойлер

new AMusic_Zone = -1;

А эту команду добавляем в public OnPlayerCommandText(playerid, cmdtext[])

Спойлер

     if(strcmp(cmd, "/amusic", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 3) return true;
        new Float:X, Float:Y, Float:Z;
        if(MusicON == true)
        {
            foreach(Player, a)
            {
                if(GetPVarInt(a,"Music"))
                {
                    DeletePVar(a,"Music");
                    StopAudioStreamForPlayer(a);
                }
            }
            SendClientMessage(playerid,COLOR_LIGHTBLUE, "Музыка успешно выключена.");
            DestroyDynamicArea(AMusic_Zone);
            MusicON = false;
            return true;
        }
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY, " Помощь: /amusic [радиус] [ссылка]");
        new Float:Distance = strval(tmp);
        new length = strlen(cmdtext);
        while((idx < length) && (cmdtext[idx] <= ' '))
        {
            idx++;
        }
        new offset = idx;
        new result[64];
        while((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            result[idx - offset] = cmdtext[idx];
            idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result)) return SendClientMessage(playerid,COLOR_GREY, " Помощь: /amusic [радиус] [ссылка]");
        GetPlayerPos(playerid, X, Y, Z);
        MGM[4] = Distance; MGM[1] = X; MGM[2] = Y; MGM[3] = Z; URLW = result; MusicON = true;
        AMusic_Zone = CreateDynamicCircle(X, Y, Distance, -1, -1, -1);
        foreach(new i:Player)
        {
            if(IsPlayerInDynamicArea(i,AMusic_Zone))
            {
                if(!GetPVarInt(i,"Music"))
                {
                    SetPVarInt(i,"Music",1);
                    PlayAudioStreamForPlayer(i, result, 0.0, 0.0, 0.0, Distance, 0);
                    SendClientMessage(i,COLOR_MUSICA,"Внимание! Вы попали в музыкальную зону сервера.");
                }
            }
        }
        return true;
    }

Вот и все, теперь вы можете установить песню для ваших игроков, песню будут слушать все (СМОТРЯ КАКОЙ РАДИУС ПОСТАВИТЕ ВЫ)

 

Edited by odosenok

Share this post


Link to post
Share on other sites

А поменьше размер текста в своих темах не судьба сделать?

Share this post


Link to post
Share on other sites
30 минут назад, odosenok сказал:

А поменьше размер текста в своих темах не судьба сделать?

:)

Share this post


Link to post
Share on other sites

@Roman4ik 

2 часа назад, Roman4ik сказал:

 

Эту команду добавляем к другим new

  Открой ツ (открыть спойлер)

 

 

С каких пор у нас переменные это команды? 

и где ещё переменные MusicON MGM[4]  MGM[1] MGM[2] MGM[3] 
+ музыка играть не будет как кординаты стоят 0.0, 0.0, 0.0
Кароче бред полный не рабочий код + 0 оптимизации 

Edited by MuhammadPawn

Share this post


Link to post
Share on other sites

АВТОМАТИЧЕСКИ СФОРМИРОВАННОЕ СООБЩЕНИЕ:

Данная тема была перемещена модерацией или администрацией портала PAWNO-RUS.RU! 

Перемещена из: "Скриптинг PAWN > Готовые решения"

Перемещена в: "Прочее > Архив"

 

С уважением, ваш Бот! 

Если вы НЕ согласны с переносом данной темы в раздел "Прочее > Архив", пожалуйтесь на это сообщение в жалобе указав причины вашего недовольства. Спасибо. 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • F0urdeuces
      By F0urdeuces
      Всем привет , как сделать чтобы в парковку только мог человек с определяемой фракцией
      if (newkeys & KEY_HORN && IsPlayerInAnyVehicle(playerid)) { new carid = GetPlayerVehicleID(playerid); if(ParkingEntered[playerid] == -1) { for(new i;i<MAX_PARKING;i++) { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z])) { ShowPlayerDialogEx(playerid, 1981, DIALOG_STYLE_LIST, !"{BDBAB5}Выберите этаж!", "{FFFFFF}1.\n2.", "Принять", "Отмена"); } if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return true; } } } else { new i = ParkingEntered[playerid]; if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return true; } else { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pVExit_x],parking[i][pVExit_y],parking[i][pVExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered [playerid] = -1; return true; } } } } else if(PRESSED(KEY_WALK) && !IsPlayerInAnyVehicle(playerid)) { new carid = GetPlayerVehicleID(playerid); if(ParkingEntered[playerid] == -1) { for(new i;i<MAX_PARKING;i++) { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z])) { ShowPlayerDialogEx(playerid, 1981, DIALOG_STYLE_LIST, !"{BDBAB5}Выберите этаж!", "{FFFFFF}1.\n2.", "Принять", "Отмена"); } if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return true; } } } else { new i = ParkingEntered[playerid]; if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return true; } else { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pVExit_x],parking[i][pVExit_y],parking[i][pVExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered [playerid] = -1; return true; } } } } else if(PRESSED(KEY_WALK) && !IsPlayerInAnyVehicle(playerid)) { new carid = GetPlayerVehicleID(playerid); if(ParkingEntered[playerid] == -1) { for(new i;i<MAX_PARKING;i++) { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z])) { ShowPlayerDialogEx(playerid, 1981, DIALOG_STYLE_LIST, !"{BDBAB5}Выберите этаж!", "{FFFFFF}1.\n2.", "Принять", "Отмена"); } if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return 1; } } } else { new i = ParkingEntered[playerid]; if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pExit_x],parking[i][pExit_y],parking[i][pExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered[playerid] = -1; return 1; } else { if(IsPlayerInRangeOfPoint(playerid, 3, parking[i][pVExit_x],parking[i][pVExit_y],parking[i][pVExit_z])) { if(GetPlayerState(playerid) == 2) { J_SetVehiclePos(carid,parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); SetVehicleZAngle(carid,parking[i][pEnter_a]); LinkVehicleToInterior(carid, 0); SetVehicleVirtualWorld(carid, 0); } else { J_SetPlayerPosFreeze(playerid, parking[i][pEnter_x],parking[i][pEnter_y],parking[i][pEnter_z]); J_SetPlayerFacingAngle(playerid, parking[i][pEnter_a]); } SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); ParkingEntered [playerid] = -1; return 1; } } } } enum parkinginfo { Float:pEnter_x, Float:pEnter_y, Float:pEnter_z, Float:pEnter_a, pVWorld, Float:pExit_x, Float:pExit_y, Float:pExit_z, Float:pExit_a, Float:pVExit_x, Float:pVExit_y, Float:pVExit_z, Float:pVExit_a, }; //pEnter_x pEnter_y pEnter_z (Точки с которых заезжает в паркинг, pEnter_a поворот перса/автомобиля) //pExit_x pExit_y pExit_z ((pExit_a поворот перса/автомобиля)Точки с которых выезжает из паркинга на точки pEnter_x pEnter_y pEnter_z) //pVWorld (Вирт.Мир авто/игрока) //pVExit_x, pVExit_y, pVExit_z, pVExit_a тоже самое что и pEnter_x pEnter_y pEnter_z, только на второй этаж new parking[MAX_PARKING][parkinginfo] = { {774.6982,1651.0575,12.0073,357.5273, 1, 1017.3782,1005.9407,998.4375, 271.0465, 2496.8066,2343.3479,1502.3184,87.2872}, {1814.3567, -1877.0453, 13.5781, 3.1156, 2, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-78.3442,1180.6338,19.4433,178.3271, 3, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2811.5740,1235.1237,10.4653,88.9500, 5, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2650.6873,1181.1444,10.8203,91.8699, 6, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1790.0857,418.0161,19.9621,86.8489, 7, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1504.7184,-1325.3362,13.7060,271.2840, 8, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1436.8799,-1578.2943,13.2682,1.1519, 9, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1637.1638,-1684.8743,13.2173,93.0377, 10, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1403.2896,-1652.7843,13.1607,271.2161, 11, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1283.7948,-1349.4983,13.1657,3.1795, 12, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1175.3805,-1308.6919,13.6326,269.0903, 13, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {340.4299,-1618.8706,32.7566,179.5325, 14, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {611.8994,-1348.3763,13.4575,279.0285, 15, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {167.3457,-183.4712,1.3028,269.8813, 16, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-1991.2229,235.8233,28.6959,91.8888, 18, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2099.6377,-52.8561,35.0399,181.8297, 19, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2079.7205,-54.8950,34.9738,0.5623, 20, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2153.8198,277.4999,35.0464,181.6078, 21, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2443.9368,523.5727,29.9163,181.6118, 22, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-1967.0040,548.9451,34.8768,90.3882, 23, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2565.8049,556.1598,14.1902,269.6837, 24, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2627.1423,627.0738,14.1298,181.6917, 25, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2730.2429,75.1695,4.0616,271.5603, 26, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-1994.6035,-1032.1533,31.8478,359.2426, 27, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1613.7208,1721.5741,10.5646,265.7845, 28, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2201.0083,2411.4814,10.4901,177.4481, 29, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2255.9700,-1135.6167,26.4331,246.4052, 30, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2248.2683,-1726.0171,13.2362,268.7718, 31, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2773.5608,-1649.4165,11.4144,270.2876, 32, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2123.9248,-2295.5845,30.3705,142.9485, 33, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2443.9199,105.2780,34.8502,258.0834, 34, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1446.2391,2816.8208,10.5487,271.3440, 35, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {946.8265,1660.0414,8.3660,268.2236, 36, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {-2456.6633,2292.8625,4.7045,1.0456, 37, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1156.6422,-1627.2762,13.6746,0.0072, 38, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {2758.7075,-2365.7222,13.6328,93.9539, 38, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872}, {1798.8214,-1442.1119,13.4887,1.6389, 39, 1017.3782,1005.9407,998.4375, 271.0465,2496.8066,2343.3479,1502.3184,87.2872} };  
    • x_SkYAs_x
      By x_SkYAs_x
      Здравствуйте,я хотел бы узнать,как убрать миниганы с мопеда(мод Аризона РП)