Advertisement
Guest User

MessageSystemV0.2

a guest
Feb 7th, 2012
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 9.04 KB | None | 0 0
  1. /*******************************************************************************
  2. Solltest du ein Filterscript erstellen, so schreibe unten bei Define über dem
  3. #if defined FILTERSCRIPT einfach folgendes:
  4. #define FILTERSCRIPT
  5. Falls es ein Gamemode wird, so schreibe es nicht dort hin!
  6.  
  7. Scriptname:     MessageSystem
  8. Version:        V0.1
  9. Kategorie:      Filterscript, Nachrichten
  10. Inhalt:         Befehle zum eingeben einer Nachricht,
  11.                 ein Dialog der den Usern angezeigt wird
  12. Beschreibung:   Mit diesem Filterscript kann man per Befehl eine eigene
  13.                 Nachricht an alle Spieler senden
  14. *******************************************************************************/
  15.  
  16. //Include
  17. #include <a_samp>
  18.  
  19. //New
  20. new news[1024];
  21. new name[MAX_PLAYER_NAME];
  22. new pClicked[MAX_PLAYERS];
  23. new sendtext[1024];
  24.  
  25. //Define
  26. #define                 FILTERSCRIPT
  27. #if defined             FILTERSCRIPT
  28. #define DIALOG_SEND     1
  29. #define DIALOG_RNEWS    2
  30. #define DIALOG_NONEWS   3
  31. #define DIALOG_SENDTP   4
  32. #define DIALOG_RNEWSTP  5 //Zahlen bitte entsprechend ändern!
  33.  
  34. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  35. public OnFilterScriptInit()
  36. {
  37.     print("\n--------------------------------------");
  38.     print(" MessageSystem vor SA:MP V0.3d");
  39.     print(" Version: V0.1 by Sonderzeichen");
  40.     print("--------------------------------------\n");
  41.     return 1;
  42. }
  43.  
  44. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  45. public OnFilterScriptExit()
  46. {
  47.     return 1;
  48. }
  49.  
  50. #else
  51.  
  52. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  53. main()
  54. {
  55.     print("\n----------------------------------");
  56.     print(" Blank Gamemode by your name here");
  57.     print("----------------------------------\n");
  58. }
  59.  
  60. #endif
  61.  
  62. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  63. public OnGameModeInit()
  64. {
  65.     //Du darfst das hier nicht benutzen, wenn du ein Filterscript erstellst!
  66.     SetGameModeText("Blank Script");
  67.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  68.     return 1;
  69. }
  70.  
  71. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  72. public OnGameModeExit()
  73. {
  74.     return 1;
  75. }
  76.  
  77. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  78. public OnPlayerRequestClass(playerid, classid)
  79. {
  80.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  81.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  82.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  83.     return 1;
  84. }
  85.  
  86. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  87. public OnPlayerConnect(playerid)
  88. {
  89.     return 1;
  90. }
  91.  
  92. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  93. public OnPlayerDisconnect(playerid, reason)
  94. {
  95.     return 1;
  96. }
  97.  
  98. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  99. public OnPlayerSpawn(playerid)
  100. {
  101.     return 1;
  102. }
  103.  
  104. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  105. public OnPlayerDeath(playerid, killerid, reason)
  106. {
  107.     return 1;
  108. }
  109.  
  110. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  111. public OnVehicleSpawn(vehicleid)
  112. {
  113.     return 1;
  114. }
  115.  
  116. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  117. public OnVehicleDeath(vehicleid, killerid)
  118. {
  119.     return 1;
  120. }
  121.  
  122. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  123. public OnPlayerText(playerid, text[])
  124. {
  125.     return 1;
  126. }
  127.  
  128. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  129. public OnPlayerCommandText(playerid, cmdtext[])
  130. {
  131.     if (strcmp("/message", cmdtext, true, 10) == 0)
  132.     {
  133.         ShowPlayerDialog(playerid, DIALOG_SEND, DIALOG_STYLE_INPUT, "[MS] Nachricht eingeben", "Bitte geben Sie eine Nachricht ein,\ndie allen Spielern angezeigt werden soll:", "Senden", "Abbr.");
  134.     }
  135.     return 0;
  136. }
  137.  
  138. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  139. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  140. {
  141.     return 1;
  142. }
  143.  
  144. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  145. public OnPlayerExitVehicle(playerid, vehicleid)
  146. {
  147.     return 1;
  148. }
  149.  
  150. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  151. public OnPlayerStateChange(playerid, newstate, oldstate)
  152. {
  153.     return 1;
  154. }
  155.  
  156. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  157. public OnPlayerEnterCheckpoint(playerid)
  158. {
  159.     return 1;
  160. }
  161.  
  162. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  163. public OnPlayerLeaveCheckpoint(playerid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  169. public OnPlayerEnterRaceCheckpoint(playerid)
  170. {
  171.     return 1;
  172. }
  173.  
  174. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  175. public OnPlayerLeaveRaceCheckpoint(playerid)
  176. {
  177.     return 1;
  178. }
  179.  
  180. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  181. public OnRconCommand(cmd[])
  182. {
  183.     return 1;
  184. }
  185.  
  186. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  187. public OnPlayerRequestSpawn(playerid)
  188. {
  189.     return 1;
  190. }
  191.  
  192. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  193. public OnObjectMoved(objectid)
  194. {
  195.     return 1;
  196. }
  197.  
  198. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  199. public OnPlayerObjectMoved(playerid, objectid)
  200. {
  201.     return 1;
  202. }
  203.  
  204. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  205. public OnPlayerPickUpPickup(playerid, pickupid)
  206. {
  207.     return 1;
  208. }
  209.  
  210. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  211. public OnVehicleMod(playerid, vehicleid, componentid)
  212. {
  213.     return 1;
  214. }
  215.  
  216. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  217. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  218. {
  219.     return 1;
  220. }
  221.  
  222. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  223. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  224. {
  225.     return 1;
  226. }
  227.  
  228. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  229. public OnPlayerSelectedMenuRow(playerid, row)
  230. {
  231.     return 1;
  232. }
  233.  
  234. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  235. public OnPlayerExitedMenu(playerid)
  236. {
  237.     return 1;
  238. }
  239.  
  240. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  241. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  242. {
  243.     return 1;
  244. }
  245.  
  246. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  247. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  248. {
  249.     return 1;
  250. }
  251.  
  252. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  253. public OnRconLoginAttempt(ip[], password[], success)
  254. {
  255.     return 1;
  256. }
  257.  
  258. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  259. public OnPlayerUpdate(playerid)
  260. {
  261.     return 1;
  262. }
  263.  
  264. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  265. public OnPlayerStreamIn(playerid, forplayerid)
  266. {
  267.     return 1;
  268. }
  269.  
  270. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  271. public OnPlayerStreamOut(playerid, forplayerid)
  272. {
  273.     return 1;
  274. }
  275.  
  276. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  277. public OnVehicleStreamIn(vehicleid, forplayerid)
  278. {
  279.     return 1;
  280. }
  281.  
  282. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  283. public OnVehicleStreamOut(vehicleid, forplayerid)
  284. {
  285.     return 1;
  286. }
  287.  
  288. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  289. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  290. {
  291.     if(dialogid == DIALOG_SEND) // 1 Ist die Dialogid von dem Dialog, wo wir die Nachricht eingeben
  292.     {
  293.         if(response == 0)
  294.         {
  295.             ShowPlayerDialog(playerid, DIALOG_NONEWS, DIALOG_STYLE_MSGBOX, "[MS] Achtung", "Wenn du doch eine Nachricht schreiben möchtest,\n benutze /message", "Ok", "Abbr.");
  296.         }
  297.         else
  298.         {
  299.             SendClientMessage(playerid, 0x219159FF, "» Die Nachricht wurde erfolgreich an alle Spieler gesendet «");
  300.             for(new i=0; i < MAX_PLAYERS; i++)
  301.             {
  302.                 format(news, sizeof(news), "%s", inputtext);
  303.                 ShowPlayerDialog(playerid, DIALOG_RNEWS, DIALOG_STYLE_MSGBOX, "[MS] Neue Nachricht", news, "Ok", "Abbr.");
  304.             }
  305.         }
  306.     }
  307.    
  308.     if(dialogid == DIALOG_SENDTP)
  309.     {
  310.         format(sendtext, sizeof(sendtext), "Ein Admin schrieb dir eine Nachricht:\n\n%s", inputtext);
  311.         ShowPlayerDialog(pClicked[playerid], DIALOG_RNEWSTP, DIALOG_STYLE_MSGBOX, "[MS] Persönliche Nachricht", sendtext, "Ok", "Abbr.");
  312.     }
  313.     return 1;
  314. }
  315.  
  316. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  317. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  318. {
  319.     GetPlayerName(playerid,name,sizeof(name));
  320.     ShowPlayerDialog(playerid,DIALOG_SENDTP,DIALOG_STYLE_INPUT,name,"Gib hier die Nachricht ein, die an den Spieler gesendet werden soll:","OK","Abbrechen");
  321.     pClicked[playerid] = clickedplayerid;
  322.     return 1;
  323. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement