Question

Мне надо чтобы у всех фракций и работ была единая команда вызова а не разные типа (/gopolice, /gomedic, /gotaxi и т.п)
Как вот эту команду сделать чтобы она была для всех фракций и работ?
 

CMD:tall(playerid, params[])
{
    if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, YouCanNot);
	else if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, VAGOS_COLOR, "{ffcf00}Введите: /tall [id игрока]");
	else if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotOnline);
	else if(PlayerLogged[params[0]] == false) return SendClientMessage(playerid, COLOR_GREY, PlayerIsNotAuthorized);
	else if(!PoliceON[params[0]]) return SendClientMessage(playerid, COLOR_GREY, "Этот игрок не вызывал полицию либо его вызов уже приняли");
	foreach(new i: Player)
	{
		if(PlayerLogged[i] == false) continue;
		if(IsACop(i)) SendMes(i, COLOR_YELLOW, "%s %s принял вызов %s", Fraction_Rang[PI[playerid][pMember]][PI[playerid][pRank]], GetName(playerid), GetName(params[0]));
	}
	SendMes(params[0], COLOR_GREEN, "%s %s принял ваш вызов, ждите", Fraction_Rang[PI[playerid][pMember]][PI[playerid][pRank]], GetName(playerid));
	SendMes(playerid, COLOR_GREEN, "Игрок %s отмечен на карте", GetName(params[0]));
	new Float:X, Float:Y, Float:Z;
	GetPlayerPos(params[0], X, Y, Z);
	DisablePlayerRaceCheckpoint(playerid);
	SetPlayerRaceCheckpoint(playerid, 1, X, Y, Z, 0.0, 0.0, 0.0, 5);
	UseGPS[playerid] = true;
	PoliceON[params[0]] = false;
	SetPVarInt(params[0], "CallPolice", gettime()+600);
	return 1;
}

 Тут ещё в new есть.

Спойлер

new bool:PoliceON[MAX_PLAYERS];
new bool:MedicON[MAX_PLAYERS];
new bool:TaxiON[MAX_PLAYERS];
new bool:MechanicON[MAX_PLAYERS];


 

Спойлер

    }
    case D_SERVICE+1:
        {
            if(!response)
            {
                if(PI[playerid][pJail] > 0) return SendClientMessage(playerid, COLOR_GREY, "Ó âàñ èçúÿëè òåëåôîí!");
                return ShowPlayerDialog(playerid, D_HEAL+3, 2, "{FF7700}Ñåðâèñû", "1. Âûçâàòü ìåõàíèêà\n2. Âûçâàòü òàêñè\n3. Âûçâàòü ñêîðóþ ïîìîøü\n4. Âûçâàòü ïîëèöèþ", "Ïðèíÿòü", "Íàçàä");
            }
            if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPlayerVirtualWorld(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPVarInt(playerid, "CallMech") > gettime()) return SendClientMessage(playerid, COLOR_GREY, "Âû íåäàâíî âûçûâàëè ìåõàíèêà!");
            if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return SendClientMessage(playerid, COLOR_GREY, "Â ñîîáùåíèè äîëæíî áûòü îò 6 äî 20 ñèìâîëîâ!");
            new full = 0;
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(PI[pJob] == JOB_MECHANIC && i != playerid) full++;
            }
            if(!full) SendClientMessage(playerid, COLOR_GREY, "Â äàííûé ìîìåíò íåò ìåõàíèêîâ íà äåæóðñòâå!");
            else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Âàø çàïðîñ ïîñëàí ìåõàíèêàì. Æäèòå îòâåòà");
            MechanicON[playerid] = true;
            new trr[3];
            if(IsPlayerToSquare(playerid,-891.3302,-2950.0190,2915.9917,560.3257)) trr = "LS";
            else if(IsPlayerToSquare(playerid,-2929.6589,-2889.1660,-1326.9077,1493.1770)) trr = "SF";
            else trr = "LV";
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(PI[pJob] == JOB_MECHANIC)
                {
                    SendMes(i, COLOR_WHITE, "%s[%i] {FFFF00}ñ ãîðîäà {FFFFFF}%s{FFFF00}, âûçûâàåò ìåõàíèêà, ìåñòîïîëîæåíèå: {FFFFFF}%s", GetName(playerid), playerid, trr, inputtext);
                    SendClientMessage(i, COLOR_YELLOW, "×òîáû ïðèíÿòü âûçîâ ââåäèòå {FFFFFF}/gomechanic");
                }
            }
        }
    case D_SERVICE+2:
        {
            if(!response)
            {
                if(PI[playerid][pJail] > 0) return SendClientMessage(playerid, COLOR_GREY, "Ó âàñ èçúÿëè òåëåôîí!");
                return ShowPlayerDialog(playerid, D_HEAL+3, 2, "{FF7700}Ñåðâèñû", "1. Âûçâàòü ìåõàíèêà\n2. Âûçâàòü òàêñè\n3. Âûçâàòü ñêîðóþ ïîìîøü\n4. Âûçâàòü ïîëèöèþ", "Ïðèíÿòü", "Íàçàä");
            }
            if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPlayerVirtualWorld(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPVarInt(playerid, "CallTaxi") > gettime()) return SendClientMessage(playerid, COLOR_GREY, "Âû íåäàâíî âûçûâàëè òàêñèñòà!");
            if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return SendClientMessage(playerid, COLOR_GREY, "Â ñîîáùåíèè äîëæíî áûòü îò 6 äî 20 ñèìâîëîâ!");
            new full = 0;
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(PI[pJob] == JOB_TAXI && i != playerid) full++;
            }
            if(!full) SendClientMessage(playerid, COLOR_GREY, "Â äàííûé ìîìåíò íåò òàêñèñòîâ íà äåæóðñòâå!");
            else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Âàø çàïðîñ ïîñëàí òàêñèñòàì. Æäèòå îòâåòà");
            TaxiON[playerid] = true;
            new trr[3];
            if(IsPlayerToSquare(playerid,-891.3302,-2950.0190,2915.9917,560.3257)) trr = "LS";
            else if(IsPlayerToSquare(playerid,-2929.6589,-2889.1660,-1326.9077,1493.1770)) trr = "SF";
            else trr = "LV";
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(PI[pJob] == JOB_TAXI)
                {
                    SendMes(i, COLOR_WHITE, "%s[%i] {FFFF00}ñ ãîðîäà {FFFFFF}%s{FFFF00}, âûçûâàåò òàêñè, ìåñòîïîëîæåíèå: {FFFFFF}%s", GetName(playerid), playerid, trr, inputtext);
                    SendClientMessage(i, COLOR_YELLOW, "×òîáû ïðèíÿòü âûçîâ ââåäèòå {FFFFFF}/gotaxi");
                }
            }
        }
    case D_SERVICE+3:
        {
            if(!response)
            {
                if(PI[playerid][pJail] > 0) return SendClientMessage(playerid, COLOR_GREY, "Ó âàñ èçúÿëè òåëåôîí!");
                return ShowPlayerDialog(playerid, D_HEAL+3, 2, "{FF7700}Ñåðâèñû", "1. Âûçâàòü ìåõàíèêà\n2. Âûçâàòü òàêñè\n3. Âûçâàòü ñêîðóþ ïîìîøü\n4. Âûçâàòü ïîëèöèþ", "Ïðèíÿòü", "Íàçàä");
            }
            if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPlayerVirtualWorld(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPVarInt(playerid, "CallMedic") > gettime()) return SendClientMessage(playerid, COLOR_GREY, "Âû íåäàâíî âûçûâàëè ñêîðóþ ïîìîùü!");
            if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return SendClientMessage(playerid, COLOR_GREY, "Â ñîîáùåíèè äîëæíî áûòü îò 6 äî 20 ñèìâîëîâ!");
            new full = 0;
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(IsAMedic(i) && i != playerid) full++;
            }
            if(!full) SendClientMessage(playerid, COLOR_GREY, "Â äàííûé ìîìåíò íåò ìåäèêîâ íà äåæóðñòâå!");
            else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Âàø çàïðîñ íà ìåäèöèíñêóþ ïîìîùü ïîñëàí. Æäèòå îòâåòà");
            MedicON[playerid] = true;
            new trr[3];
            if(IsPlayerToSquare(playerid,-891.3302,-2950.0190,2915.9917,560.3257)) trr = "Þæíûé";
            else if(IsPlayerToSquare(playerid,-2929.6589,-2889.1660,-1326.9077,1493.1770)) trr = "SF";
            else trr = "LV";
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(IsAMedic(i))
                {
                    SendMes(i, COLOR_WHITE, "%s[%i] {FFFF00}ñ ãîðîäà {FFFFFF}%s{FFFF00}, âûçûâàåò ñêîðóþ ïîìîùü, ìåñòîïîëîæåíèå: {FFFFFF}%s", GetName(playerid), playerid, trr, inputtext);
                    SendClientMessage(i, COLOR_YELLOW, "×òîáû ïðèíÿòü âûçîâ ââåäèòå {FFFFFF}/calling");
                }
            }
        }
    case D_SERVICE+4:
        {
            if(!response)
            {
                if(PI[playerid][pJail] > 0) return SendClientMessage(playerid, COLOR_GREY, "Ó âàñ èçúÿëè òåëåôîí!");
                return ShowPlayerDialog(playerid, D_HEAL+3, 2, "{FF7700}Ñåðâèñû", "1. Âûçâàòü ìåõàíèêà\n2. Âûçâàòü òàêñè\n3. Âûçâàòü ñêîðóþ ïîìîøü\n4. Âûçâàòü ïîëèöèþ", "Ïðèíÿòü", "Íàçàä");
            }
            if(GetPlayerInterior(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPlayerVirtualWorld(playerid) != 0) return SendClientMessage(playerid, COLOR_GREY, "[Äèñïåò÷åð] Íå óäàëîñü îïðåäåëèòü Âàøå ìåñòîïîëîæåíèå. Âûéäèòå èç ïîìåùåíèÿ.");
            if(GetPVarInt(playerid, "CallPolice") > gettime()) return SendClientMessage(playerid, COLOR_GREY, "Âû íåäàâíî âûçûâàëè ïîëèöèþ!");
            if(strlen(inputtext) < 6 || strlen(inputtext) > 20) return SendClientMessage(playerid, COLOR_GREY, "Â ñîîáùåíèè äîëæíî áûòü îò 6 äî 20 ñèìâîëîâ!");
            new full = 0;
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(IsACop(i) && i != playerid) full++;
            }
            if(!full) SendClientMessage(playerid, COLOR_GREY, "Â äàííûé ìîìåíò íåò ïîëèöåéñêèõ íà äåæóðñòâå!");
            else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Âàø çàïðîñ áûë îòïðàâëåí ïîëèöèè. Æäèòå îòâåòà");
            PoliceON[playerid] = true;
            new trr[3];
            if(IsPlayerToSquare(playerid,-891.3302,-2950.0190,2915.9917,560.3257)) trr = "LS";
            else if(IsPlayerToSquare(playerid,-2929.6589,-2889.1660,-1326.9077,1493.1770)) trr = "SF";
            else trr = "LV";
            foreach(new i: Player)
            {
                if(PlayerLogged == false) continue;
                if(IsACop(i))
                {
                    SendMes(i, COLOR_WHITE, "%s[%i] {FFFF00}ñ ãîðîäà {FFFFFF}%s{FFFF00}, âûçûâàåò ïîëèöèþ, ìåñòîïîëîæåíèå: {FFFFFF}%s", GetName(playerid), playerid, trr, inputtext);
                    SendClientMessage(i, COLOR_YELLOW, "×òîáû ïðèíÿòü âûçîâ ââåäèòå {FFFFFF}/gopolice");
                }
             }
        }

 

Edited by Leo_Carter

Share this post


Link to post

2 answers to this question

  • 0

Вам нужно команда вызова, а Вы скидываете команду принятия, либо определитесь что Вам надо, либо скидывайте нужную команду, которую нужно переделать

Share this post


Link to post
  • 0

Все команды, которыми принимаются вызова помести под тег кода и спойлера, скинь сюда.

Но, имхо, тебе стоит обратиться в стол заказов.
При копировании участка кода из текстового редактора всегда переключайся на русскую раскладку, дабы избежать кривое копирование кириллицы.

 

Share this post


Link to post
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

    • Chopick
      By Chopick
      Всем здравствуйте! Делаю систему домов/бизнесов по туториалу knox know с плагином GoodArea. Есть проблема, если заходишь в интерьер бизнеса, то когда выходишь спавнит почему-то на пикап дома.

      Вот енумы:
       
      #define MAX_HOUSES 1000 #define MAX_BIZS 1000 enum house {         hID,         STREAMER_TAG_PICKUP:hPICKUP,         STREAMER_TAG_AREA:hAREA,         hOWNER[MAX_PLAYER_NAME],         STREAMER_TAG_3D_TEXT_LABEL:hTEXT[256],         STREAMER_TAG_MAP_ICON:hICON,         hPRICE,         hCLASS,         hINTERIOR,         Float:hX,         Float:hY,         Float:hZ,         Float:hA,         hCONDITION // Закрыт/Открыт } new House[MAX_HOUSES][house]; new Houses; new HouseGroup; enum biz {         bID,         STREAMER_TAG_PICKUP:bPICKUP,         STREAMER_TAG_AREA:bAREA,         bOWNER[MAX_PLAYER_NAME],         STREAMER_TAG_3D_TEXT_LABEL:bTEXT[256],         STREAMER_TAG_MAP_ICON:bICON,         bNAME[25],         bPRICE,         bTYPE,         bINTERIOR,         Float:bX,         Float:bY,         Float:bZ,         Float:bA } new Biz[MAX_BIZS][biz]; new Bizs; new BizGroup; enum interior_info {         intID,         intNAME[41],         intINTERIOR,         Float:intX,         Float:intY,         Float:intZ,         Float:intA,         STREAMER_TAG_AREA:intAREA } new Interior[MAX_INTERIORS][interior_info]; new Interiors; new InteriorGroup; Вот что у меня в OnGameModeInit:
      HouseGroup = CreateGroupGoodAreas(GoodArea:HouseEnter); InteriorGroup = CreateGroupGoodAreas(GoodArea:InteriorExit); BizGroup = CreateGroupGoodAreas(GoodArea:BizArea);  
      Вот стоки:
      GAResponse:HouseEnter(playerid, response, key, index) {         switch(response)         {             case GA_RESPONSE_PRESS_KEY:             {                 if(key & KEY_WALK)                 {                 if(House[index][hCONDITION] > 0 && House[index][hOWNER] == player_info[playerid][NAME] || House[index][hCONDITION] == 0)                 {                                         GoToInterior(playerid, House[index][hINTERIOR]);                                         SetPlayerVirtualWorld(playerid, index);                                 }                                 else if(House[index][hCONDITION] > 0 && House[index][hOWNER] != player_info[playerid][NAME]) return SCM(playerid, COLOR_RED, "[Ошибка]{ffffff}Этот дом закрыт на ключ!");                         }                 }                 case GA_RESPONSE_ENTER:                 {                     if(House[index][hOWNER] == 0)                     {                         CreateNoOwnerHouseTD(playerid);                         for(new i = 0; i < sizeof NoOwnerTextDraw_PTD[]; i++)                         {                             PlayerTextDrawShow(playerid, NoOwnerTextDraw_PTD[playerid][i]);                                 }                                 new price[8];                                 format(price, sizeof(price), "%d$", House[index][hPRICE]);                                 PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][2], price);                                 new id[9];                                 format(id, sizeof(id), "%d", House[index][hID]);                                 PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][0], id);                                 switch(House[index][hCLASS])                                 {                                     case 1: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "A");                                     case 2: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "B");                                     case 3: PlayerTextDrawSetString(playerid, NoOwnerTextDraw_PTD[playerid][1], "C");                                 }                                 for(new i = 0; i < sizeof NoOwnerTextDraw_TD; i++)                         {                             TextDrawShowForPlayer(playerid, NoOwnerTextDraw_TD[i]);                                 }                         }                 }                 case GA_RESPONSE_LEAVE:                 {                 for(new i = 0; i < sizeof NoOwnerTextDraw_PTD[]; i++)                 {                     PlayerTextDrawHide(playerid, NoOwnerTextDraw_PTD[playerid][i]);                         }                         for(new i = 0; i < sizeof NoOwnerTextDraw_TD; i++)                 {                     TextDrawHideForPlayer(playerid, NoOwnerTextDraw_TD[i]);                         }                 }         }         return 1; } GAResponse:BizArea(playerid, response, key, index) {         switch(response)         {             case GA_RESPONSE_PRESS_KEY:             {                 if(key & KEY_WALK)                 {                     GoToInteriorBiz(playerid, Biz[index][bINTERIOR]);                                 SetPlayerVirtualWorld(playerid, index);                 }                 }         }         return 1; } GAResponse:InteriorExit(playerid, response, key, index) {         switch(response)         {             case GA_RESPONSE_PRESS_KEY:             {                 new world = GetPlayerVirtualWorld(playerid);                 if(key & KEY_WALK)                 {                     if(world < MAX_HOUSES)                     {                         SetPlayerInterior(playerid, 0);                             SetPlayerVirtualWorld(playerid, 0);                             SetPlayerPos(playerid, House[world][hX], House[world][hY], House[world][hZ]);                             SetPlayerFacingAngle(playerid, House[world][hA]);                                 }                                 else if(world < MAX_HOUSES + MAX_BIZS)                     {                         world -= MAX_HOUSES;                                         printf("%d index world", world);                         SetPlayerInterior(playerid, 0);                             SetPlayerVirtualWorld(playerid, 0);                             SetPlayerPos(playerid, Biz[world][bX], Biz[world][bY], Biz[world][bZ]);                             SetPlayerFacingAngle(playerid, Biz[world][bA]);                                 }                         }                         if(key & KEY_CTRL_BACK)                         {                             if(player_info[playerid][HOUSE] != House[world][hID]) return SCM(playerid, COLOR_RED, "[Ошибка]{ffffff}Вы не владелец данного дома!");                             new dialog[256];                                 format(dialog, sizeof(dialog),                                         "{ffd900}[1]{ffffff}Информация о доме\n\                                         {ffd900}[2]{ffffff}%s дом",                                 (House[world][hCONDITION] == 1) ? ("{00ff00}Открыть") : ("{ff0000}Закрыть"));                             SPD(playerid, DLG_HMENU, DIALOG_STYLE_LIST, "{ffd900}Меню дома", dialog, "Выбрать", "Закрыть");                             return 1;                         }                 }         }         return 1; } stock GoToInterior(playerid, interior) {     for(new i = 0; i < Interiors; i++)         {             if(Interior[i][intID] != interior) continue;             SetPlayerInterior(playerid, Interior[i][intINTERIOR]);             SetPlayerPos(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ]);             SetPlayerFacingAngle(playerid, Interior[i][intA]);             SetPlayerCheckpoint(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 1.0);             new str[128];             format(str, sizeof(str),                         "Нажмите \"ALT\" для выхода\n\                         Нажмите \"H\", чтобы открыть меню дома");             Create3DTextLabel(str, -1, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 15.0, 0, 1);             return 1;         }         return 0; } stock GoToInteriorBiz(playerid, interior) {     for(new i = 0; i < Interiors; i++)         {             if(Interior[i][intID] != interior) continue;             SetPlayerInterior(playerid, Interior[i][intINTERIOR]);             SetPlayerPos(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ]);             SetPlayerFacingAngle(playerid, Interior[i][intA]);             SetPlayerCheckpoint(playerid, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 1.0);             new str[128];             format(str, sizeof(str),                         "Нажмите \"ALT\" для выхода");             Create3DTextLabel(str, -1, Interior[i][intX], Interior[i][intY], Interior[i][intZ], 15.0, 0, 1);             return 1;         }         return 0; }  
       
      Что мне делать, подскажите пожалуйста?