Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.88 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.  
  5. #include <a_samp>
  6. #include <zcmd>
  7. #include <gDialog>
  8. #include <pvehicle>
  9. #include <Dini>
  10.  
  11. new Gate;
  12. new Gate2;
  13. new Gate3;
  14. new Gate4;
  15. new bool:AutoNOS[MAX_PLAYERS];
  16.  
  17. #define PATH "Gany/Users/%s.ini"
  18. #define PlayerInfo_DB "Gany/Users/%s.ini"
  19. #define COLOR_GRAD1 0xB4B5B7FF
  20. #define COLOR_GRAD2 0xBFC0C2FF
  21. #define COLOR_GRAD3 0xCBCCCEFF
  22. #define COLOR_GRAD4 0xD8D8D8FF
  23. #define COLOR_GRAD5 0xE3E3E3FF
  24. #define COLOR_GRAD6 0xF0F0F0FF
  25. #define COLOR_GREY 0xAFAFAFAA
  26. #define COLOR_GREEN 0x33AA33AA
  27. #define COLOR_RED 0xAA3333AA
  28. #define COLOR_YELLOW 0xFFFF00AA
  29. #define COLOR_WHITE 0xFFFFFFAA
  30. #define COLOR_FADE1 0xE6E6E6E6
  31. #define COLOR_FADE2 0xC8C8C8C8
  32. #define COLOR_FADE3 0xAAAAAAAA
  33. #define COLOR_FADE4 0x8C8C8C8C
  34. #define COLOR_FADE5 0x6E6E6E6E
  35. #define COLOR_PURPLE 0xC2A2DAAA
  36. #define COLOR_DBLUE 0x2641FEAA
  37. #define COLOR_ALLDEPT 0xFF8282AA
  38. #define COL_LIGHTBLUE "{00CED1}"
  39.  
  40. new CP[MAX_PLAYERS];
  41. enum PlayerDB
  42. {
  43. Kills,
  44. Deaths,
  45. bool:Box,
  46. }
  47. new PlayerData[MAX_PLAYERS][PlayerDB];
  48. forward StatsInfromation();
  49.  
  50. new Text: PlayerStats[MAX_PLAYERS];
  51. new Text: Textdraw1;
  52.  
  53. stock Save(playerid)
  54. {
  55. new FileDB[68];
  56. new Name[MAX_PLAYER_NAME];
  57.  
  58. GetPlayerName(playerid, Name , sizeof(Name));
  59. format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
  60.  
  61. dini_IntSet(FileDB, "Kills" , PlayerData[playerid][Kills]);
  62. dini_IntSet(FileDB, "Deaths" , PlayerData[playerid][Deaths]);
  63. }
  64.  
  65. public OnPlayerEnterCheckpoint(playerid)
  66. {
  67. if(CP[playerid] == 1)
  68. {
  69. DisablePlayerCheckpoint(playerid);
  70. SendClientMessage(playerid, 0xFFFFFFFF, "Dung Lenh /vaokhocs de lay do.");
  71. return 1;
  72. }
  73. if(CP[playerid] == 2)
  74. {
  75. DisablePlayerCheckpoint(playerid);
  76. SendClientMessage(playerid, 0xFFFFFFFF, "Dung Lenh /vaokhocuop de lay do.");
  77. return 1;
  78. }
  79. if(CP[playerid] == 3)
  80. {
  81. DisablePlayerCheckpoint(playerid);
  82. GivePlayerMoney(playerid, 2000);
  83. GivePlayerWeapon(playerid, 30, 99999);
  84. SendClientMessage(playerid,0x33AA33AA,"Ban Lam Viec Rat Tot Va Nhan Duoc 1 AK-47 Full Ammo + 2000$");
  85. }
  86. return 1;
  87. }
  88.  
  89. main()
  90. {
  91. print("\n----------------------------------");
  92. print(" Gany Gamemode LOADED");
  93. print("----------------------------------\n");
  94. }
  95.  
  96.  
  97. public OnGameModeInit()
  98. {
  99. SetGameModeText("GANY MODE v1.0");
  100. AddPlayerClass(285,1956.3945,1343.0414,15.3746,266.8986,0,0,0,0,0,0);
  101. CreateDialog(4,DIALOG_STYLE_LIST,"Vu khi", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Chon", "Dong");
  102. CreateDialog(5,DIALOG_STYLE_LIST,"Nhac", "E'-karik\nFA-Justatee", "Chon", "Dong");
  103. CreateDialog(6,DIALOG_STYLE_LIST,"Kho", "Mau\nGiap", "Chon", "Dong");
  104. CreateDialog(7,DIALOG_STYLE_LIST,"Xe", "Cheetah\nBanshee\nInfernus\nTurismo\nNRG-500", "Chon", "Dong");
  105. //===============================Stats=================================
  106. SetTimer("StatsInfromation",300 , 1);
  107. for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  108. {
  109. PlayerStats[playerid] = TextDrawCreate(231.000000,405.000000,"-");
  110. Textdraw1 = TextDrawCreate(260.000000,391.000000,"STATS");
  111. TextDrawUseBox(PlayerStats[playerid],1);
  112. TextDrawBoxColor(PlayerStats[playerid],0xffffff33);
  113. TextDrawTextSize(PlayerStats[playerid],389.000000,119.000000);
  114. TextDrawAlignment(PlayerStats[playerid],0);
  115. TextDrawAlignment(Textdraw1,0);
  116. TextDrawBackgroundColor(PlayerStats[playerid],0x000000ff);
  117. TextDrawBackgroundColor(Textdraw1,0xff000033);
  118. TextDrawFont(PlayerStats[playerid],2);
  119. TextDrawLetterSize(PlayerStats[playerid],0.399999,1.200000);
  120. TextDrawFont(Textdraw1,2);
  121. TextDrawLetterSize(Textdraw1,0.799999,1.300000);
  122. TextDrawColor(PlayerStats[playerid],0xffffffff);
  123. TextDrawColor(Textdraw1,0xffffffff);
  124. TextDrawSetOutline(PlayerStats[playerid],1);
  125. TextDrawSetOutline(Textdraw1,1);
  126. TextDrawSetProportional(PlayerStats[playerid],1);
  127. TextDrawSetProportional(Textdraw1,1);
  128. TextDrawSetShadow(PlayerStats[playerid],1);
  129. TextDrawSetShadow(Textdraw1,1);
  130.  
  131. Save(playerid);
  132. }
  133. return 1;
  134. }
  135.  
  136. public OnGameModeExit()
  137. {
  138. for(new i = 0;i < MAX_PLAYERS; i++)
  139. {
  140. TextDrawDestroy(PlayerStats[i]);
  141. }
  142. TextDrawDestroy(Textdraw1);
  143. return 1;
  144. }
  145.  
  146. CMD:aobay(playerid, params[])
  147. {
  148. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  149. return 1;
  150. }
  151. CMD:nitro(playerid, params[])
  152. {
  153. if(AutoNOS[playerid])
  154. {
  155. SendClientMessage(playerid, 0x924161FF, "[ ! ] Automatic nitro deactivated.");
  156. AutoNOS[playerid] = false;
  157. }
  158. else
  159. {
  160. SendClientMessage(playerid, 0x924161FF, "[ ! ] Automatic nitro activated!");
  161. AutoNOS[playerid] = true;
  162. }
  163. return 1;
  164. }
  165. CMD:suaxe(playerid,params[])
  166. {
  167. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
  168. RepairVehicle(GetPlayerVehicleID(playerid));
  169. SendClientMessage(playerid, COLOR_YELLOW, "Xe Da Duoc Sua Chua!");
  170. return 1;
  171. }
  172. CMD:xe(playerid, params[])
  173. {
  174. ShowPlayerDialog(playerid, 7);
  175. return 1;
  176. }
  177. CMD:thongtin(playerid,params[])
  178. {
  179. if(PlayerData[playerid][Box] == false)
  180. {
  181. PlayerData[playerid][Box] = true;
  182. TextDrawHideForPlayer(playerid, PlayerStats[playerid]);
  183. TextDrawHideForPlayer(playerid, Textdraw1);
  184.  
  185. SendClientMessage(playerid, 0xFF000096,"Stats box off");
  186. }
  187. else
  188. {
  189. PlayerData[playerid][Box] = false;
  190. TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
  191. TextDrawShowForPlayer(playerid, Textdraw1);
  192.  
  193. SendClientMessage(playerid, 0xFF000096,"Stats box on");
  194. }
  195. return 1;
  196. }
  197.  
  198. CMD:lamviec(playerid, params[])
  199. {
  200. CP[playerid] = 3;
  201. SetPlayerCheckpoint(playerid, -269.1287,2610.6057,63.2069, 3.0);
  202. SendClientMessage(playerid, 0xFFFFFFFF, "You started your first mission. Please follow the checkpoints");
  203. return 1;
  204. }
  205.  
  206. CMD:afk(playerid, params[])
  207. {
  208. new pName[MAX_PLAYER_NAME];
  209. new string[128];
  210. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  211. format(string, sizeof(string), "---> #s now AFK!", pName);
  212. SendClientMessageToAll(COLOR_RED, string);
  213. TogglePlayerControllable(playerid, 0);
  214. SetPlayerHealth(playerid, 999999.99);
  215. return 1;
  216. }
  217. CMD:back(playerid, params[])
  218. {
  219. new pName[MAX_PLAYER_NAME];
  220. new string[128];
  221. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  222. format(string, sizeof(string), "---> #s now back!", pName);
  223. SendClientMessageToAll(COLOR_GREEN, string);
  224. TogglePlayerControllable(playerid, 1);
  225. SetPlayerHealth(playerid, 100);
  226. return 1;
  227. }
  228.  
  229. CMD:lock(playerid, params[])
  230. {
  231. if(IsPlayerInAnyVehicle(playerid))
  232. {
  233. new State=GetPlayerState(playerid);
  234. if(State!=PLAYER_STATE_DRIVER)
  235. {
  236. SendClientMessage(playerid,0xFF004040,"You can only lock the doors as the driver.");
  237. return 1;
  238. }
  239. new i;
  240. for(i=0;i<MAX_PLAYERS;i++)
  241. {
  242. if(i != playerid)
  243. {
  244. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
  245. }
  246. }
  247. SendClientMessage(playerid, 0x33AA33AA, "Vehicle locked!");
  248. new Float:pX, Float:pY, Float:pZ;
  249. GetPlayerPos(playerid,pX,pY,pZ);
  250. PlayerPlaySound(playerid,1056,pX,pY,pZ);
  251. }
  252. else
  253. {
  254. SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
  255. }
  256. return 1;
  257. }
  258. CMD:unlock(playerid, params[])
  259. {
  260. if(IsPlayerInAnyVehicle(playerid))
  261. {
  262. new State=GetPlayerState(playerid);
  263. if(State!=PLAYER_STATE_DRIVER)
  264. {
  265. SendClientMessage(playerid,0xFF004040,"You can only unlock the doors as the driver.");
  266. return 1;
  267. }
  268. new i;
  269. for(i=0;i<MAX_PLAYERS;i++)
  270. {
  271. SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
  272. }
  273. SendClientMessage(playerid, 0x33AA33AA, "Vehicle unlocked!");
  274. new Float:pX, Float:pY, Float:pZ;
  275. GetPlayerPos(playerid,pX,pY,pZ);
  276. PlayerPlaySound(playerid,1057,pX,pY,pZ);
  277. }
  278. else
  279. {
  280. SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
  281. }
  282. return 1;
  283. }
  284. CMD:vukhi(playerid,params[])
  285. {
  286. ShowPlayerDialog(playerid, 4);
  287. return 1;
  288. }
  289.  
  290. DIALOG:0(playerid, response, listitem, inputtext[])
  291. {
  292. if(response)
  293. {
  294. if(listitem == 0)
  295. {
  296. MoveObject(Gate, -2613.62598, -47.35040, -0.3000, 3);
  297. MoveObject(Gate2, -2613.60010, -43.02190, -0.3000, 3);
  298. }
  299. if(listitem == 1)
  300. {
  301. MoveObject(Gate, -2613.62598, -47.35040, 6.8800, 3);
  302. MoveObject(Gate2, -2613.60010, -43.02190, 6.8800, 3);
  303. }
  304. }
  305. return 1;
  306. }
  307. DIALOG:1(playerid, response, listitem, inputtext[])
  308. {
  309. if(response)
  310. {
  311. if(listitem == 0)
  312. {
  313. ShowPlayerDialog(playerid, 2);
  314. }
  315. if(listitem == 1)
  316. {
  317. ShowPlayerDialog(playerid, 3);
  318. }
  319. }
  320. return 1;
  321. }
  322.  
  323. DIALOG:2(playerid, response, listitem, inputtext[])
  324. {
  325. if(response)
  326. {
  327. if(listitem == 0)
  328. {
  329. MoveObject(Gate3,-1572.23792, 658.81207, 6.86240,3,23.22000, -14.33999, 90.00000);
  330. }
  331. if(listitem == 1)
  332. {
  333. MoveObject(Gate3,-1572.2379, 658.8121, 6.86240,4,11.88000, 89.22003, 90.00000);
  334. }
  335. }
  336. return 1;
  337. }
  338. DIALOG:3(playerid, response, listitem, inputtext[])
  339. {
  340. if(response)
  341. {
  342. if(listitem == 0)
  343. {
  344. MoveObject(Gate4,-1701.37341, 687.62732, 24.74230,3,23.22000, -14.33999, 90.00000);
  345. }
  346. if(listitem == 1)
  347. {
  348. MoveObject(Gate4,-1701.37341, 687.62732, 24.74230,4,0.84000, -90.24000, 90.00000);
  349. }
  350. }
  351. return 1;
  352. }
  353. DIALOG:4(playerid, response, listitem, inputtext[])
  354. {
  355. if(response)
  356. {
  357. if(listitem == 0)
  358. {
  359. GivePlayerWeapon(playerid, 22, 9999);
  360. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
  361. }
  362. if(listitem == 1)
  363. {
  364. GivePlayerWeapon(playerid, 23, 9999);
  365. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
  366. }
  367. if(listitem == 2)
  368. {
  369. GivePlayerWeapon(playerid, 24, 9999);
  370. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
  371. }
  372. if(listitem == 3)
  373. {
  374. GivePlayerWeapon(playerid, 25, 9999);
  375. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
  376. }
  377. if(listitem == 4)
  378. {
  379. GivePlayerWeapon(playerid, 26, 9999);
  380. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
  381. }
  382. if(listitem == 5)
  383. {
  384. GivePlayerWeapon(playerid, 27, 9999);
  385. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
  386. }
  387. if(listitem == 6)
  388. {
  389. GivePlayerWeapon(playerid, 28, 9999);
  390. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
  391. }
  392. if(listitem == 7)
  393. {
  394. GivePlayerWeapon(playerid, 29, 9999);
  395. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
  396. }
  397. if(listitem == 8)
  398. {
  399. GivePlayerWeapon(playerid, 30, 9999);
  400. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
  401. }
  402. if(listitem == 9)
  403. {
  404. GivePlayerWeapon(playerid, 31, 9999);
  405. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
  406. }
  407. if(listitem == 10)
  408. {
  409. GivePlayerWeapon(playerid, 32, 9999);
  410. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
  411. }
  412. if(listitem == 11)
  413. {
  414. GivePlayerWeapon(playerid, 33, 9999);
  415. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
  416. }
  417. if(listitem == 12)
  418. {
  419. GivePlayerWeapon(playerid, 34, 9999);
  420. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
  421. }
  422. if(listitem == 13)
  423. {
  424. GivePlayerWeapon(playerid, 43, 9999);
  425. GivePlayerMoney(playerid, -2000);
  426. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera.");
  427. }
  428. if(listitem == 14)
  429. {
  430. GivePlayerWeapon(playerid, 46, 1);
  431. SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Parachute.");
  432. }
  433. }
  434. return 1;
  435. }
  436. DIALOG:5(playerid, response, listitem, inputtext[])
  437. {
  438. if(response)
  439. {
  440. if(listitem == 0)
  441. {
  442. PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/bai-hat/E-Karik-Windy-Quyen/ZW668B9F.html");
  443. SendClientMessage(playerid, COLOR_GREEN, "Ban Da Mo Radio Bai Hat E'-Karik");
  444. }
  445. if(listitem == 1)
  446. {
  447. PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/download/song/Forever-Alone-JustaTee/ZHJGyZHaSpHWEcNtLvxTFHkm");
  448. SendClientMessage(playerid, COLOR_GREEN, "Ban Da Mo Radio Bai Hat FA-Justatee");
  449. }
  450. }
  451. return 1;
  452. }
  453. DIALOG:6(playerid, response, listitem, inputtext[])
  454. {
  455. if(response)
  456. {
  457. if(listitem == 0)
  458. {
  459. SetPlayerHealth(playerid,100);
  460. }
  461. if(listitem == 1)
  462. {
  463. SetPlayerArmour(playerid,100);
  464. }
  465. }
  466. return 1;
  467. }
  468. DIALOG:7(playerid, response, listitem, inputtext[])
  469. {
  470. if(response)
  471. {
  472. if(listitem == 0)
  473. {
  474. CreateVehicleForPlayer(playerid, "415", 2, 2, 1000);
  475. }
  476. if(listitem == 1)
  477. {
  478. CreateVehicleForPlayer(playerid, "429", 3, 0, 1000);
  479. }
  480. if(listitem == 2)
  481. {
  482. CreateVehicleForPlayer(playerid, "411", 1, 1, 1000);
  483. }
  484. if(listitem == 3)
  485. {
  486. CreateVehicleForPlayer(playerid, "451", 6, 6, 1000);
  487. }
  488. if(listitem == 4)
  489. {
  490. CreateVehicleForPlayer(playerid, "522", 3, 6, 1000);
  491. }
  492. }
  493. return 1;
  494. }
  495.  
  496. public OnPlayerConnect(playerid)
  497. {
  498. new FileDB[68];
  499. new Name[MAX_PLAYER_NAME];
  500.  
  501. GetPlayerName(playerid, Name , sizeof(Name));
  502. format(FileDB,sizeof(FileDB) , PlayerInfo_DB ,Name);
  503.  
  504. if(!dini_Exists(FileDB))
  505. {
  506. dini_Create(FileDB);
  507. dini_Set(FileDB, "Name" ,Name);
  508. dini_IntSet(FileDB, "Kills" ,0);
  509. dini_IntSet(FileDB, "Deaths" ,0);
  510. }
  511. PlayerData[playerid][Kills] = dini_Int(FileDB,"Kills");
  512. PlayerData[playerid][Deaths] = dini_Int(FileDB,"Deaths");
  513.  
  514.  
  515. TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
  516. TextDrawShowForPlayer(playerid, Textdraw1);
  517.  
  518.  
  519. SendClientMessage(playerid, 0xFF000096,"Server Dung Phan Mem Hien Giet/Chet System");
  520. return 1;
  521. }
  522.  
  523. public OnPlayerDisconnect(playerid, reason)
  524. {
  525. new FileDB[68];
  526. new Name[MAX_PLAYER_NAME];
  527.  
  528. GetPlayerName(playerid, Name , sizeof(Name));
  529. format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
  530.  
  531. dini_IntSet(FileDB, "Kills" , PlayerData[playerid][Kills]);
  532. dini_IntSet(FileDB, "Deaths" , PlayerData[playerid][Deaths]);
  533.  
  534. PlayerData[playerid][Kills] = 0;
  535. PlayerData[playerid][Deaths] = 0;
  536. return 1;
  537. }
  538.  
  539. public OnPlayerDeath(playerid, killerid, reason)
  540. {
  541. new FileDB[68];
  542. new Name[MAX_PLAYER_NAME];
  543.  
  544. GetPlayerName(playerid, Name , sizeof(Name));
  545. format(FileDB,sizeof(FileDB) , PlayerInfo_DB , Name);
  546.  
  547. dini_IntSet(FileDB, "Giet" , PlayerData[playerid][Kills]);
  548. dini_IntSet(FileDB, "Chet" , PlayerData[playerid][Deaths]);
  549.  
  550. PlayerData[killerid][Kills] ++;
  551. PlayerData[playerid][Deaths] ++;
  552. return 1;
  553. }
  554.  
  555. public StatsInfromation()
  556. {
  557. new str[128];
  558. for(new i=0;i<MAX_PLAYERS;i++)
  559. {
  560. if (IsPlayerConnected(i))
  561. {
  562. format(str, sizeof(str), "Giet: %d - Chet: %d" , PlayerData[i][Kills], PlayerData[i][Deaths]);
  563. TextDrawSetString(PlayerStats[i],str);
  564. }
  565. }
  566. return 1;
  567. }
  568.  
  569. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  570. {
  571. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && AutoNOS[playerid] && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  572. return 1;
  573. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement