Advertisement
DraKiNs

[FS] Commands Creator (car,weapon ..)

Jun 30th, 2011
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 8.65 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define DIALOG_SKIN 230
  4. #define DIALOG_CARS 231
  5. #define DIALOG_WEPS 232
  6.  
  7. new
  8. message[128],
  9. wepname[32],
  10. Float:x,
  11. Float:y,
  12. Float:z
  13. ;
  14.  
  15. public OnFilterScriptInit()
  16. return true;
  17.  
  18. public OnPlayerCommandText(playerid, cmdtext[])
  19. {
  20.     if(!strcmp(cmdtext, "/skin", true)) {
  21.         SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Digite Seu Skin");
  22.         ShowPlayerDialog(playerid,DIALOG_SKIN,DIALOG_STYLE_INPUT,"Skin","Digite Seu Skin abaixo:","Skin","Sair");
  23.         return 1;
  24.     }
  25.     if(!strcmp(cmdtext, "/carro", true)) {
  26.         SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Digite seu Carro");
  27.         ShowPlayerDialog(playerid,DIALOG_CARS,DIALOG_STYLE_INPUT,"Carros","Digite id do seu carro abaixo:","Carro","Sair");
  28.         return 1;
  29.     }
  30.     if(!strcmp(cmdtext, "/arma", true)) {
  31.         SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Digite sua arma");
  32.         ShowPlayerDialog(playerid,DIALOG_WEPS,DIALOG_STYLE_INPUT,"Armas","Digite id da sua arma abaixo:","Arma","Sair");
  33.         return 1;
  34.     }
  35.     return 0;
  36. }
  37.  
  38.  
  39. new
  40. NomeCarros[][] =
  41. {
  42.     "Landstalker",
  43.     "Bravura",
  44.     "Buffalo",
  45.     "Linerunner",
  46.     "Pereniel",
  47.     "Sentinel",
  48.     "Dumper",
  49.     "Firetruck",
  50.     "Trashmaster",
  51.     "Stretch",
  52.     "Manana",
  53.     "Infernus",
  54.     "Voodoo",
  55.     "Pony",
  56.     "Mule",
  57.     "Cheetah",
  58.     "Ambulance",
  59.     "Leviathan",
  60.     "Moonbeam",
  61.     "Esperanto",
  62.     "Taxi",
  63.     "Washington",
  64.     "Bobcat",
  65.     "Mr Whoopee",
  66.     "BF Injection",
  67.     "Hunter",
  68.     "Premier",
  69.     "Enforcer",
  70.     "Securicar",
  71.     "Banshee",
  72.     "Predator",
  73.     "Bus",
  74.     "Rhino",
  75.     "Barracks",
  76.     "Hotknife",
  77.     "Trailer",
  78.     "Previon",
  79.     "Coach",
  80.     "Cabbie",
  81.     "Stallion",
  82.     "Rumpo",
  83.     "RC Bandit",
  84.     "Romero",
  85.     "Packer",
  86.     "Monster Truck",
  87.     "Admiral",
  88.     "Squalo",
  89.     "Seasparrow",
  90.     "Pizzaboy",
  91.     "Tram",
  92.     "Trailer",
  93.     "Turismo",
  94.     "Speeder",
  95.     "Reefer",
  96.     "Tropic",
  97.     "Flatbed",
  98.     "Yankee",
  99.     "Caddy",
  100.     "Solair",
  101.     "Berkley's RC Van",
  102.     "Skimmer",
  103.     "PCJ-600",
  104.     "Faggio",
  105.     "Freeway",
  106.     "RC Baron",
  107.     "RC Raider",
  108.     "Glendale",
  109.     "Oceanic",
  110.     "Sanchez",
  111.     "Sparrow",
  112.     "Patriot",
  113.     "Quad",
  114.     "Coastguard",
  115.     "Dinghy",
  116.     "Hermes",
  117.     "Sabre",
  118.     "Rustler",
  119.     "ZR-350",
  120.     "Walton",
  121.     "Regina",
  122.     "Comet",
  123.     "BMX",
  124.     "Burrito",
  125.     "Camper",
  126.     "Marquis",
  127.     "Baggage",
  128.     "Dozer",
  129.     "Maverick",
  130.     "News Chopper",
  131.     "Rancher",
  132.     "FBI Rancher",
  133.     "Virgo",
  134.     "Greenwood",
  135.     "Jetmax",
  136.     "Hotring",
  137.     "Sandking",
  138.     "Blista Compact",
  139.     "Police Maverick",
  140.     "Boxville",
  141.     "Benson",
  142.     "Mesa",
  143.     "RC Goblin",
  144.     "Hotring Racer",
  145.     "Hotring Racer",
  146.     "Bloodring Banger",
  147.     "Rancher",
  148.     "Super GT",
  149.     "Elegant",
  150.     "Journey",
  151.     "Bike",
  152.     "Mountain Bike",
  153.     "Beagle",
  154.     "Cropdust",
  155.     "Stunt",
  156.     "Tanker",
  157.     "RoadTrain",
  158.     "Nebula",
  159.     "Majestic",
  160.     "Buccaneer",
  161.     "Shamal",
  162.     "Hydra",
  163.     "FCR-900",
  164.     "NRG-500",
  165.     "HPV1000",
  166.     "Cement Truck",
  167.     "Tow Truck",
  168.     "Fortune",
  169.     "Cadrona",
  170.     "FBI Truck",
  171.     "Willard",
  172.     "Forklift",
  173.     "Tractor",
  174.     "Combine",
  175.     "Feltzer",
  176.     "Remington",
  177.     "Slamvan",
  178.     "Blade",
  179.     "Freight",
  180.     "Streak",
  181.     "Vortex",
  182.     "Vincent",
  183.     "Bullet",
  184.     "Clover",
  185.     "Sadler",
  186.     "Firetruck",
  187.     "Hustler",
  188.     "Intruder",
  189.     "Primo",
  190.     "Cargobob",
  191.     "Tampa",
  192.     "Sunrise",
  193.     "Merit",
  194.     "Utility",
  195.     "Nevada",
  196.     "Yosemite",
  197.     "Windsor",
  198.     "Monster Truck",
  199.     "Monster Truck",
  200.     "Uranus",
  201.     "Jester",
  202.     "Sultan",
  203.     "Stratum",
  204.     "Elegy",
  205.     "Raindance",
  206.     "RC Tiger",
  207.     "Flash",
  208.     "Tahoma",
  209.     "Savanna",
  210.     "Bandito",
  211.     "Freight",
  212.     "Trailer",
  213.     "Kart",
  214.     "Mower",
  215.     "Duneride",
  216.     "Sweeper",
  217.     "Broadway",
  218.     "Tornado",
  219.     "AT-400",
  220.     "DFT-30",
  221.     "Huntley",
  222.     "Stafford",
  223.     "BF-400",
  224.     "Newsvan",
  225.     "Tug",
  226.     "Trailer",
  227.     "Emperor",
  228.     "Wayfarer",
  229.     "Euros",
  230.     "Hotdog",
  231.     "Club",
  232.     "Trailer",
  233.     "Trailer",
  234.     "Andromada",
  235.     "Dodo",
  236.     "RC Cam",
  237.     "Launch",
  238.     "Police Car (LS)",
  239.     "Police Car (SF)",
  240.     "Police Car (LV)",
  241.     "Police Ranger",
  242.     "Picador",
  243.     "S.W.A.T. Van",
  244.     "Alpha",
  245.     "Phoenix",
  246.     "Glendale",
  247.     "Sadler",
  248.     "Luggage Trailer",
  249.     "Luggage Trailer",
  250.     "Stair Trailer",
  251.     "Boxville",
  252.     "Farm Plow",
  253.     "Utility Trailer"
  254. };
  255.  
  256. new
  257. badSkins[22] =
  258. {
  259.     3, 4, 5, 6, 8, 42, 65, 74, 86,
  260.     119, 149, 208, 265, 266, 267,
  261.     268, 269, 270, 271, 272, 273, 289
  262. };
  263.  
  264. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  265. {
  266.     if(dialogid == DIALOG_SKIN) {
  267.         if(!response)
  268.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de Skins");
  269.         if(!strval(inputtext))
  270.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de Skins");
  271.         if(strval(inputtext) < 0 || strval(inputtext) > 299)
  272.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] Skin Inválida");
  273.  
  274.         for (new i = 0; i < 22; i++)
  275.             if(strval(inputtext) == badSkins[i])
  276.                 return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] Skin Inválida");
  277.  
  278.         format(message, sizeof(message), "Você colocou a Skin Número %i", strval(inputtext));
  279.         SendClientMessage(playerid, 0xFFFFFFFF, message);
  280.         SetPlayerSkin(playerid,strval(inputtext));
  281.         return 1;
  282.     }
  283.     if(dialogid == DIALOG_WEPS) {
  284.         if(!response)
  285.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de Armas");
  286.         if(!strval(inputtext))
  287.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de Armas");
  288.         if(strval(inputtext) == 19 || strval(inputtext) == 20 || strval(inputtext) == 21 || strval(inputtext) < 16 || strval(inputtext) > 38)
  289.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] Armas Inválida");
  290.  
  291.         GetWeaponName(strval(inputtext),wepname,32);
  292.         format(message, sizeof(message), "Você colocou a arma %s(%i)", wepname,strval(inputtext));
  293.         SendClientMessage(playerid, 0xFFFFFFFF, message);
  294.         GivePlayerWeapon(playerid,strval(inputtext),999999);
  295.         return 1;
  296.     }
  297.     if(dialogid == DIALOG_CARS) {
  298.         if(!response)
  299.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de carros");
  300.         if(!strval(inputtext))
  301.             return SendClientMessage(playerid, 0xFFFFFFFF, "[INFO] Você cancelou a seleção de carros");
  302.         if(!IsValidVehicle(strval(inputtext)))
  303.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] Carro Inválido");
  304.  
  305.         format(message, sizeof(message), "Você colocou o carro %s(%i)", NomeCarros[strval(inputtext)-400],strval(inputtext));
  306.         SendClientMessage(playerid, 0xFFFFFFFF, message);
  307.         GetPlayerPos(playerid, x, y, z);
  308.         PutPlayerInVehicle(playerid,CreateVehicle(strval(inputtext),x, y, z, 82,0,1,60), 0);
  309.         return 1;
  310.     }
  311.     return 0;
  312. }
  313.  
  314.  
  315. stock
  316. IsValidVehicle(modelid)
  317. {
  318.     switch(modelid) {
  319.         case 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509,
  320.             481, 510, 472, 473, 493, 595, 484, 430, 453,
  321.             452, 446, 454, 445, 602, 416, 485, 568, 429, 433, 499, 424, 536, 496,
  322.             504, 422, 609, 498, 401, 575, 518,
  323.             402, 541, 482, 431, 438, 457, 527, 483, 524, 415, 542, 589, 437, 532,
  324.             480, 596, 599, 597, 598, 578, 486,
  325.             507, 562, 585, 427, 419, 587, 490, 528, 533, 544, 407, 565, 455, 530,
  326.             526, 466, 604, 492, 474, 588, 434,
  327.             502, 503, 494, 579, 545, 411, 546, 559, 508, 571, 400, 403, 517, 410,
  328.             551, 500, 418, 572, 423, 414, 516,
  329.             582, 467, 443, 470, 404, 514, 603, 600, 413, 426, 436, 547, 489, 441,
  330.             594, 564, 515, 479, 534, 432, 505,
  331.             442, 440, 475, 543, 605, 495, 567, 428, 405, 535, 458, 580, 439, 561,
  332.             409, 560, 506, 601, 574, 566, 549,
  333.             420, 459, 576, 525, 531, 408, 583, 451, 558, 552, 540, 491, 412, 478,
  334.             421, 529, 456, 554, 477, 548, 425,
  335.             417, 487, 497, 563, 501, 465, 447, 469, 488, 406, 573, 444, 556, 557,
  336.             592, 577, 511, 512, 593, 520, 553,
  337.             464, 476, 519, 460, 513, 539, 471, 435, 450, 591, 606, 607, 610, 584,
  338.             608, 611, 590, 449:
  339.         return 1;
  340.         default:
  341.             return 0;
  342.     }
  343.     return 0;
  344. }
  345.  
  346.  
  347. // www.feksquad.com
  348. // Made by Kyle and DraKoN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement