Guest User

Messages v1.2

a guest
May 17th, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.59 KB | None | 0 0
  1. /*==============================================================================================================
  2. *M3SS4GE SYST3M BY GIR0UD12* -All About Messages/Chat-
  3. ================================================================================================================
  4. FEATURES:
  5. * Random Messages
  6. * Welcome Messages
  7. * Join Messages
  8. * Leave Messages
  9. * Enter Vehicle Messages
  10. * Exit Vehicle Messages
  11. * /credits /vpannounce /vpsay /mscmds /heal
  12. * VP mean Veteran Player.Veteran Player mean 1000+ score :)
  13.  
  14. BONUS:
  15. Heal player with "TAICHI" anims and to stop the anim just press "ENTER".
  16. *You can turn on /heal command or turn off it by true/false
  17.  
  18. INFO:
  19. * You can edit this script but please dont remove CREDITS!!
  20. * Feel free to +rep me at forum.sa-mp.com
  21.  
  22. CREDITS:
  23. Script Date: 18/5/2013 Scripter: Giroud12 Script Version : v1.2
  24. ==================================================================================*/
  25. /*================================================================================*/
  26. #include <a_samp> /* THANKS TO SAMP TEAM */
  27. #include <zcmd> /* THANKS TO ZEEX */
  28. #include <sscanf> /* THANKS TO Y_LESS */
  29. /*================================================================================*/
  30. #define SERVERNAME YOURSERVERNAME /* CHANGE TO YOUR SERVER NAME */
  31. #define GMNAME YOURGMNAME /* CHANGE TO YOUR GM NAME */
  32. #define SERVEREOWNER SERVEROWNER /* CHANGE TO YOUR SERVER OWNER NAME */
  33. #define FORUMURL weburl.com /* CHANGE TO YOUR WEBSITE URL */
  34. #define VERSION v1.2 /*-------------------------------------*/
  35. #define DIALOG_CREDITS 0
  36. #define DIALOG_MSCMDS 1
  37. #define INFINITENO 9999999999
  38. #define HEALCMDS true
  39. /*================================================================================*/
  40. #define C_GREY 0xAFAFAFAA
  41. #define C_YELLOW 0xFFFF00AA
  42. #define C_RED 0xAA3333AA
  43. #define red "{E10000}"
  44. #define yellow "{F3FF02}"
  45. #define lightblue "{00C0FF}"
  46. #define white "{FFFFFF}"
  47. /*================================================================================*/
  48. new playersonline=0;
  49. /*================================================================================*/
  50. new RandomMSG[][] =
  51. {
  52. "*Welcome To Server : "#SERVERNAME" 0.3x*",
  53. "*Our Website : "#WEBURL"*",
  54. "*Server Owner : "#SERVEROWNER"*"
  55. /*Add More Messages*/
  56. /*Note: Last Messages Dont Put ,*/
  57. };
  58. /*================================================================================*/
  59. new VehicleNames[][] = {
  60. {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  61. {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  62. {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  63. {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  64. {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
  65. {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  66. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
  67. {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
  68. {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  69. {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  70. {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  71. {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  72. {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  73. {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  74. {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  75. {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  76. {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  77. {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  78. {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  79. {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  80. {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  81. {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  82. {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  83. {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  84. {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  85. {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
  86. {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  87. {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  88. {"Utility Trailer"}
  89. };
  90. /*================================================================================*/
  91. #if defined FILTERSCRIPT /* DEFINE IT FILTERSCRIPT */
  92. /*================================================================================*/
  93.  
  94. /*================================================================================*/
  95. public OnFilterScriptInit()
  96. {
  97. print("\n--------------------------------------");
  98. print("Loading...................");
  99. print("Messages System "#VERSION" BY GIROUD12 Loaded!");
  100. print("--------------------------------------\n");
  101. return 1;
  102. }
  103. /*================================================================================*/
  104. public OnFilterScriptExit()
  105. {
  106. print("\n--------------------------------------");
  107. print("Loading...................");
  108. print("Messages System "#VERSION" by GIROUD12 Unloaded!");
  109. print("--------------------------------------\n");
  110. return 1;
  111. }
  112. /*================================================================================*/
  113. #else
  114. /*================================================================================*/
  115. main()
  116. {
  117. print("\n----------------------------------");
  118. print(""#GAMEMODENAME"");
  119. print("----------------------------------\n");
  120. }
  121.  
  122. #endif
  123. /*================================================================================*/
  124. public OnGameModeInit()
  125. {
  126. SetTimer("SendMSG", 60000, true);
  127. return 1;
  128. }
  129. /*================================================================================*/
  130. forward SendMSG();
  131. /*================================================================================*/
  132. public OnPlayerConnect(playerid)
  133. {
  134. SendClientMessage(playerid, C_YELLOW, "*Welcome To "#SERVERNAME"*");
  135. SendClientMessage(playerid, C_YELLOW, "*The best SAMP Server 0.3x*");
  136. playersonline++;
  137. new string[128];
  138. format(string, sizeof(string), "*There are currently %d playing on this server*", playersonline);
  139. SendClientMessageToAll(C_GREY, string);
  140. new name[MAX_PLAYER_NAME];
  141. new ConnectMessage[256];
  142. format(ConnectMessage,sizeof(ConnectMessage),"*%s [ID:%d] has joined the server*", name, playerid);
  143. SendClientMessageToAll(C_GREY,ConnectMessage);
  144. return 1;
  145. }
  146. /*================================================================================*/
  147. public OnPlayerDisconnect(playerid, reason)
  148. {
  149. new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  150. GetPlayerName(playerid, pname, sizeof(pname));
  151. switch(reason)
  152. {
  153. case 0: format(string, sizeof(string), "%s has left the server. (Lost Connection)", pname);
  154. case 1: format(string, sizeof(string), "%s has left the server. (Leaving)", pname);
  155. case 2: format(string, sizeof(string), "%s has left the server. (Kicked)", pname);
  156. }
  157. SendClientMessageToAll(C_GREY, string);
  158. return 1;
  159. }
  160. /*================================================================================*/
  161. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  162. {
  163. new string[150];
  164. new modelid = GetVehicleModel(vehicleid);
  165. new car = modelid-400;
  166. format(string, sizeof(string), "You entered ~r~%s", VehicleNames[car]);
  167. GameTextForPlayer(playerid,string,3000,3);
  168. return 1;
  169. }
  170. /*================================================================================*/
  171. public OnPlayerExitVehicle(playerid, vehicleid)
  172. {
  173. new string[150];
  174. new modelid = GetVehicleModel(vehicleid);
  175. new car = modelid-400;
  176. format(string, sizeof(string), "You exited ~r~%s ", VehicleNames[car]);
  177. GameTextForPlayer(playerid,string,3000,3);
  178. return 1;
  179. }
  180. /*================================================================================*/
  181. public SendMSG()
  182. {
  183. new randMSG = random(sizeof(RandomMSG));
  184. SendClientMessageToAll(C_YELLOW, RandomMSG[randMSG]);
  185. }
  186. /*================================================================================*/
  187. COMMAND:vpannounce(playerid, params[])
  188. {
  189. new msg[180];
  190. if(sscanf(params, "s", msg)) return SendClientMessage(playerid, C_YELLOW, "USAGE: /announce [MESSAGES]");
  191. if (GetPlayerScore(playerid) >= 1000 && GetPlayerScore(playerid) < INFINITENO)
  192. {
  193. new string[180];
  194. format(string, sizeof(string), "*[VP]:~r~%s*",msg);
  195. GameTextForAll(string, 5000, 3);
  196. } else SendClientMessage(playerid, C_RED, "ERROR: You need to have 1000+ score!");
  197. return 1;
  198. }
  199. /*================================================================================*/
  200. COMMAND:credits(playerid, params [])
  201. {
  202. ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Credits",""yellow"Messages System v1.1\n---------------\n"white"Credits to :\n"lightblue"GIR0UD12 aka Shadowz "white"create this "yellow"Filterscript\n"lightblue"Team SAMP "white"for "yellow"#include <a_samp> ","Ok","");
  203. return 1;
  204. }
  205. /*================================================================================*/
  206. COMMAND:mscmds(playerid, params [])
  207. {
  208. ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"COMMANDS",""yellow"COMMANDS:\n---------------\n"white"Commands:\n"white"/vpsay : "red"only 1000+ score players !\n"white"/vpannounce : "red"only 1000+ score players !\n"white"/mscmds : "red"all system cmds !","Ok","");
  209. return 1;
  210. }
  211. /*================================================================================*/
  212. COMMAND:vpsay(playerid,params[])
  213. {
  214. new msg[180];
  215. if(sscanf(params, "s", msg)) return SendClientMessage(playerid, C_YELLOW, "USAGE: /vpsay [MESSAGES]");
  216. if (GetPlayerScore(playerid) >= 1000 && GetPlayerScore(playerid) < INFINITENO)
  217. {
  218. new string[180];
  219. format(string, sizeof(string), "*[VP]:~r~%s*",msg);
  220. SendClientMessageToAll(C_YELLOW, string);
  221. } else SendClientMessage(playerid, C_RED, "ERROR: You need to have 1000+ score!");
  222. return 1;
  223. }
  224. /*================================================================================*/
  225. #if HEALCMDS == false
  226. COMMAND:heal(playerid,params[])
  227. {
  228. ApplyAnimation(playerid,"PARK","Tai_Chi_Loop", 4.0, 1, 0, 0, 0, 0);
  229. SetPlayerHealth(playerid, 100.0);
  230. GivePlayerMoney(playerid, -500);
  231. SendClientMessage(playerid, C_YELLOW, "You just heal yourself and paid $500");
  232. return 1;
  233. }
  234. #endif
  235. /*================================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment