Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new ClickedPlayerID[MAX_PLAYERS]; //Every person will have a variable
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- new dialog[128];
- new clickedplayer[MAX_PLAYER_NAME];
- GetPlayerName(clickedplayerid, clickedplayer, sizeof(clickedplayer));
- format(dialog, sizeof(dialog), "Send a Message to %s", clickedplayer);
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Private Message",dialog,"Send","Cancel");
- ClickedPlayerID[playerid] = clickedplayerid; // This stores clickedplayerid's ID, so we can use it later on.
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1)
- {
- if(!response) return 0; // If you cancel this callback stops
- new message [128]; // the SencClientMessage
- new clickedplayer[MAX_PLAYER_NAME]; // a string to store names
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(ClickedPlayerID[playerid], clickedplayer, sizeof(clickedplayer)); // get the ClickedPlayerID by recieving it from the variable we stored it in.
- GetPlayerName(playerid, playername, sizeof(playername));
- format(message, sizeof(message), "You sent %s(%d): %s", clickedplayer, ClickedPlayerID, inputtext); // formated the message
- SendClientMessage(playerid, 0xFFFFFFFF, message); // Send the message to the player, to let him know what he sent and who to.
- format(message, sizeof(message), "PM from %s(%d): %s", playername, playerid, inputtext); // format the message to the person who recieves the PM
- SendClientMessage(ClickedPlayerID[playerid], 0xFFFFFFFF, message); // Send it
- return 1;
- }
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- ClickedPlayerID[playerid] = -1; // Safety measure
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- /*if(strcmp(cmdtext, "/pm", false, 3) == 0)
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "You can send PMs by double clicking on the player's name in the TAB"); // to let players know they can double click
- return 1;
- }
- return 0;*/ // uncomment this if you want to let people know about the way you can send people messages.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement