Advertisement
Xaviour212

Script error bangsat

Apr 12th, 2011
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.09 KB | None | 0 0
  1. /*==========================Ulric Vehicle System================================
  2. ===============================by ~Xaviour212~==================================
  3. =======================Please dont remove the credits=========================*/
  4.  
  5. #include <a_samp>
  6. #include <dini>
  7.  
  8. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  9.  
  10. #define Blue 0x0259EAAA
  11. #define Red 0xFF0000AA
  12. #define Green 0x16EB43FF
  13.  
  14. new file[256];
  15. new VCount;
  16. new VehNames[212][] =
  17. {
  18.         "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
  19.         "Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
  20.         "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
  21.         "Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
  22.         "RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
  23.         "Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
  24.         "Pcj - 600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
  25.         "Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","Zr3 50","Walton","Regina","Comet","Bmx",
  26.         "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
  27.         "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
  28.         "RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
  29.         "Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
  30.         "Buccaneer","Shamal","Hydra","Fcr - 900","Nrg - 500","Hpv - 1000","Cement Truck","Tow Truck","Fortune","Cadrona",
  31.         "FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
  32.         "Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
  33.         "Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
  34.         "Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
  35.         "Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
  36.         "BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
  37.         "Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
  38.         "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  39.         "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  40. };
  41.  
  42. public OnFilterScriptInit()
  43. {
  44.     print("\n--------------------------------------");
  45.     print(" Ulric Vehicle System by Xaviour212");
  46.     print("--------------------------------------\n");
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  51. {
  52.     new string[100];
  53.     VCount = CreateVehicle(411,0,0,0,0,0,0,-1);
  54.     DestroyVehicle(VCount);
  55.     for(new v=1; v < VCount; v++)
  56.     {
  57.         if(dini_Int(VFile(v),"UnBuyable") == 0 && dini_Int(VFile(v),"Owned") == 1)
  58.         {
  59.             format(string, sizeof(string), "~b~This %s has belogs to %s. And this car is not available for purchase", VehNames[GetVehicleModel(v)-400],dini_Get(VFile(v),"Owner"));
  60.             GameTextForPlayer(playerid, string, 3000, 4);
  61.         }
  62.         else if(dini_Int(VFile(v),"UnBuyable") == 1)
  63.         {
  64.             format(string, sizeof(string), "~r~This %s in Unbuyable", VehNames[GetVehicleModel(v)-400]);
  65.             GameTextForPlayer(playerid, string, 3000, 4);
  66.         }
  67.         else if(dini_Int(VFile(v),"UnBuyable") == 0 && dini_Int(VFile(v),"Owned") == 0)
  68.         {
  69.             format(string, sizeof(string), "~g~This %s in Buyable. \nThe cost is $200000", VehNames[GetVehicleModel(v)-400]);
  70.             GameTextForPlayer(playerid, string, 3000, 4);
  71.         }
  72.     }
  73.     return 1;
  74. }
  75.  
  76. public OnPlayerCommandText(playerid, cmdtext[])
  77. {
  78.     dcmd(vbuy,4,cmdtext);
  79.     return 0;
  80. }
  81.  
  82. dcmd_vbuy(playerid, params[])
  83. {
  84.     #pragma unused params
  85.     new vehicleid, string[50];
  86.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,Red,"[ERROR]You must in Vehicle to use this command");
  87.     if(dini_Int(VFile(vehicleid),"Owned")== 1) return SendClientMessage(playerid,Red,"[ERROR]This car is already owned");
  88.     if(dini_Int(VFile(vehicleid),"UnBuyable")== 0) return SendClientMessage(playerid,Red,"[ERROR]This car in unbuyable");
  89.     if(dini_Int(PFile(playerid),"HaveCar")== 1) return SendClientMessage(playerid,Red,"[ERROR]You already have a Car");
  90.     if(GetPlayerMoney(playerid < 80000)) return SendClientMessage(playerid,Red,"[ERROR]You dont have a $200000");
  91.     if(!dini_Exist(PFile(playerid)))
  92.     {
  93.         dini_Create(PFile(playerid));
  94.         dini_IntSet(PFile(playerid,"HaveCar",1);
  95.         dini_IntSet(PFile(playerid,"CarID",1);
  96.     }
  97.     else if(dini_Exist(PFile(playerid)))
  98.     {
  99.         dini_IntSet(PFile(playerid,"HaveCar",1);
  100.         dini_IntSet(PFile(playerid,"CarID",1);
  101.     }
  102.     if(!dini_Exist(VFile(vehicleid)))
  103.     {
  104.         dini_Create(VFile(playerid));
  105.         dini_IntSet(VFile(vehicleid),"Owned",1);
  106.         dini_IntSet(VFile(vehicleid),"Owner",Gn(playerid));
  107.     }
  108.     else if(dini_Exist(VFile(vehicleid)))
  109.     {
  110.         dini_IntSet(VFile(vehicleid),"Owned",1);
  111.         dini_IntSet(VFile(vehicleid),"Owner",Gn(playerid));
  112.     }
  113.     format(string, sizeof(string), "You has buy a %s", VehNames[GetVehicleModel(vehicleid)-400]);
  114.     SendClientMessage(playerid, Green, string);
  115.     SendClientMessage(playerid, Blue, "To call your vehicle, type /vcall");
  116.     GivePlayerMoney(playerid, -80000);
  117.     return 1;
  118. }
  119.  
  120. stock Gn(playerid)
  121. {
  122.     new pname[24];
  123.     GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
  124.     return pname;
  125. }
  126.  
  127. stock PFile(playerid)
  128. {
  129.     format(file,64,"Cars/Users/%s.ini",Gn(playerid));
  130.     return file;
  131. }
  132.  
  133. stock VFile(vehicleid)
  134. {
  135.     new Car[64];
  136.     format(Car,64,"Cars/%d.ini",vehicleid);
  137.     return Car;
  138. }
  139.  
  140. stock Pc(playerid) return dini_Int(PFile(playerid),"CarId");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement