Advertisement
Guest User

0.3e Mobile TexDraw v1.1

a guest
Apr 10th, 2012
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  8.  
  9. new MobileOn[MAX_PLAYERS];//to check if mobile is On or OFF :
  10. new MobileStats[MAX_PLAYERS];//mobile stats simply , like calling.. main or whatsever
  11. new Select[MAX_PLAYERS];
  12. new NewNum[MAX_PLAYERS][8];
  13.  
  14. new Text:Mobile[19];//Mobile textdraw
  15. new Text:MobileNum[MAX_PLAYERS];//number the player is calling,
  16. new Text:MobileMain[MAX_PLAYERS];//Stats...
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. print("\n--------------------------------------");
  21. print(" Texdraws Mobile by Shabi RoxX ");
  22. print("--------------------------------------\n");
  23. //============================================
  24. // Mobile TextDraw Start #
  25. //============================================
  26. //Main BackGround With Nokai TAG
  27. Mobile[0] = TextDrawCreate(542.000000, 260.000000, "Nokia~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
  28. TextDrawAlignment(Mobile[0], 2);
  29. TextDrawBackgroundColor(Mobile[0], 255);
  30. TextDrawFont(Mobile[0], 1);
  31. TextDrawLetterSize(Mobile[0], 1.000000, 1.000000);
  32. TextDrawColor(Mobile[0], -1);
  33. TextDrawSetOutline(Mobile[0], 0);
  34. TextDrawSetProportional(Mobile[0], 1);
  35. TextDrawSetShadow(Mobile[0], 1);
  36. TextDrawUseBox(Mobile[0], 1);
  37. TextDrawBoxColor(Mobile[0], 2071823560);
  38. TextDrawTextSize(Mobile[0], 7.000000, 137.000000);
  39.  
  40. //screen texdraw
  41. Mobile[1] = TextDrawCreate(542.000000, 282.000000, "_~n~~n~~n~~n~~n~");
  42. TextDrawAlignment(Mobile[1], 2);
  43. TextDrawBackgroundColor(Mobile[1], 255);
  44. TextDrawFont(Mobile[1], 1);
  45. TextDrawLetterSize(Mobile[1], 0.500000, 1.000000);
  46. TextDrawColor(Mobile[1], -1);
  47. TextDrawSetOutline(Mobile[1], 0);
  48. TextDrawSetProportional(Mobile[1], 1);
  49. TextDrawSetShadow(Mobile[1], 1);
  50. TextDrawUseBox(Mobile[1], 1);
  51. TextDrawBoxColor(Mobile[1], -1296911672);
  52. TextDrawTextSize(Mobile[1], 467.000000, 125.000000);
  53.  
  54. //Button 1
  55. Mobile[2] = TextDrawCreate(493.000000, 361.000000, "1");
  56. TextDrawAlignment(Mobile[2], 2);
  57. TextDrawBackgroundColor(Mobile[2], 1504093896);
  58. TextDrawFont(Mobile[2], 1);
  59. TextDrawLetterSize(Mobile[2], 0.519999, 1.100000);
  60. TextDrawColor(Mobile[2], -1);
  61. TextDrawSetOutline(Mobile[2], 1);
  62. TextDrawSetProportional(Mobile[2], 1);
  63. TextDrawUseBox(Mobile[2], 1);
  64. TextDrawBoxColor(Mobile[2], 1431655880);
  65. TextDrawTextSize(Mobile[2], 25.000000, 18.000000);
  66.  
  67. //Button 2
  68. Mobile[3] = TextDrawCreate(543.000000, 364.000000, "2");
  69. TextDrawAlignment(Mobile[3], 2);
  70. TextDrawBackgroundColor(Mobile[3], 1504093896);
  71. TextDrawFont(Mobile[3], 1);
  72. TextDrawLetterSize(Mobile[3], 0.519999, 0.999999);
  73. TextDrawColor(Mobile[3], -1);
  74. TextDrawSetOutline(Mobile[3], 1);
  75. TextDrawSetProportional(Mobile[3], 1);
  76. TextDrawUseBox(Mobile[3], 1);
  77. TextDrawBoxColor(Mobile[3], 1431655880);
  78. TextDrawTextSize(Mobile[3], 25.000000, 18.000000);
  79.  
  80. //Button 3
  81. Mobile[4] = TextDrawCreate(592.000000, 362.000000, "3");
  82. TextDrawAlignment(Mobile[4], 2);
  83. TextDrawBackgroundColor(Mobile[4], 1504093896);
  84. TextDrawFont(Mobile[4], 1);
  85. TextDrawLetterSize(Mobile[4], 0.519999, 0.999999);
  86. TextDrawColor(Mobile[4], -1);
  87. TextDrawSetOutline(Mobile[4], 1);
  88. TextDrawSetProportional(Mobile[4], 1);
  89. TextDrawUseBox(Mobile[4], 1);
  90. TextDrawBoxColor(Mobile[4], 1431655880);
  91. TextDrawTextSize(Mobile[4], 25.000000, 18.000000);
  92.  
  93. //Button 5
  94. Mobile[5] = TextDrawCreate(543.000000, 385.000000, "5");
  95. TextDrawAlignment(Mobile[5], 2);
  96. TextDrawBackgroundColor(Mobile[5], 1504093896);
  97. TextDrawFont(Mobile[5], 1);
  98. TextDrawLetterSize(Mobile[5], 0.519999, 1.099999);
  99. TextDrawColor(Mobile[5], -1);
  100. TextDrawSetOutline(Mobile[5], 1);
  101. TextDrawSetProportional(Mobile[5], 1);
  102. TextDrawUseBox(Mobile[5], 1);
  103. TextDrawBoxColor(Mobile[5], 1431655880);
  104. TextDrawTextSize(Mobile[5], 25.000000, 18.000000);
  105.  
  106. //Button 4
  107. Mobile[6] = TextDrawCreate(493.000000, 382.000000, "4");
  108. TextDrawAlignment(Mobile[6], 2);
  109. TextDrawBackgroundColor(Mobile[6], 1504093896);
  110. TextDrawFont(Mobile[6], 1);
  111. TextDrawLetterSize(Mobile[6], 0.519999, 1.099999);
  112. TextDrawColor(Mobile[6], -1);
  113. TextDrawSetOutline(Mobile[6], 1);
  114. TextDrawSetProportional(Mobile[6], 1);
  115. TextDrawUseBox(Mobile[6], 1);
  116. TextDrawBoxColor(Mobile[6], 1431655880);
  117. TextDrawTextSize(Mobile[6], 25.000000, 18.000000);
  118.  
  119. //Button 6
  120. Mobile[7] = TextDrawCreate(592.000000, 382.000000, "6");
  121. TextDrawAlignment(Mobile[7], 2);
  122. TextDrawBackgroundColor(Mobile[7], 1504093896);
  123. TextDrawFont(Mobile[7], 1);
  124. TextDrawLetterSize(Mobile[7], 0.519999, 0.999999);
  125. TextDrawColor(Mobile[7], -1);
  126. TextDrawSetOutline(Mobile[7], 1);
  127. TextDrawSetProportional(Mobile[7], 1);
  128. TextDrawUseBox(Mobile[7], 1);
  129. TextDrawBoxColor(Mobile[7], 1431655880);
  130. TextDrawTextSize(Mobile[7], 25.000000, 18.000000);
  131.  
  132. //Button 8
  133. Mobile[8] = TextDrawCreate(543.000000, 406.000000, "8");
  134. TextDrawAlignment(Mobile[8], 2);
  135. TextDrawBackgroundColor(Mobile[8], 1504093896);
  136. TextDrawFont(Mobile[8], 1);
  137. TextDrawLetterSize(Mobile[8], 0.519999, 1.199999);
  138. TextDrawColor(Mobile[8], -1);
  139. TextDrawSetOutline(Mobile[8], 1);
  140. TextDrawSetProportional(Mobile[8], 1);
  141. TextDrawUseBox(Mobile[8], 1);
  142. TextDrawBoxColor(Mobile[8], 1431655880);
  143. TextDrawTextSize(Mobile[8], 25.000000, 18.000000);
  144.  
  145. //Button 7
  146. Mobile[9] = TextDrawCreate(493.000000, 403.000000, "7");
  147. TextDrawAlignment(Mobile[9], 2);
  148. TextDrawBackgroundColor(Mobile[9], 1504093896);
  149. TextDrawFont(Mobile[9], 1);
  150. TextDrawLetterSize(Mobile[9], 0.519999, 1.199999);
  151. TextDrawColor(Mobile[9], -1);
  152. TextDrawSetOutline(Mobile[9], 1);
  153. TextDrawSetProportional(Mobile[9], 1);
  154. TextDrawUseBox(Mobile[9], 1);
  155. TextDrawBoxColor(Mobile[9], 1431655880);
  156. TextDrawTextSize(Mobile[9], 25.000000, 18.000000);
  157.  
  158. Mobile[10] = TextDrawCreate(592.000000, 403.000000, "9");
  159. TextDrawAlignment(Mobile[10], 2);
  160. TextDrawBackgroundColor(Mobile[10], 1504093896);
  161. TextDrawFont(Mobile[10], 1);
  162. TextDrawLetterSize(Mobile[10], 0.519999, 1.299999);
  163. TextDrawColor(Mobile[10], -1);
  164. TextDrawSetOutline(Mobile[10], 1);
  165. TextDrawSetProportional(Mobile[10], 1);
  166. TextDrawUseBox(Mobile[10], 1);
  167. TextDrawBoxColor(Mobile[10], 1431655880);
  168. TextDrawTextSize(Mobile[10], 25.000000, 18.000000);
  169.  
  170.  
  171. //UnDial Botton (Red)
  172. Mobile[11] = TextDrawCreate(589.000000, 342.000000, "=");
  173. TextDrawAlignment(Mobile[11], 2);
  174. TextDrawBackgroundColor(Mobile[11], 255);
  175. TextDrawFont(Mobile[11], 3);
  176. TextDrawLetterSize(Mobile[11], 0.519999, 0.4);
  177. TextDrawColor(Mobile[11], -16776961);
  178. TextDrawSetOutline(Mobile[11], 0);
  179. TextDrawSetProportional(Mobile[11], 1);
  180. TextDrawSetShadow(Mobile[11], 1);
  181. TextDrawUseBox(Mobile[11], 1);
  182. TextDrawBoxColor(Mobile[11], 1566399944);
  183. TextDrawTextSize(Mobile[11], 25.000000, 15.000000);
  184.  
  185. //Main Menu Button
  186. Mobile[12] = TextDrawCreate(542.000000, 342.000000, "+");
  187. TextDrawAlignment(Mobile[12], 2);
  188. TextDrawBackgroundColor(Mobile[12], 255);
  189. TextDrawFont(Mobile[12], 3);
  190. TextDrawLetterSize(Mobile[12], 0.519999, 0.4);
  191. TextDrawColor(Mobile[12], -1);
  192. TextDrawSetOutline(Mobile[12], 1);
  193. TextDrawSetProportional(Mobile[12], 1);
  194. TextDrawUseBox(Mobile[12], 1);
  195. TextDrawBoxColor(Mobile[12], 1566399944);
  196. TextDrawTextSize(Mobile[12], 25.000000, 15.000000);
  197.  
  198. //Dail Button (Green)
  199. Mobile[13] = TextDrawCreate(494.000000, 342.000000, "=");
  200. TextDrawAlignment(Mobile[13], 2);
  201. TextDrawBackgroundColor(Mobile[13], 255);
  202. TextDrawFont(Mobile[13], 3);
  203. TextDrawLetterSize(Mobile[13], 0.519999, 0.4);
  204. TextDrawColor(Mobile[13], 16711935);
  205. TextDrawSetOutline(Mobile[13], 0);
  206. TextDrawSetProportional(Mobile[13], 1);
  207. TextDrawSetShadow(Mobile[13], 1);
  208. TextDrawUseBox(Mobile[13], 1);
  209. TextDrawBoxColor(Mobile[13], 1566399944);
  210. TextDrawTextSize(Mobile[13], 25.000000, 15.000000);
  211.  
  212. //TurnoFF BUTTON
  213. Mobile[14] = TextDrawCreate(600.000000, 264.000000, "=");
  214. TextDrawAlignment(Mobile[14], 2);
  215. TextDrawBackgroundColor(Mobile[14], 255);
  216. TextDrawFont(Mobile[14], 3);
  217. TextDrawLetterSize(Mobile[14], 0.519999, 0.699998);
  218. TextDrawColor(Mobile[14], -16776961);
  219. TextDrawSetOutline(Mobile[14], 0);
  220. TextDrawSetProportional(Mobile[14], 1);
  221. TextDrawSetShadow(Mobile[14], 1);
  222. TextDrawUseBox(Mobile[14], 1);
  223. TextDrawBoxColor(Mobile[14], 1566399944);
  224. TextDrawTextSize(Mobile[14], 33.000000, 9.000000);
  225.  
  226. //Button 0
  227. Mobile[15] = TextDrawCreate(543.000000, 428.000000, "0");
  228. TextDrawAlignment(Mobile[15], 2);
  229. TextDrawBackgroundColor(Mobile[15], 1504093896);
  230. TextDrawFont(Mobile[15], 1);
  231. TextDrawLetterSize(Mobile[15], 0.519999, 1.199999);
  232. TextDrawColor(Mobile[15], -1);
  233. TextDrawSetOutline(Mobile[15], 1);
  234. TextDrawSetProportional(Mobile[15], 1);
  235. TextDrawUseBox(Mobile[15], 1);
  236. TextDrawBoxColor(Mobile[15], 1431655880);
  237. TextDrawTextSize(Mobile[15], 25.000000, 18.000000);
  238.  
  239. //Button #
  240. Mobile[16] = TextDrawCreate(493.000000, 425.000000, "#");
  241. TextDrawAlignment(Mobile[16], 2);
  242. TextDrawBackgroundColor(Mobile[16], 1504093896);
  243. TextDrawFont(Mobile[16], 1);
  244. TextDrawLetterSize(Mobile[16], 0.519999, 1.199999);
  245. TextDrawColor(Mobile[16], -1);
  246. TextDrawSetOutline(Mobile[16], 1);
  247. TextDrawSetProportional(Mobile[16], 1);
  248. TextDrawUseBox(Mobile[16], 1);
  249. TextDrawBoxColor(Mobile[16], 1431655880);
  250. TextDrawTextSize(Mobile[16], 25.000000, 18.000000);
  251.  
  252. //Button +
  253. Mobile[17] = TextDrawCreate(592.000000, 425.000000, "+");
  254. TextDrawAlignment(Mobile[17], 2);
  255. TextDrawBackgroundColor(Mobile[17], 1504093896);
  256. TextDrawFont(Mobile[17], 1);
  257. TextDrawLetterSize(Mobile[17], 0.519999, 1.299999);
  258. TextDrawColor(Mobile[17], -1);
  259. TextDrawSetOutline(Mobile[17], 1);
  260. TextDrawSetProportional(Mobile[17], 1);
  261. TextDrawUseBox(Mobile[17], 1);
  262. TextDrawBoxColor(Mobile[17], 1431655880);
  263. TextDrawTextSize(Mobile[17], 25.000000, 18.000000);
  264.  
  265. for(new i = 2;i < 18;i++)
  266. {
  267. TextDrawSetSelectable(Mobile[i], true);
  268. }
  269.  
  270. Mobile[18] = TextDrawCreate(562.000000, 280.000000, "Time");
  271. TextDrawBackgroundColor(Mobile[18], 255);
  272. TextDrawFont(Mobile[18], 1);
  273. TextDrawLetterSize(Mobile[18], 0.500000, 1.000000);
  274. TextDrawColor(Mobile[18], -1);
  275. TextDrawSetOutline(Mobile[18], 0);
  276. TextDrawSetProportional(Mobile[18], 1);
  277. TextDrawSetShadow(Mobile[18], 1);
  278.  
  279. for(new i = 0;i < MAX_PLAYERS;i++)
  280. {
  281.  
  282. MobileMain[i] = TextDrawCreate(490.000000, 296.000000, "_");
  283. TextDrawBackgroundColor(MobileMain[i], 255);
  284. TextDrawFont(MobileMain[i], 2);
  285. TextDrawLetterSize(MobileMain[i], 0.369999, 1.199999);
  286. TextDrawColor(MobileMain[i], 16711935);
  287. TextDrawSetOutline(MobileMain[i], 0);
  288. TextDrawSetProportional(MobileMain[i], 1);
  289. TextDrawSetShadow(MobileMain[i], 1);
  290.  
  291. MobileNum[i] = TextDrawCreate(492.000000, 313.000000, "_");
  292. TextDrawBackgroundColor(MobileNum[i], 255);
  293. TextDrawFont(MobileNum[i], 1);
  294. TextDrawLetterSize(MobileNum[i], 0.500000, 1.000000);
  295. TextDrawColor(MobileNum[i], 1721338568);
  296. TextDrawSetOutline(MobileNum[i], 0);
  297. TextDrawSetProportional(MobileNum[i], 1);
  298. TextDrawSetShadow(MobileNum[i], 1);
  299. }
  300. //============================================
  301. // Mobile TextDraw End #
  302. //============================================
  303. return 1;
  304. }
  305.  
  306.  
  307. public OnGameModeExit()
  308. {
  309. return 1;
  310. }
  311.  
  312.  
  313.  
  314. CMD:mobile(playerid,params[])
  315. {
  316. if(MobileOn[playerid] != 1)//Mobile not ON
  317. {
  318. new String[24],hour,mins,secs;
  319. MobileOn[playerid] = 1;
  320. MobileStats[playerid] = 1;
  321. gettime(hour,mins,secs);
  322. format(String,sizeof(String),"%d:%d",hour,mins);
  323. TextDrawSetString(Mobile[18],String);
  324. for(new i = 0;i < 18;i++)
  325. {
  326. TextDrawShowForPlayer(playerid,Mobile[i]);
  327. }
  328. TextDrawShowForPlayer(playerid,MobileMain[playerid]);
  329. TextDrawShowForPlayer(playerid,MobileNum[playerid]);
  330. SelectTextDraw(playerid, 0x22A5DDC8);
  331. }
  332. else if(MobileOn[playerid] == 1 && Select[playerid] == -1)
  333. {
  334. Select[playerid] = 1;
  335. SelectTextDraw(playerid, 0x22A5DDC8);
  336. }
  337. else if(MobileOn[playerid] == 1 && Select[playerid] != -1)
  338. {
  339. MobileOn[playerid] = 0;
  340. MobileStats[playerid] = 1;
  341. for(new i = 0;i < 19;i++)
  342. {
  343. TextDrawHideForPlayer(playerid,Mobile[i]);
  344. }
  345. TextDrawHideForPlayer(playerid,MobileMain[playerid]);
  346. TextDrawHideForPlayer(playerid,MobileNum[playerid]);
  347. TextDrawSetString(MobileNum[playerid],"_");
  348. CancelSelectTextDraw(playerid);
  349. }
  350. return 1;
  351. }
  352.  
  353. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  354. {
  355. for(new i = 2;i <= 17;i++)
  356. {
  357. if(clickedid == Mobile[i])
  358. {
  359. switch(i)
  360. {
  361. //number response
  362. case 2:format(NewNum[playerid],10,"%s1",NewNum[playerid]);
  363. case 3:format(NewNum[playerid],10,"%s2",NewNum[playerid]);
  364. case 4:format(NewNum[playerid],10,"%s3",NewNum[playerid]);
  365. case 5:format(NewNum[playerid],10,"%s5",NewNum[playerid]);
  366. case 6:format(NewNum[playerid],10,"%s4",NewNum[playerid]);
  367. case 7:format(NewNum[playerid],10,"%s6",NewNum[playerid]);
  368. case 8:format(NewNum[playerid],10,"%s8",NewNum[playerid]);
  369. case 9:format(NewNum[playerid],10,"%s7",NewNum[playerid]);
  370. case 10:format(NewNum[playerid],10,"%s9",NewNum[playerid]);
  371. case 15:format(NewNum[playerid],10,"%s0",NewNum[playerid]);
  372. case 16:format(NewNum[playerid],10,"%s#",NewNum[playerid]);
  373. case 17:format(NewNum[playerid],10,"%s+",NewNum[playerid]);
  374. }
  375. if(MobileStats[playerid] == 1 && strlen(NewNum[playerid]) < 10)
  376. {
  377. TextDrawSetString(MobileNum[playerid],NewNum[playerid]);
  378. PlayerPlaySound(playerid, 21001, 0, 0, 0);
  379. break;
  380. }
  381. }
  382. }
  383. //Green Button
  384. if(clickedid == Mobile[13])
  385. {
  386. if(MobileStats[playerid] == 1 && !isnull(NewNum[playerid]))
  387. {
  388. MobileStats[playerid] = 2;
  389. TextDrawSetString(MobileMain[playerid],"Calling");
  390. PlayerPlaySound(playerid, 21002, 0, 0, 0);
  391. }
  392. }
  393. if(clickedid == Mobile[11])
  394. {
  395. if(MobileStats[playerid] == 2 || MobileStats[playerid] == 1 && !isnull(NewNum[playerid]))
  396. {
  397. MobileStats[playerid] = 1;
  398. NewNum[playerid] = "";
  399. TextDrawSetString(MobileNum[playerid],"_");
  400. TextDrawSetString(MobileMain[playerid],"_");
  401. PlayerPlaySound(playerid, 21002, 0, 0, 0);
  402. }
  403. }
  404. //Off button
  405. if(clickedid == Mobile[14])
  406. {
  407. Select[playerid] = -1;
  408. CancelSelectTextDraw(playerid);
  409. }
  410.  
  411. return 1;
  412. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement