Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.04 KB | None | 0 0
  1. public OnPlayerCommandText(playerid, cmdtext[])
  2.  
  3. {
  4. {
  5. if(IsPlayerConnected(playerid))//проверка на подключение игрока
  6. {
  7. if (PlayerToPoint(15, playerid,1544.69,-1631.00,13.10)) //15 это радиус. Далее проверка где игрок должен находится чтоб сработала команда.
  8. {
  9. if((IsACop(playerid)) || (PlayerInfo[playerid][pAdmin]>=1))//проверка на тех кто может его открывать, у меня все законники и модеры с админами.
  10. {
  11. if(lspdslak1 == 0)//проверка на запись в переменной, которую создали выше.
  12. {
  13. MoveObject(lspdslak, 1544.69,-1630.80,13.00, 0.2, 0.00,0.00,90.00);//здесь ставим координаты открытого шлакбаума, между координатами 0.2 - это скорость, не слишком медленно, но и не быстро.
  14. lspdslak1 = 1;//записываем в переменную
  15. SetTimer("lspdslakclose", 5000, 0);//запускаем таймер закрытия
  16. }
  17. else if(lspdslak1 == 1)//проверка на запись в переменной, которую создали выше.
  18. {
  19. MoveObject(lspdslak,1544.69,-1631.00,13.10, 0.2, 0.00,90.00,90.00);//кординаты закрытого шлакбаума, между координатами 0.2 - это скорость, не слишком медленно, но и не быстро.
  20. lspdslak1 = 0;//записываем в переменную
  21. }
  22. }
  23. }
  24. }
  25. }
  26. //==============================================================================
  27. SetPVarInt(playerid, "NoAB", 1);
  28. if(logs == 1)
  29. {
  30. // printr("OnPlayerCommandText");
  31. }
  32. new string[512];
  33. new playermoney;
  34. new sendername[MAX_PLAYER_NAME];
  35. new giveplayer[MAX_PLAYER_NAME];
  36. new cmd[256];
  37. new tmp[256];
  38. new giveplayerid, moneys, idx;
  39. new animationplayed;
  40. cmd = strtok(cmdtext, idx);
  41. GetPlayerName(playerid, sendername, sizeof(sendername));
  42. if(logs == 1)
  43. {
  44. // printf("Command: %s | %s",cmd,sendername);
  45. }
  46. if(gPlayerLogged[playerid] ==0)
  47. {
  48. return 1;
  49. }
  50. if(strcmp("/cl", cmdtext, true, 10) == 0)
  51. {
  52. if(PlayerInfo[playerid][pAdmin]>=1)
  53. {
  54. for(new i; i<101; i++)
  55. SendClientMessageToAll(0x00000000,"");
  56. }
  57. }
  58. if(!strcmp(cmdtext, "/lsopen", true)) //тут место (/lsopen) команда для открытия ворот
  59. {
  60. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1) // место 1 ставим id фракции которая будет открывать
  61. {
  62. MoveObject(vorot,1597.0996000,-1637.7998000,15.3000000, 2.2); // тут координаты открытых ворот 2.2 это скорость открывание ворот
  63. SetTimer("Vorot", 7000, 0); // 7000 это время в секундах
  64. SendClientMessage(playerid, COLOR_LIGHTBLUE,"Ворота закроются через 7 секунд."); // это текст меняем на свое или оставляем
  65. }
  66. else
  67. {
  68. return SendClientMessage(playerid,COLOR_YELLOW," Вы не можете открыть эти ворота!"); // ну тут наверное все понятно
  69. }
  70. return 1;
  71. }
  72. if(strcmp(cmd, "/givebilsf", true) == 0)
  73. {
  74. if(IsPlayerConnected(playerid))
  75. {
  76. if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  77. {
  78. new x_nr[256];
  79. x_nr = strtok(cmdtext, idx);
  80. if(!strlen(x_nr))
  81. {
  82. SendClientMessage(playerid, COLOR_WHITE, "/givebilsf [наименование] [id игрока]");
  83. SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
  84. return 1;
  85. }
  86. if(strcmp(x_nr,"билет",true) == 0)
  87. {
  88. tmp = strtok(cmdtext, idx);
  89. if(!strlen(tmp))
  90. {
  91. SendClientMessage(playerid, COLOR_WHITE, "/givebilsf билет [id игрока]");
  92. return 1;
  93. }
  94. giveplayerid = ReturnUser(tmp);
  95. if(IsPlayerConnected(giveplayerid))
  96. {
  97. if(giveplayerid != INVALID_PLAYER_ID)
  98. {
  99. GetPlayerName(playerid, sendername, sizeof(sendername));
  100. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  101. format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
  102. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  103. format(string, sizeof(string), "Вам выдали военный билет");
  104. SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  105. PlayerInfo[giveplayerid][pVoennik] = 1;
  106. return 1;
  107. }
  108. }
  109. else
  110. {
  111. SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
  112. return 1;
  113. }
  114. }
  115. }
  116. else
  117. {
  118. SendClientMessage(playerid, COLOR_GREY, "ERROR");
  119. return 1;
  120. }
  121. }
  122. return 1;
  123. }
  124. //==============================================================================
  125. if(strcmp("/cap",cmdtext,true) == 0){
  126. if(IsPlayerInRangeOfPoint(playerid,8.0,257.8165,77.0322,1003.6406)){
  127. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
  128. SetPlayerAttachedObject(playerid,3 , 18636, 2,0.131,0.045,0.00,0.0,90.0,96.0);
  129. }
  130. }
  131. }
  132.  
  133. if(strcmp("/armour",cmdtext,true) == 0){
  134. if(IsPlayerInRangeOfPoint(playerid,8.0,257.8165,77.0322,1003.6406)){
  135. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
  136. SetPlayerAttachedObject(playerid,2 , 19142, 1,0.08,0.04,0.00,0.0,0.0,-7.4);
  137. }
  138. }
  139. }
  140. if(strcmp("/capoff",cmdtext, true) == 0){
  141. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
  142. RemovePlayerAttachedObject(playerid,3);
  143. }
  144. }
  145. if(strcmp("/armouroff",cmdtext, true) == 0){
  146. if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1){
  147. RemovePlayerAttachedObject(playerid,2);
  148. }
  149. }
  150. //============================================================================================
  151. else if(strcmp(cmd, "/facepalm", true) == 0)
  152. {
  153. SetPlayerChatBubble(playerid, "Facepalm", COLOR_PURPLE, 30.0, 10000);
  154. ApplyAnimation(playerid,"MISC","plyr_shkhead",4.0,0,0,0,0,0,1);
  155. return 1;
  156. }
  157. //=============================================================================================
  158. if(strcmp(cmd, "/givebillv", true) == 0)
  159. {
  160. if(IsPlayerConnected(playerid))
  161. {
  162. if (PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19)
  163. {
  164. new x_nr[256];
  165. x_nr = strtok(cmdtext, idx);
  166. if(!strlen(x_nr))
  167. {
  168. SendClientMessage(playerid, COLOR_WHITE, "/givebillv [наименование] [id игрока]");
  169. SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
  170. return 1;
  171. }
  172. if(strcmp(x_nr,"билет",true) == 0)
  173. {
  174. tmp = strtok(cmdtext, idx);
  175. if(!strlen(tmp))
  176. {
  177. SendClientMessage(playerid, COLOR_WHITE, "/givebil билет [id игрока]");
  178. return 1;
  179. }
  180. giveplayerid = ReturnUser(tmp);
  181. if(IsPlayerConnected(giveplayerid))
  182. {
  183. if(giveplayerid != INVALID_PLAYER_ID)
  184. {
  185. GetPlayerName(playerid, sendername, sizeof(sendername));
  186. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  187. format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
  188. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  189. format(string, sizeof(string), "Вам выдали военный билет");
  190. SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  191. PlayerInfo[giveplayerid][pVoennik] = 2;
  192. return 1;
  193. }
  194. }
  195. else
  196. {
  197. SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
  198. return 1;
  199. }
  200. }
  201. }
  202. else
  203. {
  204. SendClientMessage(playerid, COLOR_GREY, "ERROR");
  205. return 1;
  206. }
  207. }
  208. return 1;
  209. }
  210. if(strcmp(cmd, "/givebills", true) == 0)
  211. {
  212. if(IsPlayerConnected(playerid))
  213. {
  214. if (PlayerInfo[playerid][pMember] == 37 || PlayerInfo[playerid][pLeader] == 37)
  215. {
  216. new x_nr[256];
  217. x_nr = strtok(cmdtext, idx);
  218. if(!strlen(x_nr))
  219. {
  220. SendClientMessage(playerid, COLOR_WHITE, "/givebills [наименование] [id игрока]");
  221. SendClientMessage(playerid, COLOR_WHITE, "Наименования:билет");
  222. return 1;
  223. }
  224. if(strcmp(x_nr,"билет",true) == 0)
  225. {
  226. tmp = strtok(cmdtext, idx);
  227. if(!strlen(tmp))
  228. {
  229. SendClientMessage(playerid, COLOR_WHITE, "/givebills билет [id игрока]");
  230. return 1;
  231. }
  232. giveplayerid = ReturnUser(tmp);
  233. if(IsPlayerConnected(giveplayerid))
  234. {
  235. if(giveplayerid != INVALID_PLAYER_ID)
  236. {
  237. GetPlayerName(playerid, sendername, sizeof(sendername));
  238. GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  239. format(string, sizeof(string), "Вы выдали %s военный билет",giveplayer);
  240. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  241. format(string, sizeof(string), "Вам выдали военный билет");
  242. SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  243. PlayerInfo[giveplayerid][pVoennik] = 3;
  244. return 1;
  245. }
  246. }
  247. else
  248. {
  249. SendClientMessage(playerid, COLOR_GREY, "Под данным id нет никого в игре");
  250. return 1;
  251. }
  252. }
  253. }
  254. else
  255. {
  256. SendClientMessage(playerid, COLOR_GREY, "ERROR");
  257. return 1;
  258. }
  259. }
  260. return 1;
  261. }
  262. if(strcmp(cmd,"/showbil",true)==0)
  263. {
  264. if(IsPlayerConnected(playerid))
  265. {
  266. new text1[120];
  267. if(PlayerInfo[playerid][pVoennik]) { text1 = "В запасе(пройдена)"; } else { text1 = "Не пройдена(не призван)"; }
  268. SendClientMessage(playerid, COLOR_WHITE, " __________________ Военный билет __________________");
  269. format(string, sizeof(string), "Военная служба: %s.", text1);
  270. SendClientMessage(playerid, COLOR_GREY, string);
  271. SendClientMessage(playerid, COLOR_WHITE, " ______________________________________________");
  272. }
  273. return 1;
  274. }
  275. if(strcmp(cmd, "/leaders", true) == 0)
  276. {
  277. string[0] = 0;
  278. for(new i=0;i<MAX_PLAYERS;i++)// Сканируем Всех...
  279. {
  280. new ttext[300];
  281. if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue;
  282. if(PlayerInfo[i][pLeader] <= 0) continue;// Отсеиваем лидеров...
  283. {
  284. if(PlayerInfo[i][pLeader] == 1) { ttext = "LSPD"; } //directory ранги
  285. else if(PlayerInfo[i][pLeader] == 2) { ttext = "ФБР"; }
  286. else if(PlayerInfo[i][pLeader] == 3) { ttext = "Армия: Авианосец"; }
  287. else if(PlayerInfo[i][pLeader] == 4) { ttext = "МЧС Сан Фиерро"; }
  288. else if(PlayerInfo[i][pLeader] == 5) { ttext = "LCN"; }
  289. else if(PlayerInfo[i][pLeader] == 6) { ttext = "Yakuza"; }
  290. else if(PlayerInfo[i][pLeader] == 7) { ttext = "Мэрия"; }
  291. else if(PlayerInfo[i][pLeader] == 8) { ttext = "Casino Rich"; }
  292. else if(PlayerInfo[i][pLeader] == 9) { ttext = "SF News"; }
  293. else if(PlayerInfo[i][pLeader] == 10) { ttext = "SFPD"; }
  294. else if(PlayerInfo[i][pLeader] == 11) { ttext = "Инструкторы"; }
  295. else if(PlayerInfo[i][pLeader] == 12) { ttext = "The Ballas "; }
  296. else if(PlayerInfo[i][pLeader] == 13) { ttext = "The Vagos"; }
  297. else if(PlayerInfo[i][pLeader] == 14) { ttext = "Русская мафия"; }
  298. else if(PlayerInfo[i][pLeader] == 15) { ttext = "The Grove"; }
  299. else if(PlayerInfo[i][pLeader] == 16) { ttext = "LS News"; }
  300. else if(PlayerInfo[i][pLeader] == 17) { ttext = "The Aztecas"; }
  301. else if(PlayerInfo[i][pLeader] == 18) { ttext = "The Rifa"; }
  302. else if(PlayerInfo[i][pLeader] == 19) { ttext = "Армия: Зона 51"; }
  303. else if(PlayerInfo[i][pLeader] == 20) { ttext = "LV News"; }
  304. else if(PlayerInfo[i][pLeader] == 21) { ttext = "LVPD"; }
  305. else if(PlayerInfo[i][pLeader] == 22) { ttext = "МЧС Лос Сантос"; }
  306. else if(PlayerInfo[i][pLeader] == 23) { ttext = "Sons of Silence MC"; }
  307. else if(PlayerInfo[i][pLeader] == 24) { ttext = "Street Racers"; }
  308. else if(PlayerInfo[i][pLeader] == 25) { ttext = "Инструкторы LS"; }
  309. else if(PlayerInfo[i][pLeader] == 26) { ttext = "Hell's Angels MC"; }
  310. else if(PlayerInfo[i][pLeader] == 27) { ttext = "Outlaws MC"; }
  311. else if(PlayerInfo[i][pLeader] == 28) { ttext = "Warlocks MC"; }
  312. else if(PlayerInfo[i][pLeader] == 29) { ttext = "Highwaymen MC"; }
  313. else if(PlayerInfo[i][pLeader] == 30) { ttext = "Free Souls MC"; }
  314. else if(PlayerInfo[i][pLeader] == 31) { ttext = "Pagans MC"; }
  315. else if(PlayerInfo[i][pLeader] == 32) { ttext = "Mongols MC"; }
  316. else if(PlayerInfo[i][pLeader] == 33) { ttext = "Vagos MC"; }
  317. else if(PlayerInfo[i][pLeader] == 34) { ttext = "Bandidos MC"; }
  318. else if(PlayerInfo[i][pLeader] == 35) { ttext = "Бригада"; }
  319. else if(PlayerInfo[i][pLeader] == 36) { ttext = "Машинисты"; }
  320. else if(PlayerInfo[i][pLeader] == 37) { ttext = "Армия: Эдвардс"; }
  321. }
  322. GetPlayerName(i, sendername, sizeof(sendername));
  323. format(string,sizeof(string),"%s%s: %s [%d]\n",string,ttext,sendername,i);
  324. }
  325. ShowPlayerDialog(playerid,139, DIALOG_STYLE_MSGBOX, "Лидеры Онлайн:", string, "OK", "Отмена");
  326. return 1;
  327. }
  328. if(strcmp(cmd, "/surr", true) == 0)
  329. {
  330. if(IsPlayerConnected(playerid))
  331. {
  332. if(PlayerInfo[playerid][pCrimes] < 1)
  333. {
  334. SendClientMessage(playerid, COLOR_LIGHTRED, "Вы не в розыске!");
  335. return 1;
  336. }
  337. if(PlayerCuffed[playerid] > 0)
  338. {
  339. SendClientMessage(playerid, COLOR_LIGHTRED, "Вы не можете поднять руки!");
  340. return 1;
  341. }
  342. GetPlayerName(playerid, sendername, sizeof(sendername));
  343. SendClientMessage(playerid, COLOR_YELLOW2, "** Вы подготовились к арресту...");
  344. format(string, sizeof(string), "* Диспетчер: %s сдается и ждет арреста. Кординаты на GPS , Конец связи", sendername);
  345. SendRadioMessage(1,COLOR_LIGHTRED, string);
  346. SendRadioMessage(2,COLOR_LIGHTRED, string);
  347. SendRadioMessage(3,COLOR_LIGHTRED, string);
  348. SendRadioMessage(24,COLOR_LIGHTRED, string);
  349. SendRadioMessage(29,COLOR_LIGHTRED, string);
  350. SetPlayerColor(playerid, COLOR_WHITE);
  351. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
  352. }
  353. return 1;
  354. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement