Advertisement
Guest User

V-Waffen Shop 0.2 by Viper

a guest
Apr 21st, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.20 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define PRESSED(%0) \
  4. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  5.  
  6. #define DEAGLEPREIS 1200
  7. #define SHOTGUNPREIS 600
  8. #define AK47PREIS 4000
  9. #define MP5PREIS 2000
  10.  
  11. new deagle[MAX_PLAYERS], shotgun[MAX_PLAYERS], ak47[MAX_PLAYERS], mp5[MAX_PLAYERS];
  12.  
  13. new lventerpickup, sfenterpickup, lsenterpickup, exitpickup;
  14.  
  15. new lsmarkt[MAX_PLAYERS],sfmarkt[MAX_PLAYERS],lvmarkt[MAX_PLAYERS];
  16.  
  17. #define COLOR_WHITE 0xFFFFFFFF
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. print("\n--------------------------------------");
  22. print("V-Waffen Shop Beta 0.2 by Viper Loaded...");
  23. print("--------------------------------------\n");
  24. lventerpickup = CreatePickup(1318, 1, 1961.9999, 2321.8918, 16.4558);
  25. sfenterpickup = CreatePickup(1318, 1, -2111.1304, -43.8855, 35.3203);
  26. lsenterpickup = CreatePickup(1318, 1, 1691.2914,-1200.0410,19.8984);
  27.  
  28. exitpickup = CreatePickup(1318, 1, -22.6983, -74.2416, 1007.9487);
  29.  
  30. CreateObject(11312,-19.38111687,-82.16435242,1008.95983887,0.00000000,0.00000000,0.00000000); //object(modshop2_sfse) (2)
  31. CreateObject(8957,-11.81666183,-85.36924744,1009.51208496,0.00000000,0.00000000,0.00000000); //object(vgsespdr01) (1)
  32. CreateObject(2949,-23.44624901,-73.83814240,1006.72149658,0.00000000,0.00000000,90.00000000); //object(kmb_lockeddoor) (1)
  33. CreateObject(1353,-13.21133232,-81.15743256,1007.36901855,0.00000000,0.00000000,0.00000000); //object(cj_aircon) (1)
  34. CreateObject(2653,-17.71093178,-86.71479034,1011.19561768,0.00000000,180.00000000,0.00000000); //object(cj_aircon3) (1)
  35. CreateObject(2653,-17.69083405,-78.90004730,1011.19561768,0.00000000,179.99450684,0.00000000); //object(cj_aircon3) (2)
  36. CreateObject(2395,-20.56766510,-80.30813599,1007.06170654,0.00000000,0.00000000,0.00000000); //object(cj_sports_wall) (1)
  37. CreateObject(348,-20.75782967,-80.29655457,1008.60150146,0.00000000,0.00000000,0.00000000); //object(2)
  38. CreateObject(349,-18.29081345,-80.23852539,1008.29766846,354.00000000,270.00000000,180.00000000); //object(3)
  39. CreateObject(2395,-16.94242287,-80.29593658,1007.06170654,0.00000000,0.00000000,0.00000000); //object(cj_sports_wall) (2)
  40. CreateObject(355,-16.37340546,-80.30175781,1008.26141357,352.55581665,298.10903931,357.36602783); //object(4)
  41. CreateObject(353,-14.32423592,-80.27681732,1008.36853027,0.00000000,0.00000000,5.50000000); //object(5)
  42. return 1;
  43. }
  44.  
  45. public OnFilterScriptExit()
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerRequestClass(playerid, classid)
  51. {
  52. return 1;
  53. }
  54.  
  55. public OnPlayerConnect(playerid)
  56. {
  57. PreloadAnimLib(playerid,"CLOTHES");
  58. ClearAnimations(playerid);
  59. deagle[playerid] = 0;
  60. shotgun[playerid] = 0;
  61. ak47[playerid] = 0;
  62. mp5[playerid] = 0;
  63. lvmarkt[playerid] = 0;
  64. sfmarkt[playerid] = 0;
  65. lsmarkt[playerid] = 0;
  66. SetPlayerMapIcon(playerid, 90, 1961.9999, 2321.8918, 16.4558, 6, 90, MAPICON_GLOBAL);//LV
  67. SetPlayerMapIcon(playerid, 91, -2111.1304, -43.8855, 35.3203, 6, 90, MAPICON_GLOBAL);//SF
  68. SetPlayerMapIcon(playerid, 92, 1691.2914, -1200.0410, 19.8984, 6, 90, MAPICON_GLOBAL);//LS
  69. return 1;
  70. }
  71.  
  72. public OnPlayerDisconnect(playerid, reason)
  73. {
  74. return 1;
  75. }
  76.  
  77. public OnPlayerSpawn(playerid)
  78. {
  79. return 1;
  80. }
  81.  
  82. public OnPlayerDeath(playerid, killerid, reason)
  83. {
  84. return 1;
  85. }
  86.  
  87. public OnVehicleSpawn(vehicleid)
  88. {
  89. return 1;
  90. }
  91.  
  92. public OnVehicleDeath(vehicleid, killerid)
  93. {
  94. return 1;
  95. }
  96.  
  97. public OnPlayerText(playerid, text[])
  98. {
  99. return 1;
  100. }
  101.  
  102. public OnPlayerCommandText(playerid, cmdtext[])
  103. {
  104. return 0;
  105. }
  106.  
  107. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  108. {
  109. return 1;
  110. }
  111.  
  112. public OnPlayerExitVehicle(playerid, vehicleid)
  113. {
  114. return 1;
  115. }
  116.  
  117. public OnPlayerStateChange(playerid, newstate, oldstate)
  118. {
  119. return 1;
  120. }
  121.  
  122. public OnPlayerEnterCheckpoint(playerid)
  123. {
  124. return 1;
  125. }
  126.  
  127. public OnPlayerLeaveCheckpoint(playerid)
  128. {
  129. return 1;
  130. }
  131.  
  132. public OnPlayerEnterRaceCheckpoint(playerid)
  133. {
  134. return 1;
  135. }
  136.  
  137. public OnPlayerLeaveRaceCheckpoint(playerid)
  138. {
  139. return 1;
  140. }
  141.  
  142. public OnRconCommand(cmd[])
  143. {
  144. return 1;
  145. }
  146.  
  147. public OnPlayerRequestSpawn(playerid)
  148. {
  149. return 1;
  150. }
  151.  
  152. public OnObjectMoved(objectid)
  153. {
  154. return 1;
  155. }
  156.  
  157. public OnPlayerObjectMoved(playerid, objectid)
  158. {
  159. return 1;
  160. }
  161.  
  162. public OnPlayerPickUpPickup(playerid, pickupid)
  163. {
  164. if(pickupid == lventerpickup)
  165. {
  166. SetPlayerPos(playerid, -22.6914, -76.7815, 1007.9487);
  167. lvmarkt[playerid] = 1;
  168. SetPlayerInterior(playerid, 1);
  169. }
  170.  
  171. if(pickupid == sfenterpickup)
  172. {
  173. SetPlayerPos(playerid, -22.6914, -76.7815, 1007.9487);
  174. sfmarkt[playerid] = 1;
  175. SetPlayerInterior(playerid, 1);
  176. }
  177.  
  178. if(pickupid == lsenterpickup)
  179. {
  180. SetPlayerPos(playerid, -22.6914, -76.7815, 1007.9487);
  181. lsmarkt[playerid] = 1;
  182. SetPlayerInterior(playerid, 1);
  183. }
  184.  
  185. if(pickupid == exitpickup)
  186. {
  187. if(lvmarkt[playerid] == 1)
  188. {
  189. SetPlayerPos(playerid, 1961.9427, 2324.1294, 16.3917);
  190. lvmarkt[playerid] = 0;
  191. SetPlayerInterior(playerid, 0);
  192. }
  193. else if(sfmarkt[playerid] == 1)
  194. {
  195. SetPlayerPos(playerid, -2110.6543, -45.7512, 35.3203);
  196. sfmarkt[playerid] = 0;
  197. SetPlayerInterior(playerid, 0);
  198. }
  199. else if(lsmarkt[playerid] == 1)
  200. {
  201. SetPlayerPos(playerid, 1691.3162, -1202.4640, 19.8984);
  202. lsmarkt[playerid] = 0;
  203. SetPlayerInterior(playerid, 0);
  204. }
  205. }
  206. return 1;
  207. }
  208.  
  209. public OnVehicleMod(playerid, vehicleid, componentid)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerSelectedMenuRow(playerid, row)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerExitedMenu(playerid)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  240. {
  241. new string[28];
  242. if (PRESSED(KEY_SECONDARY_ATTACK))
  243. {
  244. if(IsPlayerInRangeOfPoint(playerid, 1.0, -20.75782967, -80.29655457, 1008.60150146))
  245. {
  246. if(deagle[playerid] == 0)
  247. {
  248. format(string, sizeof(string), "Deagle - Preis: %d$", DEAGLEPREIS);
  249. SendClientMessage(playerid, COLOR_WHITE, string);
  250. SendClientMessage(playerid, COLOR_WHITE, "Enter zum Kaufen - Leertaste zum Abbrechen");
  251. SetPlayerPos(playerid, -20.6253,-80.6140,1007.9487);
  252. SetPlayerFacingAngle(playerid, 87.8167);
  253. SetPlayerCameraPos(playerid, -20.8007,-83.4208,1007.9487);
  254. SetPlayerCameraLookAt(playerid, -20.6253,-80.6140,1007.9487);
  255. deagle[playerid] = 1;
  256. TogglePlayerControllable(playerid, 0);
  257. ApplyAnimation(playerid, "CLOTHES", "CLO_POSE_Watch", 4.1, 0, 1, 1, 1, 1);
  258. SetPlayerAttachedObject(playerid, 0, 348, 5, 0.000000, 0.039999, 0.000000, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  259. }
  260. else if(deagle[playerid] == 1)
  261. {
  262. if(GetPlayerMoney(playerid) < DEAGLEPREIS)
  263. {
  264. RemovePlayerAttachedObject(playerid,0);
  265. SetCameraBehindPlayer(playerid);
  266. deagle[playerid] = 0;
  267. TogglePlayerControllable(playerid, 1);
  268. ClearAnimations(playerid);
  269. format(string, sizeof(string), "Sie haben keine %d$!", DEAGLEPREIS);
  270. SendClientMessage(playerid, COLOR_WHITE, string);
  271. return 1;
  272. }
  273. GivePlayerWeapon(playerid, 24, 100);
  274. RemovePlayerAttachedObject(playerid,0);
  275. SetCameraBehindPlayer(playerid);
  276. deagle[playerid] = 0;
  277. GivePlayerMoney(playerid, -DEAGLEPREIS);
  278. TogglePlayerControllable(playerid, 1);
  279. ClearAnimations(playerid);
  280. }
  281. }
  282.  
  283. else if(IsPlayerInRangeOfPoint(playerid, 1.0, -18.29081345, -80.23852539, 1008.29766846))
  284. {
  285. if(shotgun[playerid] == 0)
  286. {
  287. format(string, sizeof(string), "Shotgun - Preis: %d$", SHOTGUNPREIS);
  288. SendClientMessage(playerid, COLOR_WHITE, string);
  289. SendClientMessage(playerid, COLOR_WHITE, "Enter zum Kaufen - Leertaste zum Abbrechen");
  290. SetPlayerPos(playerid, -18.1738,-80.6140,1007.9487);
  291. SetPlayerFacingAngle(playerid, 87.8167);
  292. SetPlayerCameraPos(playerid, -18.1738,-83.4208,1007.9487);
  293. SetPlayerCameraLookAt(playerid, -18.1738,-80.6140,1007.9487);
  294. shotgun[playerid] = 1;
  295. TogglePlayerControllable(playerid, 0);
  296. ApplyAnimation(playerid, "CLOTHES", "CLO_POSE_Watch", 4.1, 0, 1, 1, 1, 1);
  297. SetPlayerAttachedObject(playerid, 0, 349, 5, 0.000000, 0.049999, 0.029999, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  298. }
  299. else if(shotgun[playerid] == 1)
  300. {
  301. if(GetPlayerMoney(playerid) < SHOTGUNPREIS)
  302. {
  303. RemovePlayerAttachedObject(playerid,0);
  304. SetCameraBehindPlayer(playerid);
  305. shotgun[playerid] = 0;
  306. TogglePlayerControllable(playerid, 1);
  307. ClearAnimations(playerid);
  308. format(string, sizeof(string), "Sie haben keine %d$!", SHOTGUNPREIS);
  309. SendClientMessage(playerid, COLOR_WHITE, string);
  310. return 1;
  311. }
  312. GivePlayerWeapon(playerid, 25, 100);
  313. RemovePlayerAttachedObject(playerid,0);
  314. SetCameraBehindPlayer(playerid);
  315. shotgun[playerid] = 0;
  316. GivePlayerMoney(playerid, -SHOTGUNPREIS);
  317. TogglePlayerControllable(playerid, 1);
  318. ClearAnimations(playerid);
  319. }
  320. }
  321.  
  322. else if(IsPlayerInRangeOfPoint(playerid, 1.0, -16.37340546, -80.30175781, 1008.26141357))
  323. {
  324. if(ak47[playerid] == 0)
  325. {
  326. format(string, sizeof(string), "AK47 - Preis: %d$", AK47PREIS);
  327. SendClientMessage(playerid, COLOR_WHITE, string);
  328. SendClientMessage(playerid, COLOR_WHITE, "Enter zum Kaufen - Leertaste zum Abbrechen");
  329. SetPlayerPos(playerid, -16.2758,-80.6018,1007.9487);
  330. SetPlayerFacingAngle(playerid, 87.8167);
  331. SetPlayerCameraPos(playerid, -16.2758,-83.4208,1007.9487);
  332. SetPlayerCameraLookAt(playerid, -16.2758,-80.6140,1007.9487);
  333. ak47[playerid] = 1;
  334. TogglePlayerControllable(playerid, 0);
  335. ApplyAnimation(playerid, "CLOTHES", "CLO_POSE_Watch", 4.1, 0, 1, 1, 1, 1);
  336. SetPlayerAttachedObject(playerid, 0, 355, 5, 0.029999, 0.029999, 0.000000, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  337. }
  338. else if(ak47[playerid] == 1)
  339. {
  340. if(GetPlayerMoney(playerid) < AK47PREIS)
  341. {
  342. RemovePlayerAttachedObject(playerid,0);
  343. SetCameraBehindPlayer(playerid);
  344. ak47[playerid] = 0;
  345. TogglePlayerControllable(playerid, 1);
  346. ClearAnimations(playerid);
  347. format(string, sizeof(string), "Sie haben keine %d$!", AK47PREIS);
  348. SendClientMessage(playerid, COLOR_WHITE, string);
  349. return 1;
  350. }
  351. GivePlayerWeapon(playerid, 30, 100);
  352. RemovePlayerAttachedObject(playerid,0);
  353. SetCameraBehindPlayer(playerid);
  354. ak47[playerid] = 0;
  355. GivePlayerMoney(playerid, -AK47PREIS);
  356. TogglePlayerControllable(playerid, 1);
  357. ClearAnimations(playerid);
  358. }
  359. }
  360.  
  361. else if(IsPlayerInRangeOfPoint(playerid, 1.0, -14.32423592, -80.27681732, 1008.36853027))
  362. {
  363. if(mp5[playerid] == 0)
  364. {
  365. format(string, sizeof(string), "MP5 - Preis: %d$", MP5PREIS);
  366. SendClientMessage(playerid, COLOR_WHITE, string);
  367. SendClientMessage(playerid, COLOR_WHITE, "Enter zum Kaufen - Leertaste zum Abbrechen");
  368. SetPlayerPos(playerid, -14.1942,-80.8255,1007.9487);
  369. SetPlayerFacingAngle(playerid, 87.8167);
  370. SetPlayerCameraPos(playerid, -14.1942,-83.4208,1007.9487);
  371. SetPlayerCameraLookAt(playerid, -14.1942,-80.6140,1007.9487);
  372. mp5[playerid] = 1;
  373. TogglePlayerControllable(playerid, 0);
  374. ApplyAnimation(playerid, "CLOTHES", "CLO_POSE_Watch", 4.1, 0, 1, 1, 1, 1);
  375. SetPlayerAttachedObject(playerid, 0, 353, 5, 0.000000, 0.020000, 0.000000, 180.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  376. }
  377. else if(mp5[playerid] == 1)
  378. {
  379. if(GetPlayerMoney(playerid) < MP5PREIS)
  380. {
  381. RemovePlayerAttachedObject(playerid,0);
  382. SetCameraBehindPlayer(playerid);
  383. mp5[playerid] = 0;
  384. TogglePlayerControllable(playerid, 1);
  385. ClearAnimations(playerid);
  386. format(string, sizeof(string), "Sie haben keine %d$!", MP5PREIS);
  387. SendClientMessage(playerid, COLOR_WHITE, string);
  388. return 1;
  389. }
  390. GivePlayerWeapon(playerid, 29, 100);
  391. RemovePlayerAttachedObject(playerid,0);
  392. SetCameraBehindPlayer(playerid);
  393. mp5[playerid] = 0;
  394. GivePlayerMoney(playerid, -MP5PREIS);
  395. TogglePlayerControllable(playerid, 1);
  396. ClearAnimations(playerid);
  397. }
  398. }
  399. }
  400. if (PRESSED(KEY_SPRINT))
  401. {
  402. if(deagle[playerid] == 1)
  403. {
  404. RemovePlayerAttachedObject(playerid,0);
  405. SetCameraBehindPlayer(playerid);
  406. deagle[playerid] = 0;
  407. TogglePlayerControllable(playerid, 1);
  408. ClearAnimations(playerid);
  409. }
  410. else if(shotgun[playerid] == 1)
  411. {
  412. RemovePlayerAttachedObject(playerid,0);
  413. SetCameraBehindPlayer(playerid);
  414. shotgun[playerid] = 0;
  415. TogglePlayerControllable(playerid, 1);
  416. ClearAnimations(playerid);
  417. }
  418. else if(ak47[playerid] == 1)
  419. {
  420. RemovePlayerAttachedObject(playerid,0);
  421. SetCameraBehindPlayer(playerid);
  422. ak47[playerid] = 0;
  423. TogglePlayerControllable(playerid, 1);
  424. ClearAnimations(playerid);
  425. }
  426. else if(mp5[playerid] == 1)
  427. {
  428. RemovePlayerAttachedObject(playerid,0);
  429. SetCameraBehindPlayer(playerid);
  430. mp5[playerid] = 0;
  431. TogglePlayerControllable(playerid, 1);
  432. ClearAnimations(playerid);
  433. }
  434. }
  435.  
  436. return 1;
  437. }
  438.  
  439.  
  440. public OnRconLoginAttempt(ip[], password[], success)
  441. {
  442. return 1;
  443. }
  444.  
  445. public OnPlayerUpdate(playerid)
  446. {
  447. return 1;
  448. }
  449.  
  450. public OnPlayerStreamIn(playerid, forplayerid)
  451. {
  452. return 1;
  453. }
  454.  
  455. public OnPlayerStreamOut(playerid, forplayerid)
  456. {
  457. return 1;
  458. }
  459.  
  460. public OnVehicleStreamIn(vehicleid, forplayerid)
  461. {
  462. return 1;
  463. }
  464.  
  465. public OnVehicleStreamOut(vehicleid, forplayerid)
  466. {
  467. return 1;
  468. }
  469.  
  470. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  471. {
  472. return 1;
  473. }
  474.  
  475. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  476. {
  477. return 1;
  478. }
  479.  
  480. stock PreloadAnimLib(playerid, animlib[])
  481. {
  482. ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  483. return 1;
  484. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement