Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- {
- if(IsPlayerConnected(playerid))//проверка на подключение игрока
- {
- if (PlayerToPoint(15, playerid,1544.69,-1631.00,13.10)) //15 это радиус. Далее проверка где игрок должен находится чтоб сработала команда.
- {
- if((IsACop(playerid)) || (PlayerInfo[playerid][pAdmin]>=1))//проверка на тех кто может его открывать, у меня все законники и модеры с админами.
- {
- if(lspdslak1 == 0)//проверка на запись в переменной, которую создали выше.
- {
- MoveObject(lspdslak, 1544.69,-1630.80,13.00, 0.2, 0.00,0.00,90.00);//здесь ставим координаты открытого шлакбаума, между координатами 0.2 - это скорость, не слишком медленно, но и не быстро.
- lspdslak1 = 1;//записываем в переменную
- SetTimer("lspdslakclose", 5000, 0);//запускаем таймер закрытия
- }
- else if(lspdslak1 == 1)//проверка на запись в переменной, которую создали выше.
- {
- MoveObject(lspdslak,1544.69,-1631.00,13.10, 0.2, 0.00,90.00,90.00);//кординаты закрытого шлакбаума, между координатами 0.2 - это скорость, не слишком медленно, но и не быстро.
- lspdslak1 = 0;//записываем в переменную
- }
- }
- }
- }
- }
- //==============================================================================
- SetPVarInt(playerid, "NoAB", 1);
- if(logs == 1)
- {
- // printr("OnPlayerCommandText");
- }
- new string[512];
- new playermoney;
- new sendername[MAX_PLAYER_NAME];
- new giveplayer[MAX_PLAYER_NAME];
- new cmd[256];
- new tmp[256];
- new giveplayerid, moneys, idx;
- new animationplayed;
- cmd = strtok(cmdtext, idx);
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if(logs == 1)
- {
- // printf("Command: %s | %s",cmd,sendername);
- }
- if(gPlayerLogged[playerid] ==0)
- {
- return 1;
- }
- if(strcmp("/cl", cmdtext, true, 10) == 0)
- {
- if(PlayerInfo[playerid][pAdmin]>=1)
- {
- for(new i; i<101; i++)
- SendClientMessageToAll(0x00000000,"");
- }
- }
- if(!strcmp(cmdtext, "/lsopen", true)) //тут место (/lsopen) команда для открытия ворот
- {
- if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // место 1 ставим id фракции которая будет открывать
- {
- MoveObject(vorot,1597.0996000,-1637.7998000,15.3000000, 2.2); // тут координаты открытых ворот 2.2 это скорость открывание ворот
- SetTimer("Vorot", 7000, 0); // 7000 это время в секундах
- SendClientMessage(playerid, COLOR_LIGHTBLUE,"Ворота закроются через 7 секунд."); // это текст меняем на свое или оставляем
- }
- else
- {
- return SendClientMessage(playerid,COLOR_YELLOW," Вы не можете открыть эти ворота!"); // ну тут наверное все понятно
- }
- return 1;
- }
- if(strcmp(cmd, "/givebilsf", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
- {
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebilsf [наименование] [id игрока]");
- SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
- return 1;
- }
- if(strcmp(x_nr,"билет",true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebilsf билет [id игрока]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Вам выдали военный билет");
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
- PlayerInfo[giveplayerid][pVoennik] = 1;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "ERROR");
- return 1;
- }
- }
- return 1;
- }
- //==============================================================================
- if(strcmp("/cap",cmdtext,true) == 0){
- if(IsPlayerInRangeOfPoint(playerid,8.0,257.8165,77.0322,1003.6406)){
- if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
- SetPlayerAttachedObject(playerid,3 , 18636, 2,0.131,0.045,0.00,0.0,90.0,96.0);
- }
- }
- }
- if(strcmp("/armour",cmdtext,true) == 0){
- if(IsPlayerInRangeOfPoint(playerid,8.0,257.8165,77.0322,1003.6406)){
- if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
- SetPlayerAttachedObject(playerid,2 , 19142, 1,0.08,0.04,0.00,0.0,0.0,-7.4);
- }
- }
- }
- if(strcmp("/capoff",cmdtext, true) == 0){
- if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
- RemovePlayerAttachedObject(playerid,3);
- }
- }
- if(strcmp("/armouroff",cmdtext, true) == 0){
- if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
- RemovePlayerAttachedObject(playerid,2);
- }
- }
- //============================================================================================
- else if(strcmp(cmd, "/facepalm", true) == 0)
- {
- SetPlayerChatBubble(playerid, "Facepalm", COLOR_PURPLE, 30.0, 10000);
- ApplyAnimation(playerid,"MISC","plyr_shkhead",4.0,0,0,0,0,0,1);
- return 1;
- }
- //=============================================================================================
- if(strcmp(cmd, "/givebillv", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
- {
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebillv [наименование] [id игрока]");
- SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
- return 1;
- }
- if(strcmp(x_nr,"билет",true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebil билет [id игрока]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Вам выдали военный билет");
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
- PlayerInfo[giveplayerid][pVoennik] = 2;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "ERROR");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd, "/givebills", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if (PlayerInfo[playerid][pMember] == 37 || PlayerInfo[playerid][pLeader] == 37)
- {
- new x_nr[256];
- x_nr = strtok(cmdtext, idx);
- if(!strlen(x_nr))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebills [наименование] [id игрока]");
- SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
- return 1;
- }
- if(strcmp(x_nr,"билет",true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_WHITE, "/givebills билет [id игрока]");
- return 1;
- }
- giveplayerid = ReturnUser(tmp);
- if(IsPlayerConnected(giveplayerid))
- {
- if(giveplayerid != INVALID_PLAYER_ID)
- {
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "Вам выдали военный билет");
- SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
- PlayerInfo[giveplayerid][pVoennik] = 3;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "ERROR");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmd,"/showbil",true)==0)
- {
- if(IsPlayerConnected(playerid))
- {
- new text1[120];
- if(PlayerInfo[playerid][pVoennik]) { text1 = "В запасе(пройдена)"; } else { text1 = "Не пройдена(не призван)"; }
- SendClientMessage(playerid, COLOR_WHITE, " __________________ Военный билет __________________");
- format(string, sizeof(string), "Военная служба: %s.", text1);
- SendClientMessage(playerid, COLOR_GREY, string);
- SendClientMessage(playerid, COLOR_WHITE, " ______________________________________________");
- }
- return 1;
- }
- if(strcmp(cmd, "/leaders", true) == 0)
- {
- string[0] = 0;
- for(new i=0;i<MAX_PLAYERS;i++)// Сканируем Всех...
- {
- new ttext[300];
- if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
- if(PlayerInfo[i][pLeader] <= 0) continue;// Отсеиваем лидеров...
- {
- if(PlayerInfo[i][pLeader] == 1) { ttext = "LSPD"; } //directory ранги
- else if(PlayerInfo[i][pLeader] == 2) { ttext = "ФБР"; }
- else if(PlayerInfo[i][pLeader] == 3) { ttext = "Армия: Авианосец"; }
- else if(PlayerInfo[i][pLeader] == 4) { ttext = "МЧС Сан Фиерро"; }
- else if(PlayerInfo[i][pLeader] == 5) { ttext = "LCN"; }
- else if(PlayerInfo[i][pLeader] == 6) { ttext = "Yakuza"; }
- else if(PlayerInfo[i][pLeader] == 7) { ttext = "Мэрия"; }
- else if(PlayerInfo[i][pLeader] == 8) { ttext = "Casino Rich"; }
- else if(PlayerInfo[i][pLeader] == 9) { ttext = "SF News"; }
- else if(PlayerInfo[i][pLeader] == 10) { ttext = "SFPD"; }
- else if(PlayerInfo[i][pLeader] == 11) { ttext = "Инструкторы"; }
- else if(PlayerInfo[i][pLeader] == 12) { ttext = "The Ballas "; }
- else if(PlayerInfo[i][pLeader] == 13) { ttext = "The Vagos"; }
- else if(PlayerInfo[i][pLeader] == 14) { ttext = "Русская мафия"; }
- else if(PlayerInfo[i][pLeader] == 15) { ttext = "The Grove"; }
- else if(PlayerInfo[i][pLeader] == 16) { ttext = "LS News"; }
- else if(PlayerInfo[i][pLeader] == 17) { ttext = "The Aztecas"; }
- else if(PlayerInfo[i][pLeader] == 18) { ttext = "The Rifa"; }
- else if(PlayerInfo[i][pLeader] == 19) { ttext = "Армия: Зона 51"; }
- else if(PlayerInfo[i][pLeader] == 20) { ttext = "LV News"; }
- else if(PlayerInfo[i][pLeader] == 21) { ttext = "LVPD"; }
- else if(PlayerInfo[i][pLeader] == 22) { ttext = "МЧС Лос Сантос"; }
- else if(PlayerInfo[i][pLeader] == 23) { ttext = "Sons of Silence MC"; }
- else if(PlayerInfo[i][pLeader] == 24) { ttext = "Street Racers"; }
- else if(PlayerInfo[i][pLeader] == 25) { ttext = "Инструкторы LS"; }
- else if(PlayerInfo[i][pLeader] == 26) { ttext = "Hell's Angels MC"; }
- else if(PlayerInfo[i][pLeader] == 27) { ttext = "Outlaws MC"; }
- else if(PlayerInfo[i][pLeader] == 28) { ttext = "Warlocks MC"; }
- else if(PlayerInfo[i][pLeader] == 29) { ttext = "Highwaymen MC"; }
- else if(PlayerInfo[i][pLeader] == 30) { ttext = "Free Souls MC"; }
- else if(PlayerInfo[i][pLeader] == 31) { ttext = "Pagans MC"; }
- else if(PlayerInfo[i][pLeader] == 32) { ttext = "Mongols MC"; }
- else if(PlayerInfo[i][pLeader] == 33) { ttext = "Vagos MC"; }
- else if(PlayerInfo[i][pLeader] == 34) { ttext = "Bandidos MC"; }
- else if(PlayerInfo[i][pLeader] == 35) { ttext = "Бригада"; }
- else if(PlayerInfo[i][pLeader] == 36) { ttext = "Машинисты"; }
- else if(PlayerInfo[i][pLeader] == 37) { ttext = "Армия: Эдвардс"; }
- }
- GetPlayerName(i, sendername, sizeof(sendername));
- format(string,sizeof(string),"%s%s: %s [%d]\n",string,ttext,sendername,i);
- }
- ShowPlayerDialog(playerid,139, DIALOG_STYLE_MSGBOX, "Лидеры Онлайн:", string, "OK", "Отмена");
- return 1;
- }
- if(strcmp(cmd, "/surr", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pCrimes] < 1)
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "Вы не в розыске!");
- return 1;
- }
- if(PlayerCuffed[playerid] > 0)
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "Вы не можете поднять руки!");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- SendClientMessage(playerid, COLOR_YELLOW2, "** Вы подготовились к арресту...");
- format(string, sizeof(string), "* Диспетчер: %s сдается и ждет арреста. Кординаты на GPS , Конец связи", sendername);
- SendRadioMessage(1,COLOR_LIGHTRED, string);
- SendRadioMessage(2,COLOR_LIGHTRED, string);
- SendRadioMessage(3,COLOR_LIGHTRED, string);
- SendRadioMessage(24,COLOR_LIGHTRED, string);
- SendRadioMessage(29,COLOR_LIGHTRED, string);
- SetPlayerColor(playerid, COLOR_WHITE);
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement