Guest User

Untitled

a guest
Nov 14th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.90 KB | None | 0 0
  1. //============================================================================//
  2. // Simple Numar de imatriculare system with color //
  3. // Created By: Moshaki™ //
  4. //============================================================================//
  5.  
  6. #include <a_samp>
  7. #pragma tabsize 0
  8. #define COLOR_RED 0xE60000FF
  9. #define Red 5877
  10. #define Blue 5878
  11. #define Green 5879
  12. #define Yellow 5880
  13. #define Cyan 5881
  14. #define Pink 5882
  15. #define White 5883
  16. #define Black 5884
  17.  
  18. new string[128];
  19. new VehicleId;
  20. new Float:X,Float:Y,Float:Z,Float:Angle;
  21.  
  22. new Actorndi;
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n----------------------------------------------");
  27. print("* Numar de imatriculare system with color By: Moshaki *");
  28. print("* Load Succesfully *");
  29. print("----------------------------------------------\n");
  30. return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35. print("\n----------------------------------------------");
  36. print("* Numar de imatriculare system with color By: Moshaki *");
  37. print("* Unload Succesfully *");
  38. print("----------------------------------------------\n");
  39. return 1;
  40. }
  41.  
  42. public OnPlayerCommandText(playerid, cmdtext[])
  43. {
  44. if(strcmp(cmdtext, "/gotocarplate", true) == 0)
  45. {
  46. if (!IsPlayerAdmin(playerid)) return 0;
  47. SetPlayerPos(playerid, 1078.6296, 1787.4169, 10.8203);
  48. return 1;
  49. }
  50.  
  51. if (strcmp(cmdtext, "/carplate", true)==0)
  52. {
  53. if(!IsPlayerInRangeOfPoint(playerid, 1.0, 1088.4783, 1795.0315, 10.8203)) return SendClientMessage(playerid, -1, "You are not in the school of number registration to the car,type gps.");
  54. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You are not in the car!");
  55. else
  56. {
  57. ShowPlayerDialog(playerid, 5876, DIALOG_STYLE_LIST, "-=Select Color=-", "{FF0000}Red\n{00FF00}Green\n{0000FF}Blue\n{FFFF00}Yellow\n{00FFFF}Cyan\n{FF00FF}Pink\n{F0F0F0}White\n{0F0F0F}Black", "Ok", "Cancel");
  58. }
  59. return 1;
  60. }
  61. return 0;
  62. }
  63.  
  64.  
  65. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  66. {
  67. switch(dialogid)
  68. {
  69. case 5876:
  70. {
  71. if(!response)
  72. {
  73. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  74. return 1;
  75. }
  76.  
  77. switch(listitem)
  78. {
  79. case 0:
  80. {
  81. ShowPlayerDialog(playerid, Red, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  82. }
  83. case 1:
  84. {
  85. ShowPlayerDialog(playerid, Blue, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  86. }
  87. case 2:
  88. {
  89. ShowPlayerDialog(playerid, Green, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  90. }
  91. case 3:
  92. {
  93. ShowPlayerDialog(playerid, Yellow, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  94. }
  95. case 4:
  96. {
  97. ShowPlayerDialog(playerid, Cyan, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  98. }
  99. case 5:
  100. {
  101. ShowPlayerDialog(playerid, Pink, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  102. }
  103. case 6:
  104. {
  105. ShowPlayerDialog(playerid, White, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]", "Ok", "Cancel");
  106. }
  107. case 7:
  108. {
  109. ShowPlayerDialog(playerid, Black, DIALOG_STYLE_INPUT, "-=Numar de imatriculare","Enter the name [2-8 Character]", "Ok", "Cancel");
  110. }
  111. }
  112. }
  113. }
  114. if(dialogid == Red) // Text color red
  115. {
  116. if(response)
  117. {
  118. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  119. {
  120. format(string,sizeof(string),"{FF0000}%s",inputtext);
  121. VehicleId = GetPlayerVehicleID(playerid);
  122. GetPlayerPos(playerid,X,Y,Z);
  123. GetVehicleZAngle(VehicleId,Angle);
  124. SetVehicleNumberPlate(VehicleId,string);
  125. SetVehicleToRespawn(VehicleId);
  126. SetVehiclePos(VehicleId,X,Y,Z);
  127. PutPlayerInVehicle(playerid,VehicleId,0);
  128. SetVehicleZAngle(VehicleId,Angle);
  129. SetCameraBehindPlayer(playerid);
  130. GivePlayerMoney(playerid, -5000);
  131. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  132. }
  133. else
  134. {
  135. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  136. ShowPlayerDialog(playerid, Red, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  137. }
  138. }
  139. if(!response)
  140. {
  141. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  142. }
  143. }
  144. if(dialogid == Green) // Text color Green
  145. {
  146. if(response)
  147. {
  148. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  149. {
  150. format(string,sizeof(string),"{0000FF}%s",inputtext);
  151. VehicleId = GetPlayerVehicleID(playerid);
  152. GetPlayerPos(playerid,X,Y,Z);
  153. GetVehicleZAngle(VehicleId,Angle);
  154. SetVehicleNumberPlate(VehicleId,string);
  155. SetVehicleToRespawn(VehicleId);
  156. SetVehiclePos(VehicleId,X,Y,Z);
  157. PutPlayerInVehicle(playerid,VehicleId,0);
  158. SetVehicleZAngle(VehicleId,Angle);
  159. SetCameraBehindPlayer(playerid);
  160. GivePlayerMoney(playerid, -5000);
  161. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  162. }
  163. else
  164. {
  165. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  166. ShowPlayerDialog(playerid, Green, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  167. }
  168. }
  169. if(!response)
  170. {
  171. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  172. }
  173. }
  174. if(dialogid == Blue) // Text color Blue
  175. {
  176. if(response)
  177. {
  178. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  179. {
  180. format(string,sizeof(string),"{00FF00}%s",inputtext);
  181. VehicleId = GetPlayerVehicleID(playerid);
  182. GetPlayerPos(playerid,X,Y,Z);
  183. GetVehicleZAngle(VehicleId,Angle);
  184. SetVehicleNumberPlate(VehicleId,string);
  185. SetVehicleToRespawn(VehicleId);
  186. SetVehiclePos(VehicleId,X,Y,Z);
  187. PutPlayerInVehicle(playerid,VehicleId,0);
  188. SetVehicleZAngle(VehicleId,Angle);
  189. SetCameraBehindPlayer(playerid);
  190. GivePlayerMoney(playerid, -5000);
  191. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  192. }
  193. else
  194. {
  195. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  196. ShowPlayerDialog(playerid, Blue, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  197. }
  198. }
  199. if(!response)
  200. {
  201. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  202. }
  203. }
  204. if(dialogid == Yellow) // Text color Yellow
  205. {
  206. if(response)
  207. {
  208. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  209. {
  210. format(string,sizeof(string),"{FFFF00}%s",inputtext);
  211. VehicleId = GetPlayerVehicleID(playerid);
  212. GetPlayerPos(playerid,X,Y,Z);
  213. GetVehicleZAngle(VehicleId,Angle);
  214. SetVehicleNumberPlate(VehicleId,string);
  215. SetVehicleToRespawn(VehicleId);
  216. SetVehiclePos(VehicleId,X,Y,Z);
  217. PutPlayerInVehicle(playerid,VehicleId,0);
  218. SetVehicleZAngle(VehicleId,Angle);
  219. SetCameraBehindPlayer(playerid);
  220. GivePlayerMoney(playerid, -5000);
  221. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  222. }
  223. else
  224. {
  225. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  226. ShowPlayerDialog(playerid, Yellow, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  227. }
  228. }
  229. if(!response)
  230. {
  231. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  232. }
  233. }
  234. if(dialogid == Cyan) // Text color Cyan
  235. {
  236. if(response)
  237. {
  238. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  239. {
  240. format(string,sizeof(string),"{00FFFF}%s",inputtext);
  241. VehicleId = GetPlayerVehicleID(playerid);
  242. GetPlayerPos(playerid,X,Y,Z);
  243. GetVehicleZAngle(VehicleId,Angle);
  244. SetVehicleNumberPlate(VehicleId,string);
  245. SetVehicleToRespawn(VehicleId);
  246. SetVehiclePos(VehicleId,X,Y,Z);
  247. PutPlayerInVehicle(playerid,VehicleId,0);
  248. SetVehicleZAngle(VehicleId,Angle);
  249. SetCameraBehindPlayer(playerid);
  250. GivePlayerMoney(playerid, -5000);
  251. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  252. }
  253. else
  254. {
  255. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  256. ShowPlayerDialog(playerid, Cyan, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  257. }
  258. }
  259. if(!response)
  260. {
  261. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  262. }
  263. }
  264. if(dialogid == Pink) // Text color Pink
  265. {
  266. if(response)
  267. {
  268. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  269. {
  270. format(string,sizeof(string),"{FF00FF}%s",inputtext);
  271. VehicleId = GetPlayerVehicleID(playerid);
  272. GetPlayerPos(playerid,X,Y,Z);
  273. GetVehicleZAngle(VehicleId,Angle);
  274. SetVehicleNumberPlate(VehicleId,string);
  275. SetVehicleToRespawn(VehicleId);
  276. SetVehiclePos(VehicleId,X,Y,Z);
  277. PutPlayerInVehicle(playerid,VehicleId,0);
  278. SetVehicleZAngle(VehicleId,Angle);
  279. SetCameraBehindPlayer(playerid);
  280. GivePlayerMoney(playerid, -5000);
  281. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  282. }
  283. else
  284. {
  285. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  286. ShowPlayerDialog(playerid, Pink, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  287. }
  288. }
  289. if(!response)
  290. {
  291. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  292. }
  293. }
  294. if(dialogid == White) // Text color White
  295. {
  296. if(response)
  297. {
  298. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  299. {
  300. format(string,sizeof(string),"{F0F0F0}%s",inputtext);
  301. VehicleId = GetPlayerVehicleID(playerid);
  302. GetPlayerPos(playerid,X,Y,Z);
  303. GetVehicleZAngle(VehicleId,Angle);
  304. SetVehicleNumberPlate(VehicleId,string);
  305. SetVehicleToRespawn(VehicleId);
  306. SetVehiclePos(VehicleId,X,Y,Z);
  307. PutPlayerInVehicle(playerid,VehicleId,0);
  308. SetVehicleZAngle(VehicleId,Angle);
  309. SetCameraBehindPlayer(playerid);
  310. GivePlayerMoney(playerid, -5000);
  311. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  312. }
  313. else
  314. {
  315. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  316. ShowPlayerDialog(playerid, White, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  317. }
  318. }
  319. if(!response)
  320. {
  321. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  322. }
  323. }
  324. if(dialogid == Black) // Text color Black
  325. {
  326. if(response)
  327. {
  328. if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
  329. {
  330. format(string,sizeof(string),"{0F0F0F}%s",inputtext);
  331. VehicleId = GetPlayerVehicleID(playerid);
  332. GetPlayerPos(playerid,X,Y,Z);
  333. GetVehicleZAngle(VehicleId,Angle);
  334. SetVehicleNumberPlate(VehicleId,string);
  335. SetVehicleToRespawn(VehicleId);
  336. SetVehiclePos(VehicleId,X,Y,Z);
  337. PutPlayerInVehicle(playerid,VehicleId,0);
  338. SetVehicleZAngle(VehicleId,Angle);
  339. SetCameraBehindPlayer(playerid);
  340. GivePlayerMoney(playerid, -5000);
  341. SendClientMessage(playerid, 0xB6CAD1, "Ai platit $.5000 pentru numarul de imatriculare!");
  342. }
  343. else
  344. {
  345. SendClientMessage(playerid, COLOR_RED, "Error: {ffffff}You must enter 2-8 Character.");
  346. ShowPlayerDialog(playerid, Black, DIALOG_STYLE_INPUT, "-=Numar de imatriculare=-","Enter the name [2-8 Character]\n{ff0000}Error: You must enter 2-8 Character", "Ok", "Cancel");
  347. }
  348. }
  349. if(!response)
  350. {
  351. SendClientMessage(playerid, COLOR_RED, "You has canceled.");
  352. }
  353. }
  354. return 1;
  355. }
  356.  
  357. public OnGameModeInit()
  358. {
  359. CreateObject(16385, 1099.6, 1783, 9.3, 0, 0, 0); // ?????? 0
  360. CreateObject(3379, 1116, 1794.8, 9.8, 0, 0, 270); // ?????? 1
  361. CreateObject(8557, 1114.2, 1743.3, 11.3, 0, 0, 270); // ?????? 2
  362. CreateObject(3934, 1029.2, 1784.4, 9.9, 0, 0, 0); // ?????? 3
  363. CreateObject(1238, 1115, 1795.4, 10.1, 0, 0, 0); // ?????? 4
  364. CreateObject(1238, 1114.3, 1796.1, 10.1, 0, 0, 0); // ?????? 5
  365. CreateObject(1238, 1113.6, 1796.8, 10.1, 0, 0, 0); // ?????? 6
  366. CreateObject(1238, 1112.7, 1797.3, 10.1, 0, 0, 0); // ?????? 7
  367. CreateObject(1238, 1111.6, 1798, 10.1, 0, 0, 0); // ?????? 8
  368. CreateObject(1238, 1110.7, 1798.5, 10.1, 0, 0, 0); // ?????? 9
  369. CreateObject(1238, 1109.8, 1798.7, 10.1, 0, 0, 0); // ?????? 10
  370. CreateObject(988, 1097, 1794.9, 9, 0, 0, 270); // ?????? 11
  371. CreateVehicle(405, 1113, 1742.7, 10.8, 90, -1, -1, 3600); // ????????? 0
  372. CreateVehicle(405, 1112.8, 1739.4, 10.8, 90, -1, -1, 3600); // ????????? 1
  373. CreateVehicle(405, 1113, 1736.2, 10.8, 90, -1, -1, 3600); // ????????? 2
  374. CreateVehicle(426, 1113.1, 1732.7, 10.6, 90, -1, -1, 3600); // ????????? 3
  375. CreateVehicle(426, 1113.2, 1729.4, 10.6, 90, -1, -1, 3600); // ????????? 4
  376. CreateVehicle(426, 1113.2, 1725.7, 10.6, 90, -1, -1, 3600); // ????????? 5
  377. CreateVehicle(405, 1113.2, 1751.6, 10.8, 90, -1, -1, 3600); // ????????? 6
  378. Actorndi = CreateActor(240, 1089.8536, 1772.5526, 10.8203, 84.2393);
  379. ApplyActorAnimation(Actorndi, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0); // ???????? ??????
  380. Create3DTextLabel("Usage /carplate to buy a number car", 0x73AABA, 1088.4783, 1795.0315, 10.8203, 40.0, 0, 0);
  381. return 1;
  382. }
Advertisement
Add Comment
Please, Sign In to add comment