Guest User

Simple Msg Box By V_LOPE

a guest
Jul 31st, 2012
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.52 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. //===================================================================//
  3. #include <a_samp>
  4. #include <zcmd>
  5. //=====================================================================//
  6. new Text:Textdraw0;
  7. new Text:Textdraw1;
  8. new Text:Textdraw2;
  9. new Text:Textdraw3;
  10. new Text:Textdraw4;
  11. new Text:Textdraw5;
  12. new Text:Textdraw6;
  13. new Text:Textdraw7;
  14. new Text:Textdraw8;
  15. new Text:Textdraw9;
  16. new Text:Textdraw10;
  17. new CurrentMsg = 0;
  18. //===================================================================//
  19. #define COLOR_RED 0xFF0000FF
  20. #define COLOR_GREEN 0x33FF33AA
  21. #pragma tabsize 0
  22. //====================================================================//
  23.  
  24. #if defined FILTERSCRIPT
  25.  
  26. public OnFilterScriptInit()
  27. {
  28. print("\n==============LOADING===============");
  29. print("--------------------------------------\n");
  30. print("Simple message box by V_LOPE loaded");
  31. print("--------------------------------------\n");
  32. print("\n==============LOAD-DONE===============");
  33. //======================================================//
  34. Textdraw0 = TextDrawCreate(423.000000, 439.000000, "-");
  35. TextDrawBackgroundColor(Textdraw0, 255);
  36. TextDrawFont(Textdraw0, 1);
  37. TextDrawLetterSize(Textdraw0, 0.170000, 0.699998);
  38. TextDrawColor(Textdraw0, -1);
  39. TextDrawSetOutline(Textdraw0, 1);
  40. TextDrawSetProportional(Textdraw0, 1);
  41. TextDrawUseBox(Textdraw0, 1);
  42. TextDrawBoxColor(Textdraw0, 0x2C272755);
  43. TextDrawTextSize(Textdraw0, 651.000000, -60.000000);
  44.  
  45. Textdraw1 = TextDrawCreate(423.000000, 432.000000, "-");
  46. TextDrawBackgroundColor(Textdraw1, 255);
  47. TextDrawFont(Textdraw1, 1);
  48. TextDrawLetterSize(Textdraw1, 0.170000, 0.699998);
  49. TextDrawColor(Textdraw1, -1);
  50. TextDrawSetOutline(Textdraw1, 1);
  51. TextDrawSetProportional(Textdraw1, 1);
  52. TextDrawUseBox(Textdraw1, 1);
  53. TextDrawBoxColor(Textdraw1, 0x2C272755);
  54. TextDrawTextSize(Textdraw1, 651.000000, -60.000000);
  55.  
  56. Textdraw2 = TextDrawCreate(423.000000, 425.000000, "-");
  57. TextDrawBackgroundColor(Textdraw2, 255);
  58. TextDrawFont(Textdraw2, 1);
  59. TextDrawLetterSize(Textdraw2, 0.170000, 0.699998);
  60. TextDrawColor(Textdraw2, -1);
  61. TextDrawSetOutline(Textdraw2, 1);
  62. TextDrawSetProportional(Textdraw2, 1);
  63. TextDrawUseBox(Textdraw2, 1);
  64. TextDrawBoxColor(Textdraw2, 0x2C272755);
  65. TextDrawTextSize(Textdraw2, 651.000000, -60.000000);
  66.  
  67. Textdraw3 = TextDrawCreate(423.000000, 418.000000, "-");
  68. TextDrawBackgroundColor(Textdraw3, 255);
  69. TextDrawFont(Textdraw3, 1);
  70. TextDrawLetterSize(Textdraw3, 0.170000, 0.699998);
  71. TextDrawColor(Textdraw3, -1);
  72. TextDrawSetOutline(Textdraw3, 1);
  73. TextDrawSetProportional(Textdraw3, 1);
  74. TextDrawUseBox(Textdraw3, 1);
  75. TextDrawBoxColor(Textdraw3, 0x2C272755);
  76. TextDrawTextSize(Textdraw3, 651.000000, -60.000000);
  77.  
  78. Textdraw4 = TextDrawCreate(423.000000, 411.000000, "-");
  79. TextDrawBackgroundColor(Textdraw4, 255);
  80. TextDrawFont(Textdraw4, 1);
  81. TextDrawLetterSize(Textdraw4, 0.170000, 0.699998);
  82. TextDrawColor(Textdraw4, -1);
  83. TextDrawSetOutline(Textdraw4, 1);
  84. TextDrawSetProportional(Textdraw4, 1);
  85. TextDrawUseBox(Textdraw4, 1);
  86. TextDrawBoxColor(Textdraw4, 0x2C272755);
  87. TextDrawTextSize(Textdraw4, 651.000000, -60.000000);
  88.  
  89. Textdraw5 = TextDrawCreate(423.000000, 404.000000, "-");
  90. TextDrawBackgroundColor(Textdraw5, 255);
  91. TextDrawFont(Textdraw5, 1);
  92. TextDrawLetterSize(Textdraw5, 0.170000, 0.699998);
  93. TextDrawColor(Textdraw5, -1);
  94. TextDrawSetOutline(Textdraw5, 1);
  95. TextDrawSetProportional(Textdraw5, 1);
  96. TextDrawUseBox(Textdraw5, 1);
  97. TextDrawBoxColor(Textdraw5, 0x2C272755);
  98. TextDrawTextSize(Textdraw5, 651.000000, -60.000000);
  99.  
  100. Textdraw6 = TextDrawCreate(423.000000, 397.000000, "-");
  101. TextDrawBackgroundColor(Textdraw6, 255);
  102. TextDrawFont(Textdraw6, 1);
  103. TextDrawLetterSize(Textdraw6, 0.170000, 0.699998);
  104. TextDrawColor(Textdraw6, -1);
  105. TextDrawSetOutline(Textdraw6, 1);
  106. TextDrawSetProportional(Textdraw6, 1);
  107. TextDrawUseBox(Textdraw6, 1);
  108. TextDrawBoxColor(Textdraw6, 0x2C272755);
  109. TextDrawTextSize(Textdraw6, 651.000000, -60.000000);
  110.  
  111. Textdraw7 = TextDrawCreate(423.000000, 390.000000, "-");
  112. TextDrawBackgroundColor(Textdraw7, 255);
  113. TextDrawFont(Textdraw7, 1);
  114. TextDrawLetterSize(Textdraw7, 0.170000, 0.699998);
  115. TextDrawColor(Textdraw7, -1);
  116. TextDrawSetOutline(Textdraw7, 1);
  117. TextDrawSetProportional(Textdraw7, 1);
  118. TextDrawUseBox(Textdraw7, 1);
  119. TextDrawBoxColor(Textdraw7, 0x2C272755);
  120. TextDrawTextSize(Textdraw7, 651.000000, -60.000000);
  121.  
  122. Textdraw8 = TextDrawCreate(423.000000, 383.000000, "-");
  123. TextDrawBackgroundColor(Textdraw8, 255);
  124. TextDrawFont(Textdraw8, 1);
  125. TextDrawLetterSize(Textdraw8, 0.170000, 0.699998);
  126. TextDrawColor(Textdraw8, -1);
  127. TextDrawSetOutline(Textdraw8, 1);
  128. TextDrawSetProportional(Textdraw8, 1);
  129. TextDrawUseBox(Textdraw8, 1);
  130. TextDrawBoxColor(Textdraw8, 0x2C272755);
  131. TextDrawTextSize(Textdraw8, 651.000000, -60.000000);
  132.  
  133. Textdraw9 = TextDrawCreate(423.000000, 376.000000, "-");
  134. TextDrawBackgroundColor(Textdraw9, 255);
  135. TextDrawFont(Textdraw9, 1);
  136. TextDrawLetterSize(Textdraw9, 0.170000, 0.699998);
  137. TextDrawColor(Textdraw9, -1);
  138. TextDrawSetOutline(Textdraw9, 1);
  139. TextDrawSetProportional(Textdraw9, 1);
  140. TextDrawUseBox(Textdraw9, 1);
  141. TextDrawBoxColor(Textdraw9, 0x2C272755);
  142. TextDrawTextSize(Textdraw9, 651.000000, -60.000000);
  143.  
  144. Textdraw10 = TextDrawCreate(423.000000, 369.000000, "-");
  145. TextDrawBackgroundColor(Textdraw10, 255);
  146. TextDrawFont(Textdraw10, 1);
  147. TextDrawLetterSize(Textdraw10, 0.170000, 0.699998);
  148. TextDrawColor(Textdraw10, -1);
  149. TextDrawSetOutline(Textdraw10, 1);
  150. TextDrawSetProportional(Textdraw10, 1);
  151. TextDrawUseBox(Textdraw10, 1);
  152. TextDrawBoxColor(Textdraw10, 0x2C272755);
  153. TextDrawTextSize(Textdraw10, 651.000000, -60.000000);
  154. return 1;
  155. }
  156.  
  157. public OnFilterScriptExit()
  158. {
  159. TextDrawDestroy(Textdraw0);
  160. TextDrawDestroy(Textdraw1);
  161. TextDrawDestroy(Textdraw2);
  162. TextDrawDestroy(Textdraw3);
  163. TextDrawDestroy(Textdraw4);
  164. TextDrawDestroy(Textdraw5);
  165. TextDrawDestroy(Textdraw6);
  166. TextDrawDestroy(Textdraw7);
  167. TextDrawDestroy(Textdraw8);
  168. TextDrawDestroy(Textdraw9);
  169. TextDrawDestroy(Textdraw10);
  170. return 1;
  171. }
  172.  
  173. #else
  174.  
  175. main()
  176. {
  177. print("\n----------------------------------");
  178. print(" Blank Gamemode by your name here");
  179. print("----------------------------------\n");
  180. }
  181.  
  182. #endif
  183.  
  184. public OnGameModeInit()
  185. {
  186. return 1;
  187. }
  188.  
  189. public OnGameModeExit()
  190. {
  191. return 1;
  192. }
  193.  
  194. public OnPlayerConnect(playerid)
  195. {
  196. new name[24],string[128];
  197. GetPlayerName(playerid,name,sizeof(name));
  198. format(string,sizeof string,"%s has ~g~joined ~w~the server",name);
  199. SendBoxMsg(string);
  200. return 1;
  201. }
  202.  
  203. public OnPlayerDisconnect(playerid, reason)
  204. {
  205. new name[24]; GetPlayerName(playerid,name,sizeof(name));
  206. new string[128];
  207. switch(reason)
  208. {
  209. case 0: format(string,sizeof string,"%s has ~r~left ~w~the server. ~r~(Timed out)",name);
  210. case 1: format(string,sizeof string,"%s has ~r~left ~w~the server. ~r~(Leaving)",name);
  211. case 2: format(string,sizeof string,"%s has ~r~left ~w~the server. ~r~(Kicked/Banned)",name);
  212. }
  213. SendBoxMsg(string);
  214. return 1;
  215. }
  216.  
  217. public OnPlayerDeath(playerid, killerid, reason)
  218. {
  219. new name[24],kname[24],string[128];
  220. GetPlayerName(playerid,name,sizeof(name)); GetPlayerName(killerid,kname,sizeof(kname));
  221. format(string,sizeof string,"%s has ~r~killed ~w~%s",kname,name);
  222. SendBoxMsg(string);
  223. return 1;
  224. }
  225.  
  226. CMD:clearbox(playerid)
  227. {
  228. if(IsPlayerAdmin(playerid))
  229. {
  230. TextDrawShowForAll(Textdraw0);
  231. TextDrawShowForAll(Textdraw1);
  232. TextDrawShowForAll(Textdraw2);
  233. TextDrawShowForAll(Textdraw3);
  234. TextDrawShowForAll(Textdraw4);
  235. TextDrawShowForAll(Textdraw5);
  236. TextDrawShowForAll(Textdraw6);
  237. TextDrawShowForAll(Textdraw7);
  238. TextDrawShowForAll(Textdraw8);
  239. TextDrawShowForAll(Textdraw9);
  240. TextDrawShowForAll(Textdraw10);
  241. TextDrawSetString(Textdraw0,"-");
  242. TextDrawSetString(Textdraw1,"-");
  243. TextDrawSetString(Textdraw2,"-");
  244. TextDrawSetString(Textdraw3,"-");
  245. TextDrawSetString(Textdraw4,"-");
  246. TextDrawSetString(Textdraw5,"-");
  247. TextDrawSetString(Textdraw6,"-");
  248. TextDrawSetString(Textdraw7,"-");
  249. TextDrawSetString(Textdraw8,"-");
  250. TextDrawSetString(Textdraw9,"-");
  251. TextDrawSetString(Textdraw10,"-");
  252. CurrentMsg = 0;
  253. } else return SendClientMessage(playerid,COLOR_RED,"Only RCONS admins can use this cmd");
  254. return 1;
  255. }
  256.  
  257. CMD:boxchat(playerid,params[])
  258. {
  259. if(isnull(params)) return SendClientMessage(playerid,COLOR_RED,"Current Usage: /boxchat [text]");
  260. SendClientMessage(playerid,COLOR_GREEN,"Message Sended!");
  261. new string[128],name[24];
  262. GetPlayerName(playerid,name,sizeof(name));
  263. format(string,sizeof(string),"%s[%i]: %s",name,playerid,params);
  264. SendBoxMsg(string);
  265. return 1;
  266. }
  267. stock SendBoxMsg(string[])
  268. {
  269. if(CurrentMsg == 0)
  270. {
  271. TextDrawShowForAll(Textdraw0);
  272. TextDrawSetString(Textdraw0,string);
  273. CurrentMsg++;
  274. }
  275. else if(CurrentMsg == 1)
  276. {
  277. TextDrawShowForAll(Textdraw1);
  278. TextDrawSetString(Textdraw1,string);
  279. CurrentMsg++;
  280. }
  281. else if(CurrentMsg == 2)
  282. {
  283. TextDrawShowForAll(Textdraw2);
  284. TextDrawSetString(Textdraw2,string);
  285. CurrentMsg++;
  286. }
  287. else if(CurrentMsg == 3)
  288. {
  289. TextDrawShowForAll(Textdraw3);
  290. TextDrawSetString(Textdraw3,string);
  291. CurrentMsg++;
  292. }
  293. else if(CurrentMsg == 4)
  294. {
  295. TextDrawShowForAll(Textdraw4);
  296. TextDrawSetString(Textdraw4,string);
  297. CurrentMsg++;
  298. }
  299. else if(CurrentMsg == 5)
  300. {
  301. TextDrawShowForAll(Textdraw5);
  302. TextDrawSetString(Textdraw5,string);
  303. CurrentMsg++;
  304. }
  305. else if(CurrentMsg == 6)
  306. {
  307. TextDrawShowForAll(Textdraw6);
  308. TextDrawSetString(Textdraw6,string);
  309. CurrentMsg++;
  310. }
  311. else if(CurrentMsg == 7)
  312. {
  313. TextDrawShowForAll(Textdraw7);
  314. TextDrawSetString(Textdraw7,string);
  315. CurrentMsg++;
  316. }
  317. else if(CurrentMsg == 8)
  318. {
  319. TextDrawShowForAll(Textdraw8);
  320. TextDrawSetString(Textdraw8,string);
  321. CurrentMsg++;
  322. }
  323. else if(CurrentMsg == 9)
  324. {
  325. TextDrawShowForAll(Textdraw9);
  326. TextDrawSetString(Textdraw9,string);
  327. CurrentMsg++;
  328. }
  329. else if(CurrentMsg == 10)
  330. {
  331. TextDrawShowForAll(Textdraw10);
  332. TextDrawSetString(Textdraw10,string);
  333. CurrentMsg++;
  334. }
  335. else if(CurrentMsg >= 12)
  336. {
  337. CurrentMsg = 0;
  338. }
  339. }
Advertisement
Add Comment
Please, Sign In to add comment