Guest User

Color Dialog

a guest
Jun 19th, 2011
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 KB | None | 0 0
  1. ////////////////// //////////////////////////
  2. ///////////////// Colors //////////////////
  3. ///////////////// ///////////////
  4. // uncomment the line below if you want to write a filterscript
  5. //#define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" Color Dialog");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23.  
  24. #else
  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_BLUE 0x0000BBAA
  31. #define COLOR_LIGHTBLUE 0x33CCFFAA
  32. #define COLOR_ORANGE 0xFF9900AA
  33. #define COLOR_RED 0xAA3333AA
  34. #define COLOR_LIME 0x10F441AA
  35. #define COLOR_MAGENTA 0xFF00FFFF
  36. #define COLOR_NAVY 0x000080AA
  37. #define COLOR_AQUA 0xF0F8FFAA
  38. #define COLOR_CRIMSON 0xDC143CAA
  39. #define COLOR_FLBLUE 0x6495EDAA
  40. #define COLOR_BISQUE 0xFFE4C4AA
  41. #define COLOR_BLACK 0x000000AA
  42. #define COLOR_CHARTREUSE 0x7FFF00AA
  43. #define COLOR_BROWN 0XA52A2AAA
  44. #define COLOR_CORAL 0xFF7F50AA
  45. #define COLOR_GOLD 0xB8860BAA
  46. #define COLOR_GREENYELLOW 0xADFF2FAA
  47. #define COLOR_INDIGO 0x4B00B0AA
  48. #define COLOR_IVORY 0xFFFF82AA
  49. #define COLOR_LAWNGREEN 0x7CFC00AA
  50. #define COLOR_SEAGREEN 0x20B2AAAA
  51. #define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
  52. #define COLOR_MIDNIGHTBLUE 0X191970AA
  53. #define COLOR_MAROON 0x800000AA
  54. #define COLOR_OLIVE 0x808000AA
  55. #define COLOR_ORANGERED 0xFF4500AA
  56. #define COLOR_PINK 0xFFC0CBAA // - Light light pink
  57. #define COLOR_SEAGREEN 0x2E8B57AA
  58. #define COLOR_SPRINGGREEN 0x00FF7FAA
  59. #define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
  60. #define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
  61. #define COLOR_MEDIUMAQUA 0x83BFBFAA
  62. #define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
  63.  
  64. main()
  65. {
  66. print("\n----------------------------------");
  67. print(" Blank Gamemode by your name here");
  68. print("----------------------------------\n");
  69. }
  70.  
  71. #endif
  72.  
  73. public OnGameModeInit()
  74. {
  75. // Don't use these lines if it's a filterscript
  76. SetGameModeText("Blank Script");
  77. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  78. return 1;
  79. }
  80.  
  81. public OnGameModeExit()
  82. {
  83. return 1;
  84. }
  85.  
  86. public OnPlayerRequestClass(playerid, classid)
  87. {
  88. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  89. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  90. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  91. return 1;
  92. }
  93.  
  94. public OnPlayerConnect(playerid)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerDisconnect(playerid, reason)
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerSpawn(playerid)
  105. {
  106. return 1;
  107. }
  108.  
  109. public OnPlayerDeath(playerid, killerid, reason)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnVehicleSpawn(vehicleid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnVehicleDeath(vehicleid, killerid)
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerText(playerid, text[])
  125. {
  126. return 1;
  127. }
  128.  
  129. public OnPlayerCommandText(playerid, cmdtext[])
  130. {
  131. if (strcmp("/colors", cmdtext, true, 10) == 0)
  132. {
  133. ShowPlayerDialog(playerid,8,DIALOG_STYLE_LIST,"COLORS","Blue\nRed\nYellow\nLightBlue\nGreen\nBlack\nGold","ColorChange", "Nah");
  134. return 1;
  135. }
  136. return 0;
  137. }
  138.  
  139. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  140. {
  141. return 1;
  142. }
  143.  
  144. public OnPlayerExitVehicle(playerid, vehicleid)
  145. {
  146. return 1;
  147. }
  148.  
  149. public OnPlayerStateChange(playerid, newstate, oldstate)
  150. {
  151. return 1;
  152. }
  153.  
  154. public OnPlayerEnterCheckpoint(playerid)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerLeaveCheckpoint(playerid)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerEnterRaceCheckpoint(playerid)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerLeaveRaceCheckpoint(playerid)
  170. {
  171. return 1;
  172. }
  173.  
  174. public OnRconCommand(cmd[])
  175. {
  176. return 1;
  177. }
  178.  
  179. public OnPlayerRequestSpawn(playerid)
  180. {
  181. return 1;
  182. }
  183.  
  184. public OnObjectMoved(objectid)
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnPlayerObjectMoved(playerid, objectid)
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerPickUpPickup(playerid, pickupid)
  195. {
  196. return 1;
  197. }
  198.  
  199. public OnVehicleMod(playerid, vehicleid, componentid)
  200. {
  201. return 1;
  202. }
  203.  
  204. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  205. {
  206. return 1;
  207. }
  208.  
  209. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  210. {
  211. return 1;
  212. }
  213.  
  214. public OnPlayerSelectedMenuRow(playerid, row)
  215. {
  216. return 1;
  217. }
  218.  
  219. public OnPlayerExitedMenu(playerid)
  220. {
  221. return 1;
  222. }
  223.  
  224. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  225. {
  226. return 1;
  227. }
  228.  
  229. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  230. {
  231. return 1;
  232. }
  233.  
  234. public OnRconLoginAttempt(ip[], password[], success)
  235. {
  236. return 1;
  237. }
  238.  
  239. public OnPlayerUpdate(playerid)
  240. {
  241. return 1;
  242. }
  243.  
  244. public OnPlayerStreamIn(playerid, forplayerid)
  245. {
  246. return 1;
  247. }
  248.  
  249. public OnPlayerStreamOut(playerid, forplayerid)
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnVehicleStreamIn(vehicleid, forplayerid)
  255. {
  256. return 1;
  257. }
  258.  
  259. public OnVehicleStreamOut(vehicleid, forplayerid)
  260. {
  261. return 1;
  262. }
  263.  
  264. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  265. {
  266. switch(dialogid) // Lookup the dialogid
  267. {
  268. case 7:
  269. {
  270. if(!response)
  271. {
  272. SendClientMessage(playerid, 0xFF0000FF, "No");
  273. return 1; // We processed it
  274. }
  275.  
  276. switch(listitem) // This is far more efficient than using an if-elseif-else structure
  277. {
  278. case 0: // Listitems start with 0, not 1
  279. {
  280. SetPlayerColor(playerid,COLOR_BLUE);
  281. SendClientMessage(playerid,COLOR_BLUE,"new Color");
  282. }
  283. case 1:
  284. {
  285. SetPlayerColor(playerid,COLOR_RED);
  286. SendClientMessage(playerid,COLOR_RED,"new Color");
  287. }
  288. case 2:
  289. {
  290. SetPlayerColor(playerid,COLOR_YELLOW);
  291. SendClientMessage(playerid,COLOR_YELLOW,"new Color");
  292. }
  293. case 3:
  294. {
  295. SetPlayerColor(playerid,COLOR_LIGHTBLUE);
  296. SendClientMessage(playerid,COLOR_LIGHTBLUE,"new Color");
  297. }
  298. case 4:
  299. {
  300. SetPlayerColor(playerid,COLOR_GREEN);
  301. SendClientMessage(playerid,COLOR_GREEN,"new Color");
  302. }
  303. case 5:
  304. {
  305. SetPlayerColor(playerid,COLOR_BLACK);
  306. SendClientMessage(playerid,COLOR_BLACK,"new Color");
  307. }
  308. case 6:
  309. {
  310. SetPlayerColor(playerid,COLOR_GOLD);
  311. SendClientMessage(playerid,COLOR_GOLD,"new Color");
  312. }
  313. // Add the rest of your listitems for dialog 1 here
  314.  
  315. }
  316.  
  317. }
  318. // Add the rest of your dialogs here
  319.  
  320. }
  321. return 1;
  322. }
  323.  
  324. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  325. {
  326. return 1;
  327. }
Advertisement
Add Comment
Please, Sign In to add comment