Advertisement
Guest User

Comandos.pwn

a guest
Jul 28th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.56 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4. #include <a_samp>
  5. #include "../include/gl_common.inc"
  6. #if defined FILTERSCRIPT
  7. #define COLOR_LIGHTBLUE 0x91C8FF
  8. #define COLOR_TEMP 0x33CCFFAA
  9. #define AzulEscuro 0x2641FEAA
  10. #define CIDADES 111
  11. #define MENU 211
  12. forward count2();
  13. forward count1();
  14. forward countgo();
  15. forward stop();
  16. new bool:a;
  17. new Float:X, Float:Y, Float:Z;
  18. #else
  19. #endif
  20. #define TOTAL_ITEMS 207
  21. #define SELECTION_ITEMS 21
  22. #define ITEMS_PER_LINE 7
  23.  
  24. #define HEADER_TEXT "Carros"
  25. #define NEXT_TEXT "Next"
  26. #define PREV_TEXT "Prev"
  27.  
  28. #define DIALOG_BASE_X 75.0
  29. #define DIALOG_BASE_Y 130.0
  30. #define DIALOG_WIDTH 550.0
  31. #define DIALOG_HEIGHT 180.0
  32. #define SPRITE_DIM_X 60.0
  33. #define SPRITE_DIM_Y 70.0
  34.  
  35. new gTotalItems = TOTAL_ITEMS;
  36. new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS];
  37. new PlayerText:gHeaderTextDrawId[MAX_PLAYERS];
  38. new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
  39. new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
  40. new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
  41. new PlayerText:gSelectionItems[MAX_PLAYERS][SELECTION_ITEMS];
  42. new gSelectionItemsTag[MAX_PLAYERS][SELECTION_ITEMS];
  43. new gItemAt[MAX_PLAYERS];
  44.  
  45. new gItemList[TOTAL_ITEMS] = {
  46. 400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,
  47. 431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,450,451,452,453,454,455,456,457,458,459,460,461,
  48. 462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,
  49. 493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,
  50. 524,525,526,527,528,529,530,531,532,533,534,535,536,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,
  51. 555,556,557,558,559,560,561,562,563,564,565,566,567,568,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,
  52. 586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611
  53. };
  54. new str[256];
  55. //------------------------------------------------
  56.  
  57. GetNumberOfPages()
  58. {
  59. if((gTotalItems >= SELECTION_ITEMS) && (gTotalItems % SELECTION_ITEMS) == 0)
  60. {
  61. return (gTotalItems / SELECTION_ITEMS);
  62. }
  63. else return (gTotalItems / SELECTION_ITEMS) + 1;
  64. }
  65.  
  66. //------------------------------------------------
  67.  
  68. PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
  69. {
  70. new PlayerText:txtInit;
  71. txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0");
  72. PlayerTextDrawUseBox(playerid, txtInit, 0);
  73. PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
  74. PlayerTextDrawFont(playerid, txtInit, 1);
  75. PlayerTextDrawSetShadow(playerid, txtInit, 0);
  76. PlayerTextDrawSetOutline(playerid, txtInit, 1);
  77. PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
  78. PlayerTextDrawShow(playerid, txtInit);
  79. return txtInit;
  80. }
  81.  
  82. //------------------------------------------------
  83. // Creates a button textdraw and returns the textdraw ID.
  84.  
  85. PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
  86. {
  87. new PlayerText:txtInit;
  88. txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
  89. PlayerTextDrawUseBox(playerid, txtInit, 1);
  90. PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF);
  91. PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
  92. PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
  93. PlayerTextDrawFont(playerid, txtInit, 1);
  94. PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow
  95. PlayerTextDrawSetOutline(playerid, txtInit, 0);
  96. PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF);
  97. PlayerTextDrawSetSelectable(playerid, txtInit, 1);
  98. PlayerTextDrawAlignment(playerid, txtInit, 2);
  99. PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does <g>
  100. PlayerTextDrawShow(playerid, txtInit);
  101. return txtInit;
  102. }
  103.  
  104. //------------------------------------------------
  105.  
  106. PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
  107. {
  108. new PlayerText:txtInit;
  109. txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
  110. PlayerTextDrawUseBox(playerid, txtInit, 0);
  111. PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
  112. PlayerTextDrawFont(playerid, txtInit, 0);
  113. PlayerTextDrawSetShadow(playerid, txtInit, 0);
  114. PlayerTextDrawSetOutline(playerid, txtInit, 1);
  115. PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
  116. PlayerTextDrawShow(playerid, txtInit);
  117. return txtInit;
  118. }
  119.  
  120. //------------------------------------------------
  121.  
  122. PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
  123. {
  124. new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
  125. " ~n~"); // enough space for everyone
  126. PlayerTextDrawUseBox(playerid, txtBackground, 1);
  127. PlayerTextDrawBoxColor(playerid, txtBackground, 0x00000099);
  128. PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
  129. PlayerTextDrawFont(playerid, txtBackground, 0);
  130. PlayerTextDrawSetShadow(playerid, txtBackground, 0);
  131. PlayerTextDrawSetOutline(playerid, txtBackground, 0);
  132. PlayerTextDrawColor(playerid, txtBackground,0x000000FF);
  133. PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
  134. PlayerTextDrawBackgroundColor(playerid, txtBackground, 0x00000099);
  135. PlayerTextDrawShow(playerid, txtBackground);
  136. return txtBackground;
  137. }
  138.  
  139. //------------------------------------------------
  140. // Creates a model preview sprite
  141.  
  142. PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
  143. {
  144. new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, ""); // it has to be set with SetText later
  145. PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
  146. PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
  147. PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0x000000EE);
  148. PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height
  149. PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
  150. PlayerTextDrawSetPreviewRot(playerid,txtPlayerSprite, -16.0, 0.0, -55.0);
  151. PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
  152. PlayerTextDrawShow(playerid,txtPlayerSprite);
  153. return txtPlayerSprite;
  154. }
  155.  
  156. //------------------------------------------------
  157.  
  158. DestroyPlayerModelPreviews(playerid)
  159. {
  160. new x=0;
  161. while(x != SELECTION_ITEMS) {
  162. if(gSelectionItems[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
  163. PlayerTextDrawDestroy(playerid, gSelectionItems[playerid][x]);
  164. gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
  165. }
  166. x++;
  167. }
  168. }
  169.  
  170. //------------------------------------------------
  171.  
  172. ShowPlayerModelPreviews(playerid)
  173. {
  174. new x=0;
  175. new Float:BaseX = DIALOG_BASE_X;
  176. new Float:BaseY = DIALOG_BASE_Y - (SPRITE_DIM_Y * 0.33); // down a bit
  177. new linetracker = 0;
  178.  
  179. new itemat = GetPVarInt(playerid, "vspawner_page") * SELECTION_ITEMS;
  180.  
  181. // Destroy any previous ones created
  182. DestroyPlayerModelPreviews(playerid);
  183.  
  184. while(x != SELECTION_ITEMS && itemat < gTotalItems) {
  185. if(linetracker == 0) {
  186. BaseX = DIALOG_BASE_X + 25.0; // in a bit from the box
  187. BaseY += SPRITE_DIM_Y + 1.0; // move on the Y for the next line
  188. }
  189. gSelectionItems[playerid][x] = CreateModelPreviewTextDraw(playerid, gItemList[itemat], BaseX, BaseY, SPRITE_DIM_X, SPRITE_DIM_Y);
  190. gSelectionItemsTag[playerid][x] = gItemList[itemat];
  191. BaseX += SPRITE_DIM_X + 1.0; // move on the X for the next sprite
  192. linetracker++;
  193. if(linetracker == ITEMS_PER_LINE) linetracker = 0;
  194. itemat++;
  195. x++;
  196. }
  197. }
  198.  
  199. //------------------------------------------------
  200.  
  201. UpdatePageTextDraw(playerid)
  202. {
  203. new PageText[64+1];
  204. format(PageText, 64, "%d/%d", GetPVarInt(playerid,"vspawner_page") + 1, GetNumberOfPages());
  205. PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText);
  206. }
  207.  
  208. //------------------------------------------------
  209.  
  210. CreateSelectionMenu(playerid)
  211. {
  212. gBackgroundTextDrawId[playerid] = CreatePlayerBackgroundTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y + 20.0, DIALOG_WIDTH, DIALOG_HEIGHT);
  213. gHeaderTextDrawId[playerid] = CreatePlayerHeaderTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y, HEADER_TEXT);
  214. gCurrentPageTextDrawId[playerid] = CreateCurrentPageTextDraw(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y + 15.0);
  215. gNextButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, NEXT_TEXT);
  216. gPrevButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 90.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, PREV_TEXT);
  217.  
  218. ShowPlayerModelPreviews(playerid);
  219. UpdatePageTextDraw(playerid);
  220. }
  221.  
  222. //------------------------------------------------
  223.  
  224. DestroySelectionMenu(playerid)
  225. {
  226. DestroyPlayerModelPreviews(playerid);
  227.  
  228. PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]);
  229. PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]);
  230. PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]);
  231. PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]);
  232. PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]);
  233.  
  234. gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  235. gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  236. gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  237. gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  238. gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  239. }
  240.  
  241. //------------------------------------------------
  242.  
  243. SpawnVehicle_InfrontOfPlayer(playerid, vehiclemodel, color1, color2)
  244. {
  245. new Float:x,Float:y,Float:z;
  246. new Float:facing;
  247. new Float:distance;
  248.  
  249. GetPlayerPos(playerid, x, y, z);
  250. GetPlayerFacingAngle(playerid, facing);
  251.  
  252. new Float:size_x,Float:size_y,Float:size_z;
  253. GetVehicleModelInfo(vehiclemodel, VEHICLE_MODEL_INFO_SIZE, size_x, size_y, size_z);
  254.  
  255. distance = size_x + 0.5;
  256.  
  257. x += (distance * floatsin(-facing, degrees));
  258. y += (distance * floatcos(-facing, degrees));
  259.  
  260. facing += 90.0;
  261. if(facing > 360.0) facing -= 360.0;
  262.  
  263. return CreateVehicle(vehiclemodel, x, y, z + (size_z * 0.25), facing, color1, color2, -1);
  264. }
  265.  
  266. //------------------------------------------------
  267.  
  268. HandlePlayerItemSelection(playerid, selecteditem)
  269. {
  270. // In this case we're spawning a vehicle for them
  271. SpawnVehicle_InfrontOfPlayer(playerid, gSelectionItemsTag[playerid][selecteditem], -1, -1);
  272. }
  273.  
  274. //------------------------------------------------
  275. public OnPlayerConnect(playerid)
  276. {
  277. // Init all of the textdraw related globals
  278. gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  279. gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  280. gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  281. gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  282. gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
  283.  
  284. for(new x=0; x < SELECTION_ITEMS; x++) {
  285. gSelectionItems[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
  286. }
  287.  
  288. gItemAt[playerid] = 0;
  289.  
  290. return 1; // Allow other scripts to keep processing OnPlayerConnect
  291. }
  292.  
  293. //-------------------------------------------
  294. // Even though only Player* textdraws are used in this script,
  295. // OnPlayerClickTextDraw is still required to handle ESC
  296.  
  297. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  298. {
  299. if(GetPVarInt(playerid, "vspawner_active") == 0) return 0;
  300.  
  301. // Handle: They cancelled (with ESC)
  302. if(clickedid == Text:INVALID_TEXT_DRAW) {
  303. DestroySelectionMenu(playerid);
  304. SetPVarInt(playerid, "vspawner_active", 0);
  305. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  306. return 1;
  307. }
  308.  
  309. return 0;
  310. }
  311.  
  312. //------------------------------------------------
  313.  
  314. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  315. {
  316. if(GetPVarInt(playerid, "vspawner_active") == 0) return 0;
  317.  
  318. new curpage = GetPVarInt(playerid, "vspawner_page");
  319.  
  320. // Handle: next button
  321. if(playertextid == gNextButtonTextDrawId[playerid]) {
  322. if(curpage < (GetNumberOfPages() - 1)) {
  323. SetPVarInt(playerid, "vspawner_page", curpage + 1);
  324. ShowPlayerModelPreviews(playerid);
  325. UpdatePageTextDraw(playerid);
  326. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  327. } else {
  328. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  329. }
  330. return 1;
  331. }
  332.  
  333. // Handle: previous button
  334. if(playertextid == gPrevButtonTextDrawId[playerid]) {
  335. if(curpage > 0) {
  336. SetPVarInt(playerid, "vspawner_page", curpage - 1);
  337. ShowPlayerModelPreviews(playerid);
  338. UpdatePageTextDraw(playerid);
  339. PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
  340. } else {
  341. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  342. }
  343. return 1;
  344. }
  345.  
  346. // Search in the array of textdraws used for the items
  347. new x=0;
  348. while(x != SELECTION_ITEMS) {
  349. if(playertextid == gSelectionItems[playerid][x]) {
  350. HandlePlayerItemSelection(playerid, x);
  351. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  352. DestroySelectionMenu(playerid);
  353. CancelSelectTextDraw(playerid);
  354. SetPVarInt(playerid, "vspawner_active", 0);
  355. return 1;
  356. }
  357. x++;
  358. }
  359.  
  360. return 0;
  361. }
  362.  
  363. //------------------------------------------------
  364.  
  365.  
  366.  
  367. public OnPlayerCommandText(playerid, cmdtext[])
  368. {
  369. //////////////////
  370. // ir ///
  371. //////////////////
  372. new cmd[256+1];
  373. new idx;
  374.  
  375. //if(!IsPlayerAdmin(playerid)) return 0;
  376.  
  377. cmd = strtok(cmdtext, idx);
  378.  
  379. if(strcmp("/veiculos", cmd, true) == 0)
  380. {
  381. // If there was a previously created selection menu, destroy it
  382. DestroySelectionMenu(playerid);
  383.  
  384. SetPVarInt(playerid, "vspawner_active", 1);
  385. //SetPVarInt(playerid, "vspawner_page", 0); // will reset the page back to the first
  386.  
  387. CreateSelectionMenu(playerid);
  388. SelectTextDraw(playerid, 0xACCBF1FF);
  389. return 1;
  390. }
  391. //////////////////
  392. // limparchat ///
  393. //////////////////
  394. if(strcmp(cmdtext, "/descapotar", true) == 0)
  395. {
  396. if(IsPlayerInAnyVehicle(playerid))
  397. {
  398. new currentveh;
  399. new Float:angle;
  400. currentveh = GetPlayerVehicleID(playerid);
  401. GetVehicleZAngle(currentveh, angle);
  402. SetVehicleZAngle(currentveh, angle);
  403. SendClientMessage(playerid, 0xFFFFFFFF, "Descapotado!.");
  404. return 1;
  405. }
  406. else
  407. {
  408. SendClientMessage(playerid, 0xFFFFFFFF, "Só funciona dentro de um veículo cara!");
  409. return 1;
  410. }
  411. }
  412. //////////////////
  413. // limparchat ///
  414. //////////////////
  415. if(strcmp(cmdtext, "/limparchat", true) == 0) {
  416. if(!IsPlayerAdmin(playerid))
  417. {
  418. SendClientMessage(playerid,COLOR_TEMP,"{FF0000}| FAIL | {FFFFFF}Desculpe, apenas os administradores podem usar esse comando!");
  419. return 1;
  420. }
  421. for(new i = 0; i < 200; i++)// 200 Linhas que será apagadas...
  422. SendClientMessageToAll(COLOR_TEMP, "");
  423. SendClientMessageToAll(AzulEscuro, "{1874CD}| INFO | {FFFFFF}O administrador limpou o chat!");
  424. return 1;
  425. }
  426. //////////////////
  427. // TELEPORTES ///
  428. //////////////////
  429. if(!strcmp("/teleportes", cmdtext, true)) // Comando
  430. {
  431. ShowPlayerDialog(playerid, CIDADES, DIALOG_STYLE_LIST, "{33CCFF}TELEPORTES{ffffFF}", "Los Santos\nSan Fierro\nLas Venturas\nBlueberry\nChilliad\nAeroporto SF\nAeroporto LS\nAeroporto LV\nAeroporto AB\nDesafio\nSalto Radical\nPista OffRoad\nInicio", "Teleportar", "Cancelar");
  432. return 1;
  433. }
  434. //////////////////
  435. // MENU ///
  436. //////////////////
  437. if(!strcmp("/menu", cmdtext, true)) // Comando
  438. {
  439. ShowPlayerDialog(playerid, MENU, DIALOG_STYLE_LIST, "{33CCFF}MENU{ffffFF}", "Morrer\nVida\nColete\nJetPack\nGrana", "Pegar", "Cancelar");
  440. //morrer
  441. //vida
  442. //colete
  443. //JetPk
  444. return 1;
  445. }
  446. //////////////////
  447. //// consertar/////
  448. //////////////////
  449. if (!strcmp("/consertar", cmdtext))
  450. {
  451. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
  452. RepairVehicle(GetPlayerVehicleID(playerid));
  453. SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
  454. return 1;
  455. }
  456. //////////////////
  457. //// concertar/////
  458. //////////////////
  459. if (!strcmp("/concertar", cmdtext))
  460. {
  461. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
  462. RepairVehicle(GetPlayerVehicleID(playerid));
  463. SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
  464. return 1;
  465. }
  466. //////////////////
  467. //// COMANDOS/////
  468. //////////////////
  469. if(strcmp(cmdtext,"/comandos",true)==0) {
  470. new comandos[400];
  471. strins(comandos,"\n",strlen(comandos));
  472. strins(comandos,"/veiculos \n",strlen(comandos));
  473. strins(comandos,"/mudarskin \n",strlen(comandos));
  474. strins(comandos,"/consertar \n",strlen(comandos));
  475. strins(comandos,"/teleportes \n",strlen(comandos));
  476. strins(comandos,"/tunar \n",strlen(comandos));
  477. strins(comandos,"/menuarmas \n",strlen(comandos));
  478. strins(comandos,"/ir \n",strlen(comandos));
  479. strins(comandos,"/count \n",strlen(comandos));
  480. strins(comandos,"/descapotar \n",strlen(comandos));
  481. strins(comandos,"/salvar e /voltar \n",strlen(comandos));
  482. strins(comandos,"\n",strlen(comandos));
  483. ShowPlayerDialog(playerid, 1235, DIALOG_STYLE_MSGBOX, "COMANDOS:",comandos, "Sair");
  484. // Iremos Ver La No Final =)
  485. return 1;
  486. }
  487. //////////////////
  488. //// CONTAGEM/////
  489. //////////////////
  490. if(strcmp(cmdtext,"/count",true) == 0) {
  491. new pName[30];
  492. new string[256];
  493. if (a == false)
  494. {
  495. a = true;
  496. GetPlayerName(playerid, pName, 30);
  497. format(string, 280, "[INFO]:%s Iniciou uma contagem!!!!.", pName);
  498. SendClientMessageToAll(COLOR_LIGHTBLUE, string);
  499. for(new i; i < MAX_PLAYERS; i++) {
  500. GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,4);
  501. GetPlayerPos(i,X,Y,Z);
  502. PlayerPlaySound(i,1056,X,Y,Z);
  503. }
  504. SetTimer("count2",1000,0);
  505. SetTimer("count1",2000,0);
  506. SetTimer("countgo",3000,0);
  507. SetTimer("stop",6000,0);
  508.  
  509. }
  510. else SendClientMessage(playerid, 0xFF9900AA, "[INFO]:Prepare-se!!!.");
  511. return 1;
  512. }
  513. return 1;
  514. }
  515. ////////////////////////////////////////////////////////////////////////////////
  516. public count2()
  517. {
  518. for(new i; i < MAX_PLAYERS; i++) {
  519. GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,4);
  520. GetPlayerPos(i,X,Y,Z);
  521. PlayerPlaySound(i,1056,X,Y,Z);
  522. }
  523. }
  524. ////////////////////////////////////////////////////////////////////////////////
  525. public count1()
  526. {
  527. for(new i; i < MAX_PLAYERS; i++) {
  528. GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,4);
  529. GetPlayerPos(i,X,Y,Z);
  530. PlayerPlaySound(i,1056,X,Y,Z);
  531. }
  532. }
  533. ////////////////////////////////////////////////////////////////////////////////
  534. public countgo()
  535. {
  536. for(new i; i < MAX_PLAYERS; i++) {
  537. GetPlayerPos(i,X,Y,Z);
  538. GameTextForPlayer(i,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~GO GO GO~g~-~y~]~g~-",1000,4);
  539. PlayerPlaySound(i,1057,X,Y,Z);
  540. }
  541. }
  542. public stop()
  543. {
  544. a = false;
  545. }
  546.  
  547. ///////////////////////
  548. // DIALOGS //
  549. ///////////////////////
  550. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) // No OnDialogResponse !!!
  551. {
  552. ///////////////////////
  553. // CIDADES //
  554. ///////////////////////
  555. /*
  556. 1=ls
  557. 2=sf
  558. 3=lv
  559. 4=Blueberry
  560. 5=Chilliad
  561. 6=aerosf
  562. 7=aerols
  563. 8=aerolv
  564. 9=aeroab
  565. 10=desafio
  566. 11=inicio
  567. */
  568. if(dialogid == CIDADES) // AO DIGITAR /meudialoglist IRA ABRIR :
  569. {
  570. if(response)
  571. {
  572. if(listitem == 0) // LISTA 1 OU SEJA - JFS -
  573. {
  574. // Coloque Sua Função Aqui !!
  575. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  576. SetPlayerPos(playerid, 1463.4583,-885.8461,55.9425); // CODERNADA ONDE ELE VAI
  577. }
  578. else if(listitem == 1) // LISTA 2 OU SEJA - JONATHAN -
  579. {
  580. // Coloque Sua Função Aqui !!
  581. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  582. SetPlayerPos(playerid, -2023.2820,178.6381,28.8359); // CODERNADA ONDE ELE VAI
  583. }
  584. else if(listitem == 2) // LISTA 2 OU SEJA - JONATHAN -
  585. {
  586. // Coloque Sua Função Aqui !!
  587. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  588. SetPlayerPos(playerid, 2119.3572,1024.7743,10.8203); // CODERNADA ONDE ELE VAI
  589. }
  590. else if(listitem == 3) // LISTA 2 OU SEJA - JONATHAN -
  591. {
  592. // Coloque Sua Função Aqui !!
  593. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  594. SetPlayerPos(playerid, 377.3415,-135.6752,3.3761); // CODERNADA ONDE ELE VAI
  595. }
  596. else if(listitem == 4) // LISTA 2 OU SEJA - JONATHAN -
  597. {
  598. // Coloque Sua Função Aqui !!
  599. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  600. SetPlayerPos(playerid, -2390.6624,-2204.3618,33.2891); // CODERNADA ONDE ELE VAI
  601. }
  602. else if(listitem == 5) // LISTA 2 OU SEJA - JONATHAN -
  603. {
  604. // Coloque Sua Função Aqui !!
  605. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  606. SetPlayerPos(playerid, -1206.6509,44.6323,14.1428); // CODERNADA ONDE ELE VAI
  607. }
  608. else if(listitem == 6) // LISTA 2 OU SEJA - JONATHAN -
  609. {
  610. // Coloque Sua Função Aqui !!
  611. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  612. SetPlayerPos(playerid, 1974.8517,-2267.0110,13.5469); // CODERNADA ONDE ELE VAI
  613. }
  614. else if(listitem == 7) // LISTA 2 OU SEJA - JONATHAN -
  615. {
  616. // Coloque Sua Função Aqui !!
  617. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  618. SetPlayerPos(playerid, 1726.9647,1611.5157,10.0397); // CODERNADA ONDE ELE VAI
  619. }
  620. else if(listitem == 8) // LISTA 2 OU SEJA - JONATHAN -
  621. {
  622. // Coloque Sua Função Aqui !!
  623. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  624. SetPlayerPos(playerid, 1726.9647,1611.5157,10.0397); // CODERNADA ONDE ELE VAI
  625. }
  626. else if(listitem == 9) // LISTA 2 OU SEJA - JONATHAN -
  627. {
  628. // Coloque Sua Função Aqui !!
  629. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  630. SetPlayerPos(playerid, -1998.2328,-247.4197,35.8067); //
  631. //CreateObject(2896,-2382.8999000,-1657.1999500,2279.6999500,0.0000000,0.0000000,0.0000000); //object(casket_law) (1)
  632. }
  633. else if(listitem == 10) // LISTA 2 OU SEJA - JONATHAN -
  634. {
  635. // Coloque Sua Função Aqui !!
  636. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  637. SetPlayerPos(playerid, -2382.8999000,-1657.1999500,2279.6999500); //
  638. }
  639. else if(listitem == 11) // LISTA 2 OU SEJA - JONATHAN -
  640. {
  641. // Coloque Sua Função Aqui !!
  642. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  643. SetPlayerPos(playerid, -2818.0000000,2914.1001000,25.4000000); //
  644. }
  645. else if(listitem == 12) // LISTA 2 OU SEJA - JONATHAN -
  646. {
  647. // Coloque Sua Função Aqui !!
  648. // VAMO POR UM SIMPLES AQUI EM BAIXO, :
  649. SetPlayerPos(playerid, 102.0953,1106.4053,13.6094); // CODERNADA ONDE ELE VAI
  650. return 1;
  651.  
  652. }
  653. }
  654. }
  655. ///////////////////////
  656. //// MENU ///////
  657. //////////////////////
  658. //morrer
  659. //vida
  660. //colete
  661. //JetPk
  662. //grana
  663. if(dialogid == MENU)
  664. {
  665. if(response)
  666. {
  667. if(listitem == 0)
  668. {
  669. SetPlayerHealth(playerid,0);
  670. }
  671. else if(listitem == 1)
  672. {
  673. SetPlayerHealth(playerid, 100.0);
  674. }
  675. else if(listitem == 2)
  676. {
  677. SetPlayerArmour(playerid, 100.0);
  678. }
  679. else if(listitem == 3) // LISTA 2 OU SEJA - JONATHAN -
  680. {
  681. SetPlayerSpecialAction(playerid, 2); // JETPACK
  682. }
  683. else if(listitem == 4) // LISTA 2 OU SEJA - JONATHAN -
  684. {
  685. GivePlayerMoney(playerid, 100000);
  686. return 1;
  687. }
  688. }
  689. }
  690. ///////////////////////
  691. //// FIM ///////
  692. //////////////////////
  693. return 0;
  694. }
  695. // Fechando o OnDialogResponse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement