Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- Solltest du ein Filterscript erstellen, so schreibe unten bei Define über dem
- #if defined FILTERSCRIPT einfach folgendes:
- #define FILTERSCRIPT
- Falls es ein Gamemode wird, so schreibe es nicht dort hin!
- Scriptname: MessageSystem
- Version: V0.1
- Kategorie: Filterscript, Nachrichten
- Inhalt: Befehle zum eingeben einer Nachricht,
- ein Dialog der den Usern angezeigt wird
- Beschreibung: Mit diesem Filterscript kann man per Befehl eine eigene
- Nachricht an alle Spieler senden
- *******************************************************************************/
- //Include
- #include <a_samp>
- //New
- new news[1024];
- new name[MAX_PLAYER_NAME];
- new pClicked[MAX_PLAYERS];
- new sendtext[1024];
- //Define
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define DIALOG_SEND 1
- #define DIALOG_RNEWS 2
- #define DIALOG_NONEWS 3
- #define DIALOG_SENDTP 4
- #define DIALOG_RNEWSTP 5 //Zahlen bitte entsprechend ändern!
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" MessageSystem vor SA:MP V0.3d");
- print(" Version: V0.1 by Sonderzeichen");
- print("--------------------------------------\n");
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnGameModeInit()
- {
- //Du darfst das hier nicht benutzen, wenn du ein Filterscript erstellst!
- SetGameModeText("Blank Script");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnGameModeExit()
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
- SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/message", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_SEND, DIALOG_STYLE_INPUT, "[MS] Nachricht eingeben", "Bitte geben Sie eine Nachricht ein,\ndie allen Spielern angezeigt werden soll:", "Senden", "Abbr.");
- }
- return 0;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_SEND) // 1 Ist die Dialogid von dem Dialog, wo wir die Nachricht eingeben
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_NONEWS, DIALOG_STYLE_MSGBOX, "[MS] Achtung", "Wenn du doch eine Nachricht schreiben möchtest,\n benutze /message", "Ok", "Abbr.");
- }
- else
- {
- SendClientMessage(playerid, 0x219159FF, "» Die Nachricht wurde erfolgreich an alle Spieler gesendet «");
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- format(news, sizeof(news), "%s", inputtext);
- ShowPlayerDialog(playerid, DIALOG_RNEWS, DIALOG_STYLE_MSGBOX, "[MS] Neue Nachricht", news, "Ok", "Abbr.");
- }
- }
- }
- if(dialogid == DIALOG_SENDTP)
- {
- format(sendtext, sizeof(sendtext), "Ein Admin schrieb dir eine Nachricht:\n\n%s", inputtext);
- ShowPlayerDialog(pClicked[playerid], DIALOG_RNEWSTP, DIALOG_STYLE_MSGBOX, "[MS] Persönliche Nachricht", sendtext, "Ok", "Abbr.");
- }
- return 1;
- }
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- GetPlayerName(playerid,name,sizeof(name));
- ShowPlayerDialog(playerid,DIALOG_SENDTP,DIALOG_STYLE_INPUT,name,"Gib hier die Nachricht ein, die an den Spieler gesendet werden soll:","OK","Abbrechen");
- pClicked[playerid] = clickedplayerid;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement