Advertisement
Guest User

Untitled

a guest
Sep 15th, 2012
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.41 KB | None | 0 0
  1. /*
  2.  
  3. **************************
  4. D's REP system v1.0
  5. **************************
  6. */
  7.  
  8.  
  9. #include <a_samp>
  10. #include <zcmd>
  11. #include <dini>
  12. #include <foreach>
  13.  
  14. #define DIALOG_MENU 991
  15. #define DIALOG_MY_INFO 992
  16. #define DIALOG_GIVE_REP 993
  17. #define DIALOG_SET_REP 994
  18.  
  19. #define LIST DIALOG_STYLE_LIST
  20. #define MSG DIALOG_STYLE_MSGBOX
  21. #define INPUT DIALOG_STYLE_INPUT
  22.  
  23. new Text:RepPlus0,
  24. Text:RepPlus1,
  25. Text:RepPlus2,
  26. Text:RepPlus3,
  27. Text:RepPlus4 [ MAX_PLAYERS ];
  28.  
  29. new Text:RepMinus0,
  30. Text:RepMinus1,
  31. Text:RepMinus2,
  32. Text:RepMinus3,
  33. Text:RepMinus4 [ MAX_PLAYERS ];
  34.  
  35. new Text:Reputation0,
  36. Text:Reputation1,
  37. Text:Reputation2[ MAX_PLAYERS ],
  38. Text:Reputation3,
  39. Text:Reputation4;
  40.  
  41. enum PlayerInfo
  42. {
  43. bool:RepBar,
  44. Rep,
  45. Status,
  46. RepAmmount,
  47. bool:GivingRep
  48. }
  49. new pInfo[MAX_PLAYERS][PlayerInfo];
  50.  
  51.  
  52. new TextDrawTimer [ MAX_PLAYERS ];
  53.  
  54. public OnFilterScriptInit()
  55. {
  56. LoadTextdraws( );
  57. //Loads textdraws
  58.  
  59. print("\n");
  60. print("************************************");
  61. print("* *");
  62. print("* ----------------- *");
  63. print("* D's REP system v1.0 *");
  64. print("* ----------------- *");
  65. print("* By Dresta *");
  66. print("* *");
  67. print("************************************");
  68. print("\n");
  69. return 1;
  70. }
  71.  
  72. public OnFilterScriptExit()
  73. {
  74. return 1;
  75. }
  76.  
  77. main()
  78. {
  79. print("\n----------------------------------");
  80. print(" -----------------------------------");
  81. print("----------------------------------\n");
  82. }
  83.  
  84.  
  85. public OnPlayerRequestClass(playerid, classid)
  86. {
  87. return 1;
  88. }
  89.  
  90. public OnPlayerConnect(playerid)
  91. {
  92. pInfo[playerid][RepBar] = true;
  93. pInfo[playerid][GivingRep] = false;
  94. pInfo[playerid][Status] = 0;
  95. pInfo[playerid][RepAmmount] = 0;
  96. return 1;
  97. }
  98.  
  99. public OnPlayerDisconnect(playerid, reason)
  100. {
  101. SaveRep(playerid);
  102. return 1;
  103. }
  104.  
  105. public OnPlayerSpawn(playerid)
  106. {
  107. new file[46];
  108. format(file, sizeof(file), "REP/%s.ini",pName(playerid));
  109. if(!dini_Exists(file))
  110. {
  111. dini_Create(file);
  112. dini_IntSet(file, "REP", 0);
  113. pInfo[playerid][Rep] = 0;
  114. }
  115. else
  116. {
  117. pInfo[playerid][Rep] = dini_Int(file, "REP");
  118. }
  119. RepTextdrawOff(playerid);
  120. RepTextdrawOn(playerid);
  121. UpdateRepBar(playerid);
  122. return 1;
  123. }
  124.  
  125. public OnPlayerDeath(playerid, killerid, reason)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnVehicleSpawn(vehicleid)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnVehicleDeath(vehicleid, killerid)
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnPlayerText(playerid, text[])
  141. {
  142. return 1;
  143. }
  144.  
  145. CMD:atsaukti(playerid, params[])
  146. {
  147. if(pInfo[playerid][GivingRep])
  148. {
  149. pInfo[playerid][GivingRep] = false;
  150. TogglePlayerControllable(playerid,true);
  151. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Reputacijos davimas atšauktas.");
  152. }
  153. return 1;
  154. }
  155.  
  156. CMD:rep(playerid, params[])
  157. {
  158. new string[12],
  159. dialog[126];
  160.  
  161. if(pInfo[playerid][RepBar]) string = "Slėpti";
  162. else string = "Rodyti";
  163.  
  164. if(!IsPlayerAdmin(playerid))
  165. {
  166. format (dialog, sizeof( dialog ),"{D2D2D2}Mano {1898FF}REP\n{D2D2D2}Duoti {1898FF}REP\n{D2D2D2}%s {1898FF}REP {D2D2D2}info", string );
  167. ShowPlayerDialog(playerid,DIALOG_MENU, LIST,"{1898FF}REP - Menu", dialog, "Rinktis","Atšaukti");
  168. }
  169. else
  170. {
  171. format (dialog, sizeof( dialog ),"{D2D2D2}Mano {1898FF}REP\n{D2D2D2}Duoti {1898FF}REP\n{D2D2D2}%s {1898FF}REP {D2D2D2}info\n{D2D2D2}Nustatyti REP (rcon)", string );
  172. ShowPlayerDialog(playerid,DIALOG_MENU, LIST, "{1898FF}REP - Menu", dialog, "Rinktis","Atšaukti");
  173. }
  174. return 1;
  175. }
  176.  
  177. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  178. {
  179. return 1;
  180. }
  181.  
  182. public OnPlayerExitVehicle(playerid, vehicleid)
  183. {
  184. return 1;
  185. }
  186.  
  187. public OnPlayerStateChange(playerid, newstate, oldstate)
  188. {
  189. return 1;
  190. }
  191.  
  192. public OnPlayerEnterCheckpoint(playerid)
  193. {
  194. return 1;
  195. }
  196.  
  197. public OnPlayerLeaveCheckpoint(playerid)
  198. {
  199. return 1;
  200. }
  201.  
  202. public OnPlayerEnterRaceCheckpoint(playerid)
  203. {
  204. return 1;
  205. }
  206.  
  207. public OnPlayerLeaveRaceCheckpoint(playerid)
  208. {
  209. return 1;
  210. }
  211.  
  212. public OnRconCommand(cmd[])
  213. {
  214. return 1;
  215. }
  216.  
  217. public OnPlayerRequestSpawn(playerid)
  218. {
  219. return 1;
  220. }
  221.  
  222. public OnObjectMoved(objectid)
  223. {
  224. return 1;
  225. }
  226.  
  227. public OnPlayerObjectMoved(playerid, objectid)
  228. {
  229. return 1;
  230. }
  231.  
  232. public OnPlayerPickUpPickup(playerid, pickupid)
  233. {
  234. return 1;
  235. }
  236.  
  237. public OnVehicleMod(playerid, vehicleid, componentid)
  238. {
  239. return 1;
  240. }
  241.  
  242. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  243. {
  244. return 1;
  245. }
  246.  
  247. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  248. {
  249. return 1;
  250. }
  251.  
  252. public OnPlayerSelectedMenuRow(playerid, row)
  253. {
  254. return 1;
  255. }
  256.  
  257. public OnPlayerExitedMenu(playerid)
  258. {
  259. return 1;
  260. }
  261.  
  262. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  263. {
  264. return 1;
  265. }
  266.  
  267. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  268. {
  269. return 1;
  270. }
  271.  
  272. public OnRconLoginAttempt(ip[], password[], success)
  273. {
  274. return 1;
  275. }
  276.  
  277. public OnPlayerUpdate(playerid)
  278. {
  279. return 1;
  280. }
  281.  
  282. public OnPlayerStreamIn(playerid, forplayerid)
  283. {
  284. return 1;
  285. }
  286.  
  287. public OnPlayerStreamOut(playerid, forplayerid)
  288. {
  289. return 1;
  290. }
  291.  
  292. public OnVehicleStreamIn(vehicleid, forplayerid)
  293. {
  294. return 1;
  295. }
  296.  
  297. public OnVehicleStreamOut(vehicleid, forplayerid)
  298. {
  299. return 1;
  300. }
  301.  
  302. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  303. {
  304. if(dialogid == DIALOG_MENU)
  305. {
  306. if(response)
  307. {
  308. switch(listitem)
  309. {
  310. case 0:
  311. {
  312. new msg[126];
  313.  
  314. format ( msg , sizeof( msg ),"{D2D2D2}Jūs turite {1898FF}%d{D2D2D2} REP taškus.",pInfo[playerid][Rep]);
  315. ShowPlayerDialog(playerid,DIALOG_MY_INFO, MSG, "{1898FF}REP - Mano taškai", msg, "OK","");
  316. }
  317. case 1:
  318. {
  319. ShowPlayerDialog(playerid, DIALOG_GIVE_REP, LIST, "{1898FF}REP - Duoti rep", "{09B700}+ Rep\n{B70000}- Rep", "Rinktis","Atšaukti");
  320. }
  321. case 2:
  322. {
  323.  
  324. if(pInfo[playerid][RepBar] == true)
  325. {
  326. RepTextdrawOff(playerid);
  327. pInfo[playerid][RepBar] = false;
  328. }
  329. else
  330. {
  331. RepTextdrawOn(playerid);
  332. pInfo[playerid][RepBar] = true;
  333. }
  334.  
  335. new string[12],
  336. dialog[126];
  337.  
  338. if(pInfo[playerid][RepBar])
  339. {
  340. string = "Slėpti";
  341. }
  342. else
  343. {
  344. string = "Rodyti";
  345. }
  346. if(!IsPlayerAdmin(playerid))
  347. {
  348. format (dialog, sizeof( dialog ),"{D2D2D2}Mano {1898FF}REP\n{D2D2D2}Duoti {1898FF}REP\n{D2D2D2}%s {1898FF}REP {D2D2D2}info", string );
  349. ShowPlayerDialog(playerid,DIALOG_MENU, LIST,"{1898FF}REP - Menu", dialog, "Rinktis","Atšaukti");
  350. }
  351. else
  352. {
  353. format (dialog, sizeof( dialog ),"{D2D2D2}Mano {1898FF}REP\n{D2D2D2}Duoti {1898FF}REP\n{D2D2D2}%s {1898FF}REP {D2D2D2}info\n{D2D2D2}Nustatyti REP (rcon)", string );
  354. ShowPlayerDialog(playerid,DIALOG_MENU, LIST, "{1898FF}REP - Menu", dialog, "Rinktis","Atšaukti");
  355. }
  356. }
  357. case 3:
  358. {
  359. ShowPlayerDialog(playerid,DIALOG_SET_REP, INPUT, "{1898FF}REP - Nustatymas", "{D2D2D2}Irašykite kiekį reputacijos kurį norite nustatyti.", "Rinktis","Atšaukti");
  360. }
  361. }
  362. }
  363. }
  364. if(dialogid == DIALOG_GIVE_REP)
  365. {
  366. if(response)
  367. {
  368. switch(listitem)
  369. {
  370. case 0:
  371. {
  372. pInfo[playerid][GivingRep] = true;
  373. pInfo[playerid][Status] = 1;
  374. for(new i=0;i<11;i++) SendClientMessage(playerid, 0xFFFFFFAA, " ");
  375. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Rep davimo funkcija dabar ijungta.");
  376. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Paspauskite TAB mygtuką, ir pasirinkite žaidėją, jis/ji gaus +1 REP tašką.");
  377. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Arba galite nutraukti davimą su komanda - /atsaukti.");
  378. TogglePlayerControllable(playerid,false);
  379. }
  380. case 1:
  381. {
  382. pInfo[playerid][GivingRep] = true;
  383. pInfo[playerid][Status] = 2;
  384. for(new i=0;i<11;i++) SendClientMessage(playerid, 0xFFFFFFAA, " ");
  385. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Rep davimo funkcija dabar ijungta.");
  386. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Paspauskite TAB mygtuką, ir pasirinkite žaidėją, jis/ji gaus -1 REP tašką.");
  387. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Arba galite nutraukti davimą su komanda - /atsaukti.");
  388. TogglePlayerControllable(playerid,false);
  389. }
  390. }
  391. }
  392. }
  393. if(dialogid == DIALOG_SET_REP)
  394. {
  395. if(response)
  396. {
  397. pInfo[playerid][RepAmmount] = strval(inputtext);
  398. pInfo[playerid][Status] = 3;
  399. pInfo[playerid][GivingRep] = true;
  400. for(new i=0;i<11;i++) SendClientMessage(playerid, 0xFFFFFFAA, " ");
  401. new msg[126];
  402. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Rep davimo funkcija dabar ijungta.");
  403. format ( msg , sizeof( msg ),"{1898FF}[INFO]:{D2D2D2} Paspauskite TAB mygtuką, pasirinkite žaidėją, ir jis/ji gaus %d rep tašką(-us).",pInfo[playerid][RepAmmount]);
  404. SendClientMessage(playerid,0xFFFFFFAA,msg);
  405. SendClientMessage(playerid,0xFFFFFFAA,"{1898FF}[INFO]:{D2D2D2} Arba galite nutraukti davimą su komanda - /atsaukti.");
  406. TogglePlayerControllable(playerid,false);
  407. }
  408. }
  409. return 1;
  410. }
  411.  
  412. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  413. {
  414.  
  415. if(pInfo[playerid][GivingRep])
  416. {
  417. if(!IsPlayerAdmin(playerid))
  418. {
  419. if(clickedplayerid == playerid)
  420. {
  421. SendClientMessage(playerid,0xFFFFFFAA, "{D2D2D2}Sau reputacijos duoti negalite.");
  422. TogglePlayerControllable(playerid,true);
  423. return 1;
  424. }
  425. }
  426. if(pInfo[playerid][Status] == 1)
  427. {
  428. PlusRep(playerid,clickedplayerid);
  429. pInfo[playerid][Status] = 0;
  430. pInfo[playerid][GivingRep] = false;
  431. TogglePlayerControllable(playerid,true);
  432. TextDrawTimer[playerid] = SetTimerEx("HideTDmsg",4000,false,"d",clickedplayerid);
  433. new msg[126];
  434. format ( msg , sizeof( msg ),"{D2D2D2}Davėte +1 rep tašką žaidėjui {1898FF}%s.",pName(clickedplayerid));
  435. SendClientMessage(playerid,0xFFFFFFAA,msg);
  436. SaveRep(clickedplayerid);
  437.  
  438. }
  439. if(pInfo[playerid][Status] == 2)
  440. {
  441. MinusRep(playerid,clickedplayerid);
  442. pInfo[playerid][Status] = 0;
  443. pInfo[playerid][GivingRep] = false;
  444. TogglePlayerControllable(playerid,true);
  445. TextDrawTimer[playerid] = SetTimerEx("HideTDmsg",4000,false,"d",clickedplayerid);
  446. new msg[126];
  447. format ( msg , sizeof( msg ),"{D2D2D2}Davėte -1 rep tašką žaidėjui {1898FF}%s.",pName(clickedplayerid));
  448. SendClientMessage(playerid,0xFFFFFFAA,msg);
  449. SaveRep(clickedplayerid);
  450. }
  451. if(pInfo[playerid][Status] == 3)
  452. {
  453. SetRep(playerid,clickedplayerid,pInfo[playerid][RepAmmount]);
  454. pInfo[playerid][Status] = 0;
  455. pInfo[playerid][GivingRep] = false;
  456. TogglePlayerControllable(playerid,true);
  457. TextDrawTimer[playerid] = SetTimerEx("HideTDmsg",4000,false,"d",clickedplayerid);
  458. new msg[126];
  459. format ( msg , sizeof( msg ),"{D2D2D2}Nustatėte {1898FF}%d{D2D2D2} rep taškus į {1898FF}%s.", pInfo[playerid][RepAmmount],pName(clickedplayerid));
  460. SendClientMessage(playerid,0xFFFFFFAA,msg);
  461. SaveRep(clickedplayerid);
  462. }
  463. }
  464. new msg[126];
  465. format ( msg , sizeof( msg ),"{D2D2D2}Žaidėjas %s turi {1898FF}%d{D2D2D2} REP taškus.",pName(clickedplayerid),pInfo[clickedplayerid][Rep]);
  466. ShowPlayerDialog(playerid,DIALOG_MY_INFO, MSG, "{1898FF}REP - Žaidėjo info", msg, "OK","");
  467. return 1;
  468. }
  469.  
  470. stock LoadTextdraws()
  471. {
  472. RepPlus0 = TextDrawCreate(492.000000, 28.000000, "_");
  473. TextDrawBackgroundColor(RepPlus0, 255);
  474. TextDrawFont(RepPlus0, 1);
  475. TextDrawLetterSize(RepPlus0, 0.500000, 4.800000);
  476. TextDrawColor(RepPlus0, -1);
  477. TextDrawSetOutline(RepPlus0, 0);
  478. TextDrawSetProportional(RepPlus0, 1);
  479. TextDrawSetShadow(RepPlus0, 1);
  480. TextDrawUseBox(RepPlus0, 1);
  481. TextDrawBoxColor(RepPlus0, 80);
  482. TextDrawTextSize(RepPlus0, 400.000000, -30.000000);
  483.  
  484. RepPlus1 = TextDrawCreate(491.000000, 29.000000, "_");
  485. TextDrawBackgroundColor(RepPlus1, 255);
  486. TextDrawFont(RepPlus1, 1);
  487. TextDrawLetterSize(RepPlus1, 0.500000, 4.600000);
  488. TextDrawColor(RepPlus1, -1);
  489. TextDrawSetOutline(RepPlus1, 0);
  490. TextDrawSetProportional(RepPlus1, 1);
  491. TextDrawSetShadow(RepPlus1, 1);
  492. TextDrawUseBox(RepPlus1, 1);
  493. TextDrawBoxColor(RepPlus1, 80);
  494. TextDrawTextSize(RepPlus1, 401.000000, -30.000000);
  495.  
  496. RepPlus2 = TextDrawCreate(427.000000, 29.000000, "Respect");
  497. TextDrawBackgroundColor(RepPlus2, 255);
  498. TextDrawFont(RepPlus2, 0);
  499. TextDrawLetterSize(RepPlus2, 0.399999, 1.700000);
  500. TextDrawColor(RepPlus2, 11471359);
  501. TextDrawSetOutline(RepPlus2, 0);
  502. TextDrawSetProportional(RepPlus2, 1);
  503. TextDrawSetShadow(RepPlus2, 1);
  504.  
  505. RepPlus3 = TextDrawCreate(434.000000, 48.000000, "is");
  506. TextDrawBackgroundColor(RepPlus3, 255);
  507. TextDrawFont(RepPlus3, 2);
  508. TextDrawLetterSize(RepPlus3, 0.200000, 0.999999);
  509. TextDrawColor(RepPlus3, -1);
  510. TextDrawSetOutline(RepPlus3, 0);
  511. TextDrawSetProportional(RepPlus3, 1);
  512. TextDrawSetShadow(RepPlus3, 1);
  513.  
  514. RepMinus0 = TextDrawCreate(492.000000, 28.000000, "_");
  515. TextDrawBackgroundColor(RepMinus0, 255);
  516. TextDrawFont(RepMinus0, 1);
  517. TextDrawLetterSize(RepMinus0, 0.500000, 4.800000);
  518. TextDrawColor(RepMinus0, -1);
  519. TextDrawSetOutline(RepMinus0, 0);
  520. TextDrawSetProportional(RepMinus0, 1);
  521. TextDrawSetShadow(RepMinus0, 1);
  522. TextDrawUseBox(RepMinus0, 1);
  523. TextDrawBoxColor(RepMinus0, 80);
  524. TextDrawTextSize(RepMinus0, 400.000000, -30.000000);
  525.  
  526. RepMinus1 = TextDrawCreate(491.000000, 29.000000, "_");
  527. TextDrawBackgroundColor(RepMinus1, 255);
  528. TextDrawFont(RepMinus1, 1);
  529. TextDrawLetterSize(RepMinus1, 0.500000, 4.600000);
  530. TextDrawColor(RepMinus1, -1);
  531. TextDrawSetOutline(RepMinus1, 0);
  532. TextDrawSetProportional(RepMinus1, 1);
  533. TextDrawSetShadow(RepMinus1, 1);
  534. TextDrawUseBox(RepMinus1, 1);
  535. TextDrawBoxColor(RepMinus1, 80);
  536. TextDrawTextSize(RepMinus1, 401.000000, -30.000000);
  537.  
  538. RepMinus2 = TextDrawCreate(422.000000, 29.000000, "Disrespect");
  539. TextDrawBackgroundColor(RepMinus2, 255);
  540. TextDrawFont(RepMinus2, 0);
  541. TextDrawLetterSize(RepMinus2, 0.399999, 1.700000);
  542. TextDrawColor(RepMinus2, -1056964353);
  543. TextDrawSetOutline(RepMinus2, 0);
  544. TextDrawSetProportional(RepMinus2, 1);
  545. TextDrawSetShadow(RepMinus2, 1);
  546.  
  547. RepMinus3 = TextDrawCreate(434.000000, 48.000000, "is");
  548. TextDrawBackgroundColor(RepMinus3, 255);
  549. TextDrawFont(RepMinus3, 2);
  550. TextDrawLetterSize(RepMinus3, 0.200000, 0.999999);
  551. TextDrawColor(RepMinus3, -1);
  552. TextDrawSetOutline(RepMinus3, 0);
  553. TextDrawSetProportional(RepMinus3, 1);
  554. TextDrawSetShadow(RepMinus3, 1);
  555.  
  556. Reputation0 = TextDrawCreate(610.000000, 5.000000, "_");
  557. TextDrawBackgroundColor(Reputation0, 255);
  558. TextDrawFont(Reputation0, 1);
  559. TextDrawLetterSize(Reputation0, 0.500000, 1.600000);
  560. TextDrawColor(Reputation0, -1);
  561. TextDrawSetOutline(Reputation0, 0);
  562. TextDrawSetProportional(Reputation0, 1);
  563. TextDrawSetShadow(Reputation0, 1);
  564. TextDrawUseBox(Reputation0, 1);
  565. TextDrawBoxColor(Reputation0, 80);
  566. TextDrawTextSize(Reputation0, 496.000000, 0.000000);
  567.  
  568. Reputation1 = TextDrawCreate(609.000000, 6.000000, "_");
  569. TextDrawBackgroundColor(Reputation1, 255);
  570. TextDrawFont(Reputation1, 1);
  571. TextDrawLetterSize(Reputation1, 0.500000, 1.400000);
  572. TextDrawColor(Reputation1, -1);
  573. TextDrawSetOutline(Reputation1, 0);
  574. TextDrawSetProportional(Reputation1, 1);
  575. TextDrawSetShadow(Reputation1, 1);
  576. TextDrawUseBox(Reputation1, 1);
  577. TextDrawBoxColor(Reputation1, 50);
  578. TextDrawTextSize(Reputation1, 497.000000, 0.000000);
  579.  
  580. Reputation3 = TextDrawCreate(610.000000, 23.000000, "_");
  581. TextDrawBackgroundColor(Reputation3, 255);
  582. TextDrawFont(Reputation3, 1);
  583. TextDrawLetterSize(Reputation3, 0.500000, 0.400000);
  584. TextDrawColor(Reputation3, -1);
  585. TextDrawSetOutline(Reputation3, 0);
  586. TextDrawSetProportional(Reputation3, 1);
  587. TextDrawSetShadow(Reputation3, 1);
  588. TextDrawUseBox(Reputation3, 1);
  589. TextDrawBoxColor(Reputation3, 100);
  590. TextDrawTextSize(Reputation3, 567.000000, 0.000000);
  591.  
  592. Reputation4 = TextDrawCreate(571.000000, 21.000000, "Reputacija");
  593. TextDrawBackgroundColor(Reputation4, 255);
  594. TextDrawFont(Reputation4, 2);
  595. TextDrawLetterSize(Reputation4, 0.140000, 0.599999);
  596. TextDrawColor(Reputation4, -1);
  597. TextDrawSetOutline(Reputation4, 0);
  598. TextDrawSetProportional(Reputation4, 1);
  599. TextDrawSetShadow(Reputation4, 1);
  600.  
  601. for(new i=0;i<MAX_PLAYERS;i++)
  602. {
  603. Reputation2[i] = TextDrawCreate(502.000000, 7.000000, "");
  604. TextDrawBackgroundColor(Reputation2[i], 255);
  605. TextDrawFont(Reputation2[i], 0);
  606. TextDrawLetterSize(Reputation2[i], 0.300000, 1.200000);
  607. TextDrawColor(Reputation2[i], -5564161);
  608. TextDrawSetOutline(Reputation2[i], 0);
  609. TextDrawSetProportional(Reputation2[i], 1);
  610. TextDrawSetShadow(Reputation2[i], 1);
  611. // Stars on the rep bar.
  612.  
  613. RepPlus4[i] = TextDrawCreate(420.000000, 60.000000, "Name_Name");
  614. TextDrawBackgroundColor(RepPlus4[i], 255);
  615. TextDrawFont(RepPlus4[i], 2);
  616. TextDrawLetterSize(RepPlus4[i], 0.180000, 0.899999);
  617. TextDrawColor(RepPlus4[i], 11471359);
  618. TextDrawSetOutline(RepPlus4[i], 0);
  619. TextDrawSetProportional(RepPlus4[i], 1);
  620. TextDrawSetShadow(RepPlus4[i], 1);
  621.  
  622. RepMinus4[i] = TextDrawCreate(420.000000, 60.000000, "Name_Name");
  623. TextDrawBackgroundColor(RepMinus4[i], 255);
  624. TextDrawFont(RepMinus4[i], 2);
  625. TextDrawLetterSize(RepMinus4[i], 0.180000, 0.899999);
  626. TextDrawColor(RepMinus4[i], -1056964353);
  627. TextDrawSetOutline(RepMinus4[i], 0);
  628. TextDrawSetProportional(RepMinus4[i], 1);
  629. TextDrawSetShadow(RepMinus4[i], 1);
  630. }
  631.  
  632. }
  633.  
  634. stock RepTextdrawOn(playerid)
  635. {
  636. TextDrawShowForPlayer(playerid,Reputation0);
  637. TextDrawShowForPlayer(playerid,Reputation1);
  638. TextDrawShowForPlayer(playerid,Reputation3);
  639. TextDrawShowForPlayer(playerid,Reputation4);
  640. TextDrawShowForPlayer(playerid,Reputation2[playerid]);
  641. }
  642.  
  643. stock RepTextdrawOff(playerid)
  644. {
  645. TextDrawHideForPlayer(playerid,Reputation0);
  646. TextDrawHideForPlayer(playerid,Reputation1);
  647. TextDrawHideForPlayer(playerid,Reputation3);
  648. TextDrawHideForPlayer(playerid,Reputation4);
  649. TextDrawHideForPlayer(playerid,Reputation2[playerid]);
  650. }
  651.  
  652. stock SetRep(playerid,repedid,ammount)
  653. {
  654. TextDrawShowForPlayer(repedid,RepPlus0);
  655. TextDrawShowForPlayer(repedid,RepPlus1);
  656. TextDrawShowForPlayer(repedid,RepPlus2);
  657. TextDrawShowForPlayer(repedid,RepPlus3);
  658. TextDrawShowForPlayer(repedid,RepPlus4[repedid]);
  659. TextDrawSetString(RepPlus4[repedid],pName(playerid));
  660. pInfo[repedid][Rep] = ammount;
  661. UpdateRepBar(repedid);
  662. }
  663.  
  664. stock PlusRep(playerid,repedid)
  665. {
  666. TextDrawShowForPlayer(repedid,RepPlus0);
  667. TextDrawShowForPlayer(repedid,RepPlus1);
  668. TextDrawShowForPlayer(repedid,RepPlus2);
  669. TextDrawShowForPlayer(repedid,RepPlus3);
  670. TextDrawShowForPlayer(repedid,RepPlus4[repedid]);
  671. TextDrawSetString(RepPlus4[repedid],pName(playerid));
  672. pInfo[repedid][Rep] += 1;
  673. UpdateRepBar(repedid);
  674. }
  675.  
  676. stock MinusRep(playerid,dissid)
  677. {
  678. TextDrawShowForPlayer(dissid,RepMinus0);
  679. TextDrawShowForPlayer(dissid,RepMinus1);
  680. TextDrawShowForPlayer(dissid,RepMinus2);
  681. TextDrawShowForPlayer(dissid,RepMinus3);
  682. TextDrawShowForPlayer(dissid,RepMinus4[dissid]);
  683. TextDrawSetString(RepMinus4[dissid],pName(playerid));
  684. pInfo[dissid][Rep] -= 1;
  685. UpdateRepBar(dissid);
  686. }
  687.  
  688. stock UpdateRepBar(playerid)
  689. {
  690. if(pInfo[playerid][Rep] > -1)
  691. {
  692. TextDrawSetString(Reputation2[playerid], "]");
  693. }
  694. if(pInfo[playerid][Rep] > 9)
  695. {
  696. TextDrawSetString(Reputation2[playerid], "]");
  697. }
  698. if(pInfo[playerid][Rep] > 19)
  699. {
  700. TextDrawSetString(Reputation2[playerid], "]]");
  701. }
  702. if(pInfo[playerid][Rep] > 29)
  703. {
  704. TextDrawSetString(Reputation2[playerid], "]]]");
  705. }
  706. if(pInfo[playerid][Rep] > 39)
  707. {
  708. TextDrawSetString(Reputation2[playerid], "]]]]");
  709. }
  710. if(pInfo[playerid][Rep] > 49)
  711. {
  712. TextDrawSetString(Reputation2[playerid], "]]]]]");
  713. }
  714. if(pInfo[playerid][Rep] > 59)
  715. {
  716. TextDrawSetString(Reputation2[playerid], "]]]]]]");
  717. }
  718. if(pInfo[playerid][Rep] > 69)
  719. {
  720. TextDrawSetString(Reputation2[playerid], "]]]]]]]");
  721. }
  722. if(pInfo[playerid][Rep] > 79)
  723. {
  724. TextDrawSetString(Reputation2[playerid], "]]]]]]]]");
  725. }
  726. if(pInfo[playerid][Rep] > 89)
  727. {
  728. TextDrawSetString(Reputation2[playerid], "]]]]]]]]]");
  729. }
  730. if(pInfo[playerid][Rep] > 99)
  731. {
  732. TextDrawSetString(Reputation2[playerid], "]]]]]]]]]]");
  733. }
  734. }
  735.  
  736. forward HideTDmsg(playerid);
  737. public HideTDmsg(playerid)
  738. {
  739. TextDrawHideForPlayer(playerid,RepPlus0);
  740. TextDrawHideForPlayer(playerid,RepPlus1);
  741. TextDrawHideForPlayer(playerid,RepPlus2);
  742. TextDrawHideForPlayer(playerid,RepPlus3);
  743. TextDrawHideForPlayer(playerid,RepPlus4[playerid]);
  744.  
  745. TextDrawHideForPlayer(playerid,RepMinus0);
  746. TextDrawHideForPlayer(playerid,RepMinus1);
  747. TextDrawHideForPlayer(playerid,RepMinus2);
  748. TextDrawHideForPlayer(playerid,RepMinus3);
  749. TextDrawHideForPlayer(playerid,RepMinus4[playerid]);
  750. }
  751.  
  752. stock pName(playerid)
  753. {
  754. new PlayerName[MAX_PLAYER_NAME];
  755. GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
  756. return PlayerName;
  757. }
  758.  
  759. stock SaveRep(playerid)
  760. {
  761. new file[46];
  762. format(file, sizeof(file), "REP/%s.ini",pName(playerid));
  763. dini_IntSet(file, "REP", pInfo[playerid][Rep]);
  764. }
  765.  
  766.  
  767. /*
  768. ________________________________________________________________________________
  769.  
  770. Copyrightœ ® Dresta
  771. ________________________________________________________________________________
  772.  
  773. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement