Advertisement
Guest User

Untitled

a guest
Nov 28th, 2010
1,605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.04 KB | None | 0 0
  1. /* By ben4uka \ Cola \ ColaMan \ FreeRide \ freerides (this is my nicknames) */
  2.  
  3. //Includes
  4.  
  5. #include <a_samp>
  6. #include <dini>
  7.  
  8. //Defines
  9.  
  10. #define lb 0x33CCFFAA
  11. #define white 0xFFFFFFAA
  12. #define red 0xFF0000AA
  13. #define Orange 0xFF9900AA
  14. #define green 0x16EB43FF
  15.  
  16. // News
  17. new file[256];
  18. new colors[200] = {
  19. 0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
  20. 0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
  21. 0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
  22. 0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
  23. 0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
  24. 0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
  25. 0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
  26. 0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
  27. 0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
  28. 0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
  29. 0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
  30. 0xD8C762FF,0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,
  31. 0xF4A460FF,0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,
  32. 0x10DC29FF,0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,
  33. 0x65ADEBFF,0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,
  34. 0x3D0A4FFF,0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,
  35. 0x057F94FF,0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,
  36. 0x18F71FFF,0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,
  37. 0x12D6D4FF,0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,
  38. 0x2FD9DEFF,0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,
  39. 0x3214AAFF,0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,
  40. 0xDCDE3DFF,0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,
  41. 0xD8C762FF,0xD8C762FF
  42. };
  43.  
  44. new Text3D:TextUpCar[MAX_VEHICLES];
  45. new VCount;
  46. new TextCar[256];
  47. new VehNames[212][] =
  48. {
  49. "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
  50. "Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
  51. "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
  52. "Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
  53. "RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
  54. "Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
  55. "Pcj - 600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
  56. "Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","Zr3 50","Walton","Regina","Comet","Bmx",
  57. "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
  58. "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
  59. "RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
  60. "Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
  61. "Buccaneer","Shamal","Hydra","Fcr - 900","Nrg - 500","Hpv - 1000","Cement Truck","Tow Truck","Fortune","Cadrona",
  62. "FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
  63. "Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
  64. "Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
  65. "Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
  66. "Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
  67. "BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
  68. "Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
  69. "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  70. "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  71. };
  72. #if defined FILTERSCRIPT
  73.  
  74. public OnFilterScriptInit()
  75. {
  76. print("\n--------------------------------------");
  77. print(" Blank Filterscript by your name here");
  78. print("--------------------------------------\n");
  79. return 1;
  80. }
  81.  
  82. public OnFilterScriptExit()
  83. {
  84. return 1;
  85. }
  86.  
  87. #else
  88.  
  89. main()
  90. {
  91. print("\n----------------------------------");
  92. print(" Blank Gamemode by your name here");
  93. print("----------------------------------\n");
  94. }
  95.  
  96. #endif
  97.  
  98. public OnGameModeInit()
  99. {
  100. // Don't use these lines if it's a filterscript
  101. SetGameModeText("Blank Script");
  102. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  103. VCount = CreateVehicle(411,0,0,0,0,0,0,-1);
  104. DestroyVehicle(VCount);
  105. for(new v=1; v < VCount; v++)
  106. {
  107. if(dini_Int(CarFile(v),"Public") == 0 && dini_Int(CarFile(v),"Owned") == 1)
  108. {
  109. format(TextCar,sizeof(TextCar),"This Car %s\n Belong To: %s",VehNames[GetVehicleModel(v)-400],dini_Get(CarFile(v),"Owner"));
  110. TextUpCar[v] = Create3DTextLabel(TextCar, colors[random(sizeof(colors))],0,0,0,20.0,0);
  111. Attach3DTextLabelToVehicle(TextUpCar[v],v,0.0,0.0,0.0);
  112. }
  113. else if(dini_Int(CarFile(v),"Public") == 1)
  114. {
  115. format(TextCar,sizeof(TextCar),"%s Is UnBuyAble!", VehNames[GetVehicleModel(v)-400]);
  116. TextUpCar[v] = Create3DTextLabel(TextCar, colors[random(sizeof(colors))],0,0,0,20.0,0);
  117. Attach3DTextLabelToVehicle(TextUpCar[v],v,0.0,0.0,0.0);
  118. }
  119. else if(dini_Int(CarFile(v),"Public") == 0 && dini_Int(CarFile(v),"Owned") == 0)
  120. {
  121. format(TextCar,sizeof(TextCar),"This car %s\nIs BuyAble\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
  122. TextUpCar[v] = Create3DTextLabel(TextCar,colors[random(sizeof(colors))],0,0,0,25.0,0);
  123. Attach3DTextLabelToVehicle(TextUpCar[v],v,0.0,0.0,0.0);
  124. }
  125. }
  126. return 1;
  127. }
  128.  
  129. public OnGameModeExit()
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnPlayerRequestClass(playerid, classid)
  135. {
  136. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  137. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  138. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  139. return 1;
  140. }
  141.  
  142. public OnPlayerConnect(playerid)
  143. {
  144. return 1;
  145. }
  146.  
  147. public OnPlayerDisconnect(playerid, reason)
  148. {
  149. return 1;
  150. }
  151.  
  152. public OnPlayerSpawn(playerid)
  153. {
  154. return 1;
  155. }
  156.  
  157. public OnPlayerDeath(playerid, killerid, reason)
  158. {
  159. return 1;
  160. }
  161.  
  162. public OnVehicleSpawn(vehicleid)
  163. {
  164. Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
  165. return 1;
  166. }
  167.  
  168. public OnVehicleDeath(vehicleid, killerid)
  169. {
  170. return 1;
  171. }
  172.  
  173. public OnPlayerText(playerid, text[])
  174. {
  175. return 1;
  176. }
  177.  
  178. public OnPlayerCommandText(playerid, cmdtext[])
  179. {
  180. new cmd[256], vehicleid = GetPlayerVehicleID(playerid), v = GetPlayerVehicleID(playerid), idx, str[256];
  181. cmd = strtok(cmdtext, idx);
  182. if(!strcmp(cmd,"/BuyCar",true))
  183. {
  184. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a vehicle");
  185. if(dini_Int(CarFile(vehicleid),"Owned")==1) return SendClientMessage(playerid,red," this car is alredy owned.");
  186. if(dini_Int(CarFile(vehicleid),"Public")==1) return SendClientMessage(playerid,red," this car is unbuyable ");
  187. if(dini_Int(PFile(playerid),"GotCar")==1) return SendClientMessage(playerid,red,"you alredy have a car ");
  188. if(GetPlayerMoney(playerid) < 200000) return SendClientMessage(playerid,red,"You dont have the money (200000$)");
  189. if(!dini_Exists(PFile(playerid)))
  190. {
  191. dini_Create(PFile(playerid));
  192. dini_IntSet(PFile(playerid),"GotCar",1);
  193. dini_IntSet(PFile(playerid),"CarId",vehicleid);
  194. }
  195. else if(dini_Exists(PFile(playerid)))
  196. {
  197. dini_IntSet(PFile(playerid),"GotCar",1);
  198. dini_IntSet(PFile(playerid),"CarId",vehicleid);
  199. }
  200. if(!dini_Exists(CarFile(vehicleid)))
  201. {
  202. dini_Create(CarFile(vehicleid));
  203. dini_Set(CarFile(vehicleid),"Owner",Gn(playerid));
  204. dini_IntSet(CarFile(vehicleid),"Owned",1);
  205. }
  206. else if(dini_Exists(CarFile(vehicleid)))
  207. {
  208. dini_Set(CarFile(vehicleid),"Owner",Gn(playerid));
  209. dini_IntSet(CarFile(vehicleid),"Owned",1);
  210. }
  211. format(str,256,"You bought a new %s",VehNames[GetVehicleModel(vehicleid)-400]);
  212. SendClientMessage(playerid,green,str);
  213. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  214. SendClientMessage(playerid,white,"To call your car use /CallCar");
  215. format(TextCar,sizeof(TextCar),"This car %s\nBelong To %s",VehNames[GetVehicleModel(v)-400],dini_Get(CarFile(v),"Owner"));
  216. Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
  217. Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
  218. GivePlayerMoney(playerid,-200000);
  219. return 1;
  220. }
  221. if(!strcmp(cmd,"/SellCar",true))
  222. {
  223. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a vehicle");
  224. if(dini_Int(PFile(playerid),"GotCar")==0) return SendClientMessage(playerid,red,"you dont have a car");
  225. if(vehicleid!=Pc(playerid)) return SendClientMessage(playerid,red," this isn't your car");
  226. dini_IntSet(CarFile(vehicleid),"Owner",0);
  227. dini_IntSet(CarFile(vehicleid),"Owned",0);
  228. dini_IntSet(CarFile(vehicleid),"Public",0);
  229. dini_IntSet(PFile(playerid),"GotCar",0);
  230. dini_Set(PFile(playerid),"CarId","None");
  231. dini_Remove(CarFile(vehicleid));
  232. SendClientMessage(playerid,green," you sold your car, you get a half from the money");
  233. format(TextCar,sizeof(TextCar),"this car %s\nIs buyable\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
  234. Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
  235. Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
  236. GivePlayerMoney(playerid,100000);
  237. return 1;
  238. }
  239. if(!strcmp(cmd,"/CallCar",true))
  240. {
  241. if(dini_Int(PFile(playerid),"GotCar") == 0) return SendClientMessage(playerid,red,"you dont have a car");
  242. if(IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,red,"you alredy in a vehicle");
  243. new Float:p[4];
  244. GetPlayerPos(playerid,p[0],p[1],p[2]);
  245. GetPlayerFacingAngle(playerid,p[3]);
  246. SetVehiclePos(Pc(playerid),p[0],p[1],p[2]);
  247. SetVehicleZAngle(Pc(playerid),p[3]);
  248. PutPlayerInVehicle(playerid,Pc(playerid),0);
  249. SendClientMessage(playerid,0xFF9900AA," Thank You for using Car Teleport Service!");
  250. return 1;
  251. }
  252. if(!strcmp(cmd,"/UnBuyAble",true))
  253. {
  254. if(!IsPlayerAdmin(playerid)) return 0;
  255. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"you are not in a vehicle");
  256. if(dini_Int(CarFile(vehicleid),"Public")==1) return SendClientMessage(playerid,red,"this car is alredy public");
  257. if(!dini_Exists(CarFile(vehicleid)))
  258. {
  259. dini_Create(CarFile(vehicleid));
  260. dini_IntSet(CarFile(vehicleid),"Public",1);
  261. dini_IntSet(CarFile(vehicleid),"Owned",0);
  262. dini_IntSet(CarFile(vehicleid),"Owner",0);
  263. }
  264. else
  265. {
  266. dini_IntSet(CarFile(vehicleid),"Public",1);
  267. dini_IntSet(CarFile(vehicleid),"Owned",0);
  268. dini_IntSet(CarFile(vehicleid),"Owner",0);
  269. }
  270. SendClientMessage(playerid,green,"this car is now public.");
  271. format(TextCar,sizeof(TextCar),"%s Is UnBuyAble!", VehNames[GetVehicleModel(v)-400]);
  272. Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
  273. Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
  274. return 1;
  275. }
  276.  
  277. if(!strcmp(cmd,"/BuyAble",true))
  278. {
  279. if(!IsPlayerAdmin(playerid)) return 0;
  280. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"you are not in a vehicle");
  281. if(dini_Int(CarFile(vehicleid),"Public")==0) return SendClientMessage(playerid,red,"this isnt a public car");
  282. dini_IntSet(CarFile(vehicleid),"Public",0);
  283. dini_IntSet(CarFile(vehicleid),"Owned",0);
  284. dini_IntSet(CarFile(vehicleid),"Owner",0);
  285. dini_Remove(CarFile(vehicleid));
  286. SendClientMessage(playerid,green,"this car is now buyable");
  287. format(TextCar,sizeof(TextCar),"this car %s\nIs buyable\nIn 200000$",VehNames[GetVehicleModel(v)-400]);
  288. Update3DTextLabelText(TextUpCar[vehicleid],colors[random(sizeof(colors))],TextCar);
  289. Attach3DTextLabelToVehicle(TextUpCar[vehicleid],vehicleid,0.0,0.0,0.0);
  290. return 1;
  291. }
  292.  
  293. return 0;
  294. }
  295.  
  296. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  297. {
  298.  
  299. return 1;
  300. }
  301.  
  302. public OnPlayerExitVehicle(playerid, vehicleid)
  303. {
  304. return 1;
  305. }
  306.  
  307. public OnPlayerStateChange(playerid, newstate, oldstate)
  308. {
  309. return 1;
  310. }
  311.  
  312. public OnPlayerEnterCheckpoint(playerid)
  313. {
  314. return 1;
  315. }
  316.  
  317. public OnPlayerLeaveCheckpoint(playerid)
  318. {
  319. return 1;
  320. }
  321.  
  322. public OnPlayerEnterRaceCheckpoint(playerid)
  323. {
  324. return 1;
  325. }
  326.  
  327. public OnPlayerLeaveRaceCheckpoint(playerid)
  328. {
  329. return 1;
  330. }
  331.  
  332. public OnRconCommand(cmd[])
  333. {
  334. return 1;
  335. }
  336.  
  337. public OnPlayerRequestSpawn(playerid)
  338. {
  339. return 1;
  340. }
  341.  
  342. public OnObjectMoved(objectid)
  343. {
  344. return 1;
  345. }
  346.  
  347. public OnPlayerObjectMoved(playerid, objectid)
  348. {
  349. return 1;
  350. }
  351.  
  352. public OnPlayerPickUpPickup(playerid, pickupid)
  353. {
  354. return 1;
  355. }
  356.  
  357. public OnVehicleMod(playerid, vehicleid, componentid)
  358. {
  359. return 1;
  360. }
  361.  
  362. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  363. {
  364. return 1;
  365. }
  366.  
  367. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  368. {
  369. return 1;
  370. }
  371.  
  372. public OnPlayerSelectedMenuRow(playerid, row)
  373. {
  374. return 1;
  375. }
  376.  
  377. public OnPlayerExitedMenu(playerid)
  378. {
  379. return 1;
  380. }
  381.  
  382. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  383. {
  384. return 1;
  385. }
  386.  
  387. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  388. {
  389. return 1;
  390. }
  391.  
  392. public OnRconLoginAttempt(ip[], password[], success)
  393. {
  394. return 1;
  395. }
  396.  
  397. public OnPlayerUpdate(playerid)
  398. {
  399. return 1;
  400. }
  401.  
  402. public OnPlayerStreamIn(playerid, forplayerid)
  403. {
  404. return 1;
  405. }
  406.  
  407. public OnPlayerStreamOut(playerid, forplayerid)
  408. {
  409. return 1;
  410. }
  411.  
  412. public OnVehicleStreamIn(vehicleid, forplayerid)
  413. {
  414. return 1;
  415. }
  416.  
  417. public OnVehicleStreamOut(vehicleid, forplayerid)
  418. {
  419. return 1;
  420. }
  421.  
  422. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  423. {
  424. return 1;
  425. }
  426.  
  427. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  428. {
  429. return 1;
  430. }
  431. stock Gn(playerid)
  432. {
  433. new pname[24];
  434. GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
  435. return pname;
  436. }
  437. stock CarFile(vehicleid)
  438. {
  439. new Car[64];
  440. format(Car,64,"Cars/%d.ini",vehicleid);
  441. return Car;
  442. }
  443. stock PFile(playerid)
  444. {
  445. format(file,64,"Cars/Users/%s.ini",Gn(playerid));
  446. return file;
  447. }
  448. stock Pc(playerid) return dini_Int(PFile(playerid),"CarId");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement